Need help making/fixing quests
I am trying to fix a broken quest. I fixed the pub and changed the adventurer to a quest npc and put the correct script number in.
She finally talks to me now and I start the quest but the kill count doesn't go up. It just says n/a
Here is the script. Also how do I put the scripts in this forum to make them look nicer?
Main
{
questname "Piglet Trouble"
version 1
}
state Begin
{
desc "Kill 10 normal piglets."
action ShowHint("Quest reward : 100 EXP, 25 gold")
action AddNpcText( 28 , "Those piglets are a real plague, could you help me get ride of them?" );
action AddNpcText( 28 , "Could you kill 5 normal piglets for me? Press on your [CTRL] key to attack." );
action AddNpcInput( 28 , 1 , "No thanks");
action AddNpcInput( 28 , 2 , "Sounds good.");
rule InputNpc( 1 ) goto Reset
rule KilledNpcs( 230, 10) goto Talk2
rule EnterMap( 1 ) goto Reset
rule EnterMap( 5 ) goto Reset
}
state Talk2
{
desc "Talk to the village adventurer."
action AddNpcChat( 28 , "Great job!" );
action AddNpcText( 28 , "Thank you so much thats better, please accept this gold for your great work." );
rule TalkedToNpc( 28 ) goto GetReward // requires to talk
rule EnterMap( 1 ) goto Reset
rule EnterMap( 5 ) goto Reset
}
state GetReward
{
action ShowHint("You gained 100 EXP and 25 gold!");
action PlaySound(17);
action GiveExp(100)
action GiveItem( 1 , 25)
action End();
}
state Reset
{
action ShowHint("Piglet trouble quest aborted..")
action Reset() // reset and abort quest
}
6 years, 26 weeks ago
|
Re: Need help making/fixing quests
I haven't written a quest in a long time so I'm not sure if this is the problem, but you aren't handling a response to clicking the second input "Sounds good.". Add another inputnpc rule for when "sounds good" is clicked, sending it to a quest state which will have the KilledNPCs rule,
instead of having that in the begin state.
EDIT: and formatting on here has always sucked. some members have proposed adding a code tag for easier viewing. Sausage is slacking. ---
stay tuned.
6 years, 26 weeks ago
|
Drewbob
Joined: 5th Jan 2017
Posts: 130
Re: Need help making/fixing quests
As Andrewbob has said you need to add a rule for "sounds good"
Since it does not have a rule it gets stuck in limbo
6 years, 26 weeks ago
|
Re: Need help making/fixing quests
andrewbob1 posted: (30th Oct 2017, 12:05 pm)
I haven't written a quest in a long time so I'm not sure if this is the problem, but you aren't handling a response to clicking the second input "Sounds good.". Add another inputnpc rule for when "sounds good" is clicked, sending it to a quest state which will have the KilledNPCs rule,
instead of having that in the begin state.
EDIT: and formatting on here has always sucked. some members have proposed adding a code tag for easier viewing. Sausage is slacking.
Can I just make anything a state? What would you put? I am new to scripting. I put goto Talk2 but that just makes me automatically complete the quest
Nevermind! I didn't realize I could just make up a state. Got it fixed :)
6 years, 26 weeks ago
|
Drewbob
Joined: 5th Jan 2017
Posts: 130
Re: Need help making/fixing quests
You can make as many states as you need
6 years, 26 weeks ago
|
Re: Need help making/fixing quests
Drewbob posted: (30th Oct 2017, 01:34 pm)
You can make as many states as you need
Now I am having problems with an npc shop. her menu pops up and i can craft and sell from her but i cant buy anything from her.
100.trade = 258,0,5, 21,5,1, 151,5,1, 144,5,1, 408,5,1, 451,5,1
6 years, 26 weeks ago
|
Apollo
Administrator
Joined: 14th Apr 2009
Posts: 2759
Re: Need help making/fixing quests
The quest displayed n/a because the KilledNpcs rule was not the first listed rule in the begin state. It would have worked if moved up a line. As far as the shop goes, if an item doesn't have a buy value and just a sell value list it at the end of the shop list.
6 years, 26 weeks ago
|
Re: Need help making/fixing quests
Apollo posted: (30th Oct 2017, 02:25 pm)
The quest displayed n/a because the KilledNpcs rule was not the first listed rule in the begin state. It would have worked if moved up a line. As far as the shop goes, if an item doesn't have a buy value and just a sell value list it at the end of the shop list.
Yes! Thank you so much. I will make a new post if I run into another issue :)
6 years, 26 weeks ago
| | | | | | | | |