Page 1 of 1

Scripting help

Posted: Wed Jan 27, 2010 1:12 am
by Alexander Knight
For all you guys that need help. Paste a bit of script and hopefully it will get corrected.

Ermm how do you select multiple options? Like this:

Code: Select all

"Quest",english, queststatus=0->"Quest? Hmm, I do need some XXX, I will be able to make my potion if you get me these", queststatus=1
"Herb", english, queststatus=1->"Have you got them herbs yet?",queststatus=2
"Yes",english,queststatus=2->"item(<Iron Ingot>,all)>10->"Arrr! Thank you!.",deleteitem(<Iron ingot>,10),money+50,inform "you watch the druid drop the potions into the cauldren.",queststatus=3
"No",queststatus=2-> "Well go get them.",queststatus=1
"Herb",queststatus=3->"I've already got the herbs thank you. But you could get me a new sickle of you want some more work.", queststatus=4
"sickle", queststatus=4->"Have you got the sickle?", queststatus=5
"Yes", queststatus=5->item(<Sickle>,all)>1->"Thank you dear!.",deleteitem(<Sickle>,1),money+50,inform "You watch the druid work happily with her new sickle"
"No", queststatus=5->"Could you get me one? Mine's blunt",queststatus=4
Or do you have to do something else?

Posted: Wed Jan 27, 2010 7:17 am
by Llama
No idea with what you mean by multiple options. You can keep adding to both ends and it'll be a giant end.

so

"Hello". language=english, skill(General,Cheesemaking),race=human -> "Me no want to talk to you", deleteitem(5,2,3),Skill(General,BeingImpolite)+42

Is that what you meant?

If you do that, the right side will add trigger when all the conditions on the left are true.

Posted: Wed Jan 27, 2010 8:07 am
by Estralis Seborian
Try to avoid "yes" and "no" as triggers. If you REALLY need them as triggers, make use of "state". Also, reread the syntax of inform.

Why do I have to bring iron ingots if the NPC asks for herbs?!

And why herb as trigger if you sent the player on a QUEST?

You need many, many more triggers. Most players do not want to guess triggers. e.g. for a quest, I use quest, task, adventure.

Also, why "herb",english->... ? What if I am german and write english? I could NEVER solve this quest!

Posted: Wed Jan 27, 2010 1:08 pm
by Estelwen
The Ingot thing was because i used another NPC as a template.

And shall i delete the ,English/,German bit?

And by multiple answers i mean "Do you want a sword or wand","sword", "wand" or "Have you got the herbs yet?", "Yes", "no"

Posted: Wed Jan 27, 2010 1:15 pm
by Estralis Seborian
No, you shall not delete it but use it to seperate english and german responses. Example:

Code: Select all

"Hallo",german->"Oh hallo, willst du Sauerkraut und Wiener Würstchen?"
"Hallo",english->"Oh, hallo, do you want fish and chips?"
If you want to be a pro, you do it like this:

Code: Select all

"Hallo",german->"Oh hallo, willst du Sauerkraut und Wiener Würstchen?"
"Hallo"->"Oh, hallo, do you want fish and chips?"
Those who are not germans ARE english, at least in terms of our account system.

If you have an obvious trigger, you do it like this:

Code: Select all

"Würstchen"->"Hier sind deine Wiener."
"Fish"->"Here you go, fatty fish and chips."
No need to check the language here!

I don't know what you mean with multiple answers, sorry. You mean something like this?

Code: Select all

"Gimme stuff"->"Do you want a sword or a wand?"
"wand"->"Bleh, I won't give you a wand."
"sword"->"Get lost, you get no sword from me!"
You better use state here!

Posted: Wed Jan 27, 2010 1:34 pm
by Keikan Hiru
Estralis Seborian wrote:[...]
You better use state
Which would be something like this:

Code: Select all

"reward" -> "Oh, thank you for completing this task. Would you like to recive a mana or a healing potion?", state=2
"belohnung" -> "Oh, Danke! Möchtest du einen Mana- oder einen Heiltrank?", state=2
"mana", english, state=2 -> "Here you go.", item([ID Mana], 1, 666,0)
"mana", german, state=2 -> "Da hast du's.", item([ID Mana], 1, 666,0)
"healing", state=2 -> "'ave a taste.",  item([ID Heal], 1, 666,0)
"heiltrank", state=2 -> "Nimm 'nen Schluck.", item([ID Heal], 1, 666,0)
[...]

Posted: Wed Jan 27, 2010 9:24 pm
by Alexander Knight
Oh okay, thats all i needed to know :) thanks