Page 2 of 2

Re: Everfrost Quest / NPC scripts

Posted: Sun Nov 29, 2015 11:40 pm
by Jabantiz
Sorry about the zone issue, still working on that but life is busy for me right now so not getting to much time to look into it. It might be possible to change the zone in the eq2db2 web editor but if not I can manually do it in the db, just let me know what character to move.

Re: Everfrost Quest / NPC scripts

Posted: Sun Dec 06, 2015 6:38 pm
by Jabantiz
Flunklesnarkin, when you get a chance can you test out zoning again, I think I have it fixed but if so there is massive server wide changes that will also need to be done, want some one else to verify it is fixed before working on those changes.

Re: Everfrost Quest / NPC scripts

Posted: Mon Dec 07, 2015 7:51 pm
by Flunklesnarkin
It seems fixed Jabantiz. I was able to zone with the /zone command.

I might try to test out the quests wednesday now. Thanks :D

Re: Everfrost Quest / NPC scripts

Posted: Tue Dec 08, 2015 10:30 pm
by Jabantiz
Thanks for testing it, had another player confirm /zone worked for them so I am probably going to go ahead with the server wide changes within the next few days, hopefully if every thing goes well no one will notice a difference after it goes live.

Re: Everfrost Quest / NPC scripts

Posted: Thu Dec 10, 2015 7:20 pm
by Flunklesnarkin
Cool beans

I tested out "Culling the Threat to the Pioneers" and "Further Culling". The first one worked properly. I made a small typo on the second one, but I corrected it and the second quest works properly as well.

I started working on "Supplies for the Pioneers". I have two problems I'm not sure how to solve at the moment. There is no real rush for a solution as I'm not sure I'll have much time to work on it until January anyways but figured I'd write them out while it's still fresh in my mind.

Issue Number 1:

The first problem is as soon as you accept the quest you are given a quest item that goes directly into your inventory. I see there are three functions that give the player items: SummonItem(), GiveQuestItem(), and GiveLoot(). The first two don't seem appropriate so I tried GiveLoot().

However, the GiveLoot() function makes a pop up window pop up for you to accept the item. On the Live servers you just get a message in your chat window and the item is automatically deposited into your inventory. There is no pop up windows or pop up text of any sort.

There is probably another function I'm missing but figured I'd ask for help instead of searching a long time :D

Issue Number 2:

When using the AddQuestStepChat() function I'm unable to suppress the quest step description and use only the task group description. It's probably an easy fix but I'm not sure where to find the luascript for the AddQuestStepChat() function. I wouldn't feel comfortable making the changes to the lua functions without review right now but I could probably submit some updates to you for review and implement if that'd help.

I took a couple of screenshots to make it easier to understand what I mean.

The first sceenshot is from the live server.

Image

