Page 2 of 2
Posted: Mon Sep 01, 2008 2:23 pm
by LethalEncounter
For reloaded quests from the DB I am calling a special LUA function called Reload(Quest, QuestGiver, Player, Step) that allows you to customize the quest depending on which step the player is on. This is necessary because some quests (ie Art of Combat or whatever it was called) adds steps along the way. So if a player was on step 3 of the quest the function would be called for steps 1 and 2 since they were already completed. Inside of this function you would need to add the steps , update text, etc just as if the player completed it initially. In fact if you aren't doing anything too crazy you could just call the existing lua function for that step if you wanted.
Here is the question: Would you like it to stay this way, or name the functions Reload%i (ie Reload1, Reload2, etc) with the number on the end being the completed step. It doesnt matter to me as it is a small change in the code, but it might make a huge different to you since you wont have to do a bunch of ifs for the steps.
Posted: Mon Sep 01, 2008 2:25 pm
by Scatman
Ok so reload is going to be a function defined inside of the quest script then?
Posted: Mon Sep 01, 2008 2:28 pm
by LethalEncounter
Yes, forget about /reload quests. That works fine. I am talking about a LUA function that is called when a players quest is loaded from the database instead of through chatting with NPCs.
Posted: Mon Sep 01, 2008 2:40 pm
by Scatman
Ahh ok so is this what you're getting at?
Reload(Quest, QuestGiver, Player, Step)
then inside this function I would specify:
if step == 1 then
-- update step 1
elseif step == 2 then
-- update step 2
etc..
end
Sorry if I'm having trouble understanding this =)
Posted: Mon Sep 01, 2008 2:40 pm
by LethalEncounter
OK, I got quests loading from the database. If you want me to change it to use multiple Reload functions I'll do that later. Here is an example Reload function that gets your Art of Combat quest to successfully load its status when a player logs off and back on:
Code: Select all
function Reload(Quest, QuestGiver, Player, Step)
if Step == 1 then
step1_complete_talkToHayl(Quest, QuestGiver, Player)
else
if Step == 2 then
step2_complete_killedSparringPartner(Quest, QuestGiver, Player)
else
if Step == 3 then
step3_complete_talkToHayl(Quest, QuestGiver, Player)
end
end
end
end
The reason we need this Reload function is that is some cases you won't want to run the exact same code for reloading the quest as you did when the player did that steo normally. IE: If you spawn a special spawn for a previous step, you dont want to spawn it again when the player logged off and back on.
Edit: BTW this code is on public SVN now.
Posted: Mon Sep 01, 2008 2:42 pm
by Scatman
Looks like I was right, heh. Ok, that's fine. Thanks!
Posted: Tue Sep 02, 2008 5:25 pm
by Scatman
Ok, the new quest updates work and loading the quest progress works with one exception. I got a quest and then got to the end of it, but didn't hand it in. I deleted the quest and logged off and back on, and when I logged back on I had the quest again and it was back where it was when I tried to delete it.
Posted: Tue Sep 02, 2008 6:26 pm
by LethalEncounter
Oh heh, yah I forgot to delete the quest from the DB if they deleted it in game

Good catch.
Posted: Tue Sep 02, 2008 7:59 pm
by Scatman
I found another problem

When you start having more than 1 grouptasktext, any step that is updated after that seems to use the very 1st grouptasktest.

So here every update after I completed that first taskgrouptext, will show the pop up message, "I reported to Sergeant Haggus and have been assigned my first duty."
Posted: Wed Sep 03, 2008 2:01 pm
by LethalEncounter
It is only the popup message that is incorrect right?
Posted: Wed Sep 03, 2008 2:58 pm
by Scatman
Yep, just the popup message. Everything else works perfectly.
Posted: Wed Sep 03, 2008 3:01 pm
by LethalEncounter
Could you pm me that quest? I don't see anything immediately wrong with the code so I will need to debug it further.
Posted: Wed Sep 03, 2008 5:04 pm
by LethalEncounter
Fixed, I also fixed a couple of other bugs with it that you may not have noticed. One was the double update if you updated the taskgrouptext. Another was the out of order tasks if you loaded the progress from the DB. BTW be sure to read the private dev forum, there is a post you might be interested in

Posted: Wed Sep 03, 2008 5:07 pm
by Scatman
You rock man, thanks. Yep, saw it - just replied.
Posted: Wed Sep 03, 2008 9:09 pm
by Scatman
Got another one for ya

It's weird and I'm not sure exactly what is causing it but I *believe* it's /repop. What happens is, sometimes when you hail an NPC, they will only spit out the first conversation dialog, then when you click on the conversation option to continue the conversation, nothing happens and the conversation disappears.
I don't know if it's linked directly to quests but as far as I've seen it's only happened when the NPC offers or gives a quest update. Now, the weird part is, if I /kill the mob, the corpse of that NPC will talk to me, give quest updates like normal. They will do the same thing if I /kill and then /repop right away, they will act normal and talk to me and give me quest updates. If I just try a /repop without killing the NPC, he will act the way he was previously and not talk to me and not give me quest updates.
I'm not sure how this gets caused, it appears to be random to me.