Page 1 of 1

Reward After quest

Posted: Thu Oct 03, 2019 12:58 pm
by turtleking4597
After watching the tutorial videos on Youtube, I was wondering if after finishing a quest it would be possible to add rewards? I have already created my own inventory system and money system prior to purchasing the product, and was wondering if its possible to give rewards after a quest completion to my own scripts?

Re: Reward After quest

Posted: Thu Oct 03, 2019 1:30 pm
by Tony Li
Sure! Typically the player will complete a quest by talking to an NPC. In this conversation, you'll use the Script field to set the quest state to success. You can use the same Script field give rewards. To do this, register your own script method(s) with Lua so you can call them in the Script field.

So the Script field might end up looking something like:

Code: Select all

SetQuestState("My Quest", "success);
GiveGold(50);
GiveItem("Magic Sword");
(Assuming you've registered script methods named GiveGold and GiveItem.)

More info:

Re: Reward After quest

Posted: Thu Oct 03, 2019 2:15 pm
by turtleking4597
Thank you so much!! After playing around with it, I got it to work with my own systems!.

Re: Reward After quest

Posted: Thu Oct 03, 2019 2:31 pm
by Tony Li
Great! Glad to help.