The second screenshot is using the AddQuestStepChat() function (I haven't added in the coin reward yet either)


Image


Going from the second screenshot. The top check box is the TaskGroupDescription and the bottom check box is the quest step description (as defined in the wiki lua page description of the AddQuestStepChat() function)

This would probably be a fairly simple problem to solve by adding another binary parameter to the function that suppresses the quest description and leaves only the task group description. Then copy the quest description into the task group description. Kinda a double flop.

That way it'd just be a matter of using the same code already written.. then just doing a simple copy of the one parameter into the other and suppressing the original.



That's all I got time for today though.. until next time :)

Re: Everfrost Quest / NPC scripts

Posted: Thu Dec 10, 2015 10:57 pm
by Jabantiz
SummonItem() is what you are looking for, it will just put the item in the first free inventory slot and it has an optional param to give the message in the chat.

As for the quest window, until recently we never ran across a quest that did not have a task group description, and unfortunately our code relies on the task group and it is not so simple to suppress it. For now what you got is what we typically use, may not match live exactly but it is good enough until the quest system can be reworked/modified.

Re: Everfrost Quest / NPC scripts

Posted: Wed Jan 13, 2016 4:50 pm
by Flunklesnarkin
Thanks for the suggestion Jabantiz.

I changed the function to SummonItem() and the quest now behaves properly.

I finished the "Supplies for the Pioneers" quest after struggling a bit with the Deleted() and RemoveItem() functions.

I eventually tracked down the issue to the HasItem() function documentation. There is a third parameter to the HasItem() function that isn't listed on the wiki page. I found this after searching for a working example quest in the database. The RemoveItem() function wiki page also shows a non-working code snippet.

I ended up using the code snippet below to remove quest items when a quest is deleted. (Tastefully borrowed from another quest)

It loops through to delete multiples in case there are any bugs or other weirdness where you end up with more than one and can also be used for quests that have multiple of a single item as well. I used the same loop for removing the item upon quest completion.

Code: Select all

function Deleted(Quest, QuestGiver, Player)
     while HasItem(Player, 5642, 1) do
	  RemoveItem(Player, 5642)
     end
end
I tried to add that loop as a working example to the RemoveItem() wiki page but I'm getting the message "You are not a member of the required phpBB group." I was going to fix the HasItem() wiki page as well.


I also noticed that the lua quest function wiki page doesn't mention that you can use additional parameters.

Ex. The deleted function is shown as

Code: Select all

function Declined(Quest, Spawn)
but it also works using

Code: Select all

function Deleted(Quest, QuestGiver, Player)
Ex. The reload funcion is show as

Code: Select all

function Reload(Quest, Spawn, int32)
but it also works using

Code: Select all

function Reload(Quest, QuestGiver, Player, Step)
I've just started looking into these reload and delete functions but i'd like to eventually go through the quests i've created to make sure they get loaded and deleted properly and I figured I'd update the wiki while I'm figuring these functions out.


Other than that I started working on the script for the NPC Thyr Stormhammer and the quest Scouting the Jagged Plains. I'd like to figure out a way to pass additional information from one function to another. I read people hate global variables and I'm not sure if they work with your set up but there is probably another way that you might know of.

Thats all I got for now, things are still a bit crazy at work but I'll try to get here every once in a while to make a quest.

Happy 2016 EQ2 peoples.

Re: Everfrost Quest / NPC scripts

Posted: Wed Jan 13, 2016 11:10 pm
by Jabantiz
Thanks for finding the errors on the wiki, I will get them fixed. The wiki is by permission only do to a spam issue we had in the past, if you want to contribute let me know and I will add you.
Flunklesnarkin wrote:I also noticed that the lua quest function wiki page doesn't mention that you can use additional parameters.

Ex. The deleted function is shown as

Code: Select all

function Declined(Quest, Spawn)
but it also works using

Code: Select all

function Deleted(Quest, QuestGiver, Player)
Ex. The reload funcion is show as

Code: Select all

function Reload(Quest, Spawn, int32)
but it also works using

Code: Select all

function Reload(Quest, QuestGiver, Player, Step)
Your first example is Declined and Deleted which are two completely different functions, though this might just be a typo. Also you can name the parameter what ever you want but in those cases you will not get any extra info, in your reload example the second version with stuff added will have QuestGiver = the player with the quest, Player = the step id that is reloading, and Step = null or 0. It is hard coded on the server what will be passed and what order it will be passed and sadly the lua script can't change that.

Re: Everfrost Quest / NPC scripts

Posted: Sun Feb 07, 2016 3:01 pm
by Flunklesnarkin
Thanks for the feedback Jantiz, that was just a typo.. the parameters are the same for all those functions on the wiki page.

I'll keep in mind that the parameters are hard coded. I was a bit confused as the parameters were named different things and some of the functions listed showed more parameters than what the wiki says are allowed. Additional information is ignored, it makes sense now.


I started working on the script for the quest "A Pioneer without a Wagon".

The part I'm stuck on is how to properly use the AddQuestStep() function. I looked at other examples that used the AddQuestStep() function but there has to be an additional set up for that particular function as it seems to be a generic function that doesn't check for any completion conditions.

How would you set the completion conditions or keep tally of quest progress? In this case it would be picking up crates.

Re: Everfrost Quest / NPC scripts

Posted: Sun Feb 07, 2016 3:42 pm
by Jabantiz
If you need to increment progress (which is sounds like you need) then when ever the quest should progress you would use AddStepProgress() so for the crates, they would need a spawn script with the casted_on function, when ever the player clicks on the crate the entity command will go to that function and you can increment with AddStepProgress. This will also trigger the complete action when it reaches its goal (3/3 for example)

If you want to just finish off the step, no matter what is left you can use SetStepComplete(), this works on all types of steps too not just the generic one.

Re: Everfrost Quest / NPC scripts

Posted: Sun Feb 07, 2016 3:47 pm
by Flunklesnarkin
That makes sense, thanks for the explanation Jabantiz.

I'll give that a try next time. Almost done with the quest "Scouting the Jagged Plains" and about out of time for today.

Re: Everfrost Quest / NPC scripts

Posted: Thu Mar 17, 2016 5:09 pm
by Flunklesnarkin
It's been a busy month for me and I'm not sure when the next time I will be able to work on the quest scripts but I'll find time at some point. :D

Re: Everfrost Quest / NPC scripts

Posted: Thu Mar 17, 2016 5:16 pm
by Cynnar
I know what you mean Flunklesnarkin. I as well have had a lot going on IRL that has kept me away. :( O hope to get some questions done next week, but it isn't looking very promising.