Help to verb options? (disappear and give 2 prints way)
Yukari
31 May 2014, 21:49Hello! I have two questions.
I am making a game a little very "social", so when the player meet someone new have many Link options/verbs. Like "Say Hello", "Ask for the key", "Ask her name", "introduce yourself", for instance. (The social options give more points)
So...
Question 1:
I want that if the player first choose is not "hello" this dissapear from the verb options. How I do that?
Plus: I want to erase the options one they comply they functions (the player dont need says "hello" twice, right?)
Question 2:
I want the game print differents things depending if the player have used a particulary verb before.
Like if you dont use "introducing yourself" then when you use "ask for the key" the game will tell you something like "And who the hell are you?".
Then If you use "Introducing yourself" the print of "ask for the key" will change to "sure! take the key!".
I tryed with the "If" opcion but I only see options with objects and neither with verbs. So... Help?
Thanks!!
I am making a game a little very "social", so when the player meet someone new have many Link options/verbs. Like "Say Hello", "Ask for the key", "Ask her name", "introduce yourself", for instance. (The social options give more points)
So...
Question 1:
I want that if the player first choose is not "hello" this dissapear from the verb options. How I do that?
Plus: I want to erase the options one they comply they functions (the player dont need says "hello" twice, right?)
Question 2:
I want the game print differents things depending if the player have used a particulary verb before.
Like if you dont use "introducing yourself" then when you use "ask for the key" the game will tell you something like "And who the hell are you?".
Then If you use "Introducing yourself" the print of "ask for the key" will change to "sure! take the key!".
I tryed with the "If" opcion but I only see options with objects and neither with verbs. So... Help?

