![]() |
Quest help (from m:rpge) - Printable Version +- Mirage Engine (https://mirage-engine.uk/forums) +-- Forum: Mirage Source (Nostalgia) (https://mirage-engine.uk/forums/forumdisplay.php?fid=61) +--- Forum: Archive (2006-2011) (https://mirage-engine.uk/forums/forumdisplay.php?fid=18) +---- Forum: General (https://mirage-engine.uk/forums/forumdisplay.php?fid=17) +---- Thread: Quest help (from m:rpge) (/showthread.php?tid=1834) |
Quest help (from m:rpge) - Forte - 16-06-2008 Attempted to rip quests out of m:rpge, all started working nice. Quests saved/loaded, quest data attached to Npcs saved/loaded aswell. 'Cept one thing, i can't seem to trigger any quests. So.. heres what I got basically, Code: ' Check for an npc Code: Sub StartQuest(ByVal index As Long, ByVal QuestID As Long) Anyone wanna help me out here whats wrong or why they arent being trigged would be appreciated Re: Quest help (from m:rpge) - Rian - 16-06-2008 Code: If Npc(MapNpc(GetPlayerMap(index), i).Num).QuestID > 0 Then Put that in your attacknpc sub. I think it works fine if you put it around the part that sends the npcs "say" message Re: Quest help (from m:rpge) - Forte - 16-06-2008 blech no luck, any more ideas Re: Quest help (from m:rpge) - Ambientiger - 17-06-2008 Can't really see anything wrong with it. I take it that you can start/finish a quest just by clicking on an NPC? Code: If MapNpc(GetPlayerMap(index), i).X = X And MapNpc(GetPlayerMap(index), i).y = y Then Code: If (SetCurrentQuest(index, QuestID, Player(index).Char(Player(index).CharNum)) = True) Then Re: Quest help (from m:rpge) - Forte - 17-06-2008 yeah the x's are fine like that, just defined as caps. Here's SetCurrentQuest; Code: Function SetCurrentQuest(ByVal index As Long, ByVal QuestID As Long, ByRef Qplayer As PlayerRec) As Boolean Re: Quest help (from m:rpge) - Ambientiger - 17-06-2008 No answer just yet I'm afraid, just a couple more questions. Is the ByRef passing neccesary further on in the code? surely just using Player(index).Char(Player(index).CharNum).Level etc would work okay, I'm not really familiar with m:RPGe code. And, not so much a question, more of a suggestion on how to find out why it isn't working. You probably already know how to debug, but please, humour me and just check through the following. Without all the code to follow I need to pinpoint the exact area in the code that isn't working; Open the server in the VB IDE and set a Breakpoint on the Call StartQuest(index, Npc(MapNpc(GetPlayerMap(index), i).Num).QuestID) line of code from your first post and run the server in debug mode. Now start up the client and click on an npc that you know has a quest linked to it, the server should now break and pause on the Call to StartQuest. (If the server doesn't break the problem is somewhere else in the code.) Using F8 step through the code and find out at which point in StartQuest or SetCurrentQuest the code fails. Get back to me with the results and we'll take it from there, thnxs. |