Thanks!!
HegemonKhan
31 May 2014, 22:51your game design choice of working with the Verbs, requires quite a bit of advanced coding...
if you don't mind changing your design, this method would be much easier and simplier:
Object: your childhood female friend: Sarah
Verb: chat (see below)
sarah.topics1 = NewStringList ()
list add (sarah.topics, "Wow, you sure are pretty, Sarah!")
list add (sarah.topics, "Ugh, you got so ugly, Sarah!")
etc etc etc
sarah.topics2 = NewStringList ()
list add (sarah.topics, "Offer her a wedding ring!")
list add (sarah.topics, "Kiss her!")
etc etc etc
show menu ("What do you say to Sarah?", sarah.topics1, false) {
-> if (result = "Wow, you sure are pretty, Sarah!") {
->-> show menu ("what do you do next?", sarah.topics2, false) {
->->-> etc etc etc
-> else if (result = ...) {
->-> etc etc etc
or, you can use or also use: string and~or script dictionaries too.
and~or you can also use booleans too, though this can be very cumbersome, here's an example (but it can be done with choosen dialogue repsonses too, in a similar way):
game.acquired_the_dragon_slayer_sword = false
game.killed_the_dragon = false
Object: dragon
Verb: fight (see below)
if (game.acquired_the_dragon_slayer_sword = true) {
-> msg ("you kill the dragon")
-> game.killed_the_dragon = true
} else if (game.acquired_the_dragon_slayer_sword = false) {
-> msg ("the dragon kills you")
-> msg ("GAME OVER")
-> finish
}
Turnscript: global_turnscript
if (game.killed_the_dragon = true) {
-> msg ("You rescue the princess!")
-> msg ("You won the game, congratulations!")
-> finish
}
-----------
your Objects' Verbs (the buttons and hyperlinks) are actually a built-in special StringList, called~named~known_as, as: "displayverbs" (and "inventoryverbs" is for when Objects are in the player's inventory, for a quick explanation: "take" is included in the "displayverbs" StringList, but NOT in the "inventoryverbs" StringList, for obvious reasons).
so in a script, you can use (for an example, using some aspects from Pixie's Spell Library):
list add (spell.displayverbs, "cast")
list add (spell.inventoryverbs, "learn")
list remove (spell.displayverbs, "cast")
list remove (spell.inventoryverbs, "learn")
there's also all of the GUI~Editor's different setting options for these things too (to automatically include~display all display~inventory verbs ~ both your custom created verbs and the built-in default display~inventory verbs, or just the default built-in ones, and etc options).
and in-code or in the GUI~Editor's code view mode, there's a few more options you can do too, like the ' <attr name="displayverbs" type=listextend'>Fight</attr> ', to just add more verbs to the list, instead of re-writing~coding in a new list of verbs: ' <attr name="displayverbs" type="simplestringlist">Take;Use;Give;Fight</attr> '.
------------
if you want to keep your method of working with the Verbs, then you got to learn how to use lists and dictionaries, and how to add~remove items from them, and etc (search for "HK's 'explore' and 'travel' code" ~ to find example code ~ this uses the same stuff you want to do with your dialogue Verbs).
here it is:
viewtopic.php?f=10&t=4224&hilit=HK%27s+%27explore%27+and+%27travel%27+code
enjoy...
(ask if you want help in understanding and doing this... as this is quite a bit advanced stuff)
------------------
you may want to take a look at these links too:
1. http://quest5.net/wiki/How_to
2. viewforum.php?f=18
3. http://quest5.net/wiki/Using_Types (read through all, it has Pixie's spell library, and check on the links too on this page)
4. http://quest5.net/wiki/Using_Types_and_Tabs_(Advanced) (continued from #3, it has the download file of Pixie's spell library)
----------------
hope, this post offers some help to you, hehe
if you don't mind changing your design, this method would be much easier and simplier:
Object: your childhood female friend: Sarah
Verb: chat (see below)
sarah.topics1 = NewStringList ()
list add (sarah.topics, "Wow, you sure are pretty, Sarah!")
list add (sarah.topics, "Ugh, you got so ugly, Sarah!")
etc etc etc
sarah.topics2 = NewStringList ()
list add (sarah.topics, "Offer her a wedding ring!")
list add (sarah.topics, "Kiss her!")
etc etc etc
show menu ("What do you say to Sarah?", sarah.topics1, false) {
-> if (result = "Wow, you sure are pretty, Sarah!") {
->-> show menu ("what do you do next?", sarah.topics2, false) {
->->-> etc etc etc
-> else if (result = ...) {
->-> etc etc etc
or, you can use or also use: string and~or script dictionaries too.
and~or you can also use booleans too, though this can be very cumbersome, here's an example (but it can be done with choosen dialogue repsonses too, in a similar way):
game.acquired_the_dragon_slayer_sword = false
game.killed_the_dragon = false
Object: dragon
Verb: fight (see below)
if (game.acquired_the_dragon_slayer_sword = true) {
-> msg ("you kill the dragon")
-> game.killed_the_dragon = true
} else if (game.acquired_the_dragon_slayer_sword = false) {
-> msg ("the dragon kills you")
-> msg ("GAME OVER")
-> finish
}
Turnscript: global_turnscript
if (game.killed_the_dragon = true) {
-> msg ("You rescue the princess!")
-> msg ("You won the game, congratulations!")
-> finish
}
-----------
your Objects' Verbs (the buttons and hyperlinks) are actually a built-in special StringList, called~named~known_as, as: "displayverbs" (and "inventoryverbs" is for when Objects are in the player's inventory, for a quick explanation: "take" is included in the "displayverbs" StringList, but NOT in the "inventoryverbs" StringList, for obvious reasons).
so in a script, you can use (for an example, using some aspects from Pixie's Spell Library):
list add (spell.displayverbs, "cast")
list add (spell.inventoryverbs, "learn")
list remove (spell.displayverbs, "cast")
list remove (spell.inventoryverbs, "learn")
there's also all of the GUI~Editor's different setting options for these things too (to automatically include~display all display~inventory verbs ~ both your custom created verbs and the built-in default display~inventory verbs, or just the default built-in ones, and etc options).
and in-code or in the GUI~Editor's code view mode, there's a few more options you can do too, like the ' <attr name="displayverbs" type=listextend'>Fight</attr> ', to just add more verbs to the list, instead of re-writing~coding in a new list of verbs: ' <attr name="displayverbs" type="simplestringlist">Take;Use;Give;Fight</attr> '.
------------
if you want to keep your method of working with the Verbs, then you got to learn how to use lists and dictionaries, and how to add~remove items from them, and etc (search for "HK's 'explore' and 'travel' code" ~ to find example code ~ this uses the same stuff you want to do with your dialogue Verbs).
here it is:
viewtopic.php?f=10&t=4224&hilit=HK%27s+%27explore%27+and+%27travel%27+code
enjoy...

(ask if you want help in understanding and doing this... as this is quite a bit advanced stuff)
------------------
you may want to take a look at these links too:
1. http://quest5.net/wiki/How_to
2. viewforum.php?f=18
3. http://quest5.net/wiki/Using_Types (read through all, it has Pixie's spell library, and check on the links too on this page)
4. http://quest5.net/wiki/Using_Types_and_Tabs_(Advanced) (continued from #3, it has the download file of Pixie's spell library)
----------------
hope, this post offers some help to you, hehe
Yukari
01 Jun 2014, 20:05HegemonKhan you're becoming my hero hahahaha
The links are pretty usefull, thanks. I will check all this and see how I make it work.
Thanks!
The links are pretty usefull, thanks. I will check all this and see how I make it work.
Thanks!
HegemonKhan
01 Jun 2014, 23:03If you need help, I can do this, though it'd take quite some effort and time too, as I'm just a beginner with coding. Someone with code experience, can do the coding for you much faster and better than I can. But, if you need help, I can help you with learning how to do it and with crafting actual code ~ actually making it work for you for your game.
HegemonKhan
07 Jun 2014, 19:04here's my example (work still in progress, lol) of what I got done so far for you, of without using multiple verbs (I'll eventually get to giving an example with using multiple verbs, after I get done with this example):
(I've been trying to help you, but this is slow, as I'm not good with coding, and setting up the social questions is complex as it'll depend on your choices... I'm not used to dealing with this level of complexity yet, and not being good at coding makes it, that much harder for me, it'll take me some time to get this stuff done, whereas someone who is good at coding and also who have done this sort of complexity many times already, can get example code out to you much faster and easier than I can.)
(I'm still using the older quest version of "540", instead of the newest quest version of "550", so there may be some differences between the two in terms of some of their code lines' syntax~format~structure. You can try to copy and paste my game code into a new game file of yours, changing the ' <asl version="540"> ' to ' <asl version="550"> ', and maybe it'll work, but if not, then you'd need to change some code lines to how they're newly structured~syntaxed~formatted in~for quest version "550")
(I haven't tested this either, so there's probably errors in my code)
(hopefully, you can get the pattern structure of how to build what you want done, from this example work in progress below)
use the quest wiki, for using these things:
list add
list remove
ListContains
ListCombine or list combine (not sure on it's syntax, lol ~ too lazy to look it up)
ListExclude or list exclude (not sure on it's syntax, lol ~ too lazy to look it up)
Object.Attribute = NewStringList ()
Object.Attribute = NewObjectList ()
etc etc etc
(I've been trying to help you, but this is slow, as I'm not good with coding, and setting up the social questions is complex as it'll depend on your choices... I'm not used to dealing with this level of complexity yet, and not being good at coding makes it, that much harder for me, it'll take me some time to get this stuff done, whereas someone who is good at coding and also who have done this sort of complexity many times already, can get example code out to you much faster and easier than I can.)
(I'm still using the older quest version of "540", instead of the newest quest version of "550", so there may be some differences between the two in terms of some of their code lines' syntax~format~structure. You can try to copy and paste my game code into a new game file of yours, changing the ' <asl version="540"> ' to ' <asl version="550"> ', and maybe it'll work, but if not, then you'd need to change some code lines to how they're newly structured~syntaxed~formatted in~for quest version "550")
(I haven't tested this either, so there's probably errors in my code)
(hopefully, you can get the pattern structure of how to build what you want done, from this example work in progress below)
use the quest wiki, for using these things:
list add
list remove
ListContains
ListCombine or list combine (not sure on it's syntax, lol ~ too lazy to look it up)
ListExclude or list exclude (not sure on it's syntax, lol ~ too lazy to look it up)
Object.Attribute = NewStringList ()
Object.Attribute = NewObjectList ()
etc etc etc
<asl version="540">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="Testing Game Stuff">
<gameid>d67ec73f-f879-4911-9d88-c02ea527c534</gameid>
<version>1.0</version>
<firstpublished>2014</firstpublished>
<author>HegemonKhan</author>
<category>Simulation</category>
<pov type="object">player</pov>
<start type="script">
character_creation_function
</start>
</game>
<verb>
<property>socialize</property>
<pattern>socialize</pattern>
<defaultexpression>"You can't socialize with her."</defaultexpression>
</verb>
<function name="character_creation_function">
msg ("What is your name?")
get input {
game.pov.alias = result
sarah.your_name_string = "Hi Sarah, my name is " + game.pov.alias + "."
list add (sarah.name_topic_stringlist, sarah.your_name_string)
}
</function>
<object name="room">
<inherit name="editor_room" />
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
<attr name="social_score_integer" type="int">0</attr>
<attr name="statusattributes" type="simplestringdictionary">social_score_integer = Social Score: !</attr>
</object>
<object name="sarah">
<inherit name="editor_object" />
<attr name="name_topic_stringlist" type="simplestringlist">I have no name;you blush;you walk away;you stay silent</attr>
<attr name="socialize" type="script">
sarah.your_choosen_responses_stringlist = NewStringList ()
show menu ("Hi, my name is Sarah, what is your name?", sarah.name_topic_stringlist, false) {
list add (sarah.your_choosen_responses_stringlist, result)
if (result = sarah.your_name_string) {
game.pov.social_score_integer = game.pov.social_score_integer + 2
} else if (result = "you blush") {
game.pov.social_score_integer = game.pov.social_score_integer + 1
} else if (result = "I have no name" or result = "you stay silent") {
game.pov.social_score_integer = game.pov.social_score_integer - 1
} else if (result = "you walk away") {
game.pov.social_score_integer = game.pov.social_score_integer - 2
}
on ready {
if (ListContains (sarah.your_choosen_responses_stringlist, sarah.your_name_string) = true) {
// show menu ("Nice to meet you,
}
}
</attr>
<attr name="displayverbs" type="listextend">Socialize</attr>
</object>
</object>
</asl>