Custom verbs help for a noob
Mareus
30 May 2014, 13:24Greetings everyone!
I have just discovered this amazing tool for creating text adventures and am really surprised how powerful it is. However I do have a question for which I could not find any tutorial.
I made a room with my character crawling to safety. There is a huge killer coming after him and basically I want to make a verb for roleplaying purposes. I want to be able to write: "scream for help, or shout for help or shout help, etc.." and then I want a text to appear which describes how you desperately shout for help. I tried creating a new verb, but it has to be connected to the object which then shows on the places and objects menu. So that is not an option, unless I can somehow make the help object invisible. So, I wonder if there is a simple way to do this so that my menu doesnt get crowded with things that are just verbs?
I also wonder if there is a simple way to teleport a player from one room to another automatically once you press enter. I dont want to travel from intro to north. I want the player to teleport automatically by pressing enter or if one can make a continue command or something like that.
Thanks in advance to anyone who answers.
I have just discovered this amazing tool for creating text adventures and am really surprised how powerful it is. However I do have a question for which I could not find any tutorial.
I made a room with my character crawling to safety. There is a huge killer coming after him and basically I want to make a verb for roleplaying purposes. I want to be able to write: "scream for help, or shout for help or shout help, etc.." and then I want a text to appear which describes how you desperately shout for help. I tried creating a new verb, but it has to be connected to the object which then shows on the places and objects menu. So that is not an option, unless I can somehow make the help object invisible. So, I wonder if there is a simple way to do this so that my menu doesnt get crowded with things that are just verbs?
I also wonder if there is a simple way to teleport a player from one room to another automatically once you press enter. I dont want to travel from intro to north. I want the player to teleport automatically by pressing enter or if one can make a continue command or something like that.
Thanks in advance to anyone who answers.
fogmike
30 May 2014, 15:12Hi there! Do you want your character to be able to do it all the time, or only when in that room? If it's all the time, then you can make the verb be attached to the player object itself.
The other things you might try are to attach the verb to some (fixed) object already there, or to create a new helper object that you then mark as scenery - I think that should prevent it from showing up in the places and objects pane.
Ideally though, attaching the verb to the player is best. After all, even if you only want it in that room, that way you could have an if statement that checks where you are - if you're in a room filled with danger, then have him scream, otherwise have the narrator say something like 'There's no need for that right now'. Would be better than having the game understand screaming in that room but respond with 'I don't understand that' anywhere else.
The other things you might try are to attach the verb to some (fixed) object already there, or to create a new helper object that you then mark as scenery - I think that should prevent it from showing up in the places and objects pane.
Ideally though, attaching the verb to the player is best. After all, even if you only want it in that room, that way you could have an if statement that checks where you are - if you're in a room filled with danger, then have him scream, otherwise have the narrator say something like 'There's no need for that right now'. Would be better than having the game understand screaming in that room but respond with 'I don't understand that' anywhere else.
Mareus
30 May 2014, 21:45fogmike wrote:Hi there! Do you want your character to be able to do it all the time, or only when in that room? If it's all the time, then you can make the verb be attached to the player object itself.
The other things you might try are to attach the verb to some (fixed) object already there, or to create a new helper object that you then mark as scenery - I think that should prevent it from showing up in the places and objects pane.
Ideally though, attaching the verb to the player is best. After all, even if you only want it in that room, that way you could have an if statement that checks where you are - if you're in a room filled with danger, then have him scream, otherwise have the narrator say something like 'There's no need for that right now'. Would be better than having the game understand screaming in that room but respond with 'I don't understand that' anywhere else.
Thanks for trying to help, but I need detailed instructions. I thought about what you said even before posting the thread. I have the general idea what I want to do. It's the how that I can't seem to grasp. I dont understand how do new custom verbs work. I create a new verb with the name: shout for help; yell for help, etc..., I even wrote the response I want to get like: You shout for help, but nobody responds. But when I try to use it in the game, I get a response: I dont understand your command.
The only way I can make it work is to make the object visible in the inventory. If I make it invisible, it does not work. i just get the response: "I dont understand your command." The thing is, I dont want to have my inventory full of roleplaying verbs, so they have to be invisible. How do I do this? Detailed instruction please.

jaynabonne
31 May 2014, 00:44What you're looking for is a command, not a verb. Verbs act on objects and have a specific form. They are really only meant for things like "eat apple" or "kill orc", where an object is provided (e.g. "apple" or "orc") that the verb can be found on.
With a command, you can just have a script run for something like what you're asking. Here is a sample (as you'd see it in Code View):
To create that in the editor, just click on Commands and then "Add Command". Set the command pattern to "scream for help; shout for help; shout help", and then do what you like in the script. If you want the command to only be available in a specific room, then either create the command in the room or drag/drop it on the desired room after you create it.
With a command, you can just have a script run for something like what you're asking. Here is a sample (as you'd see it in Code View):
<command>
<pattern>scream for help; shout for help; shout help</pattern>
<script>
msg ("You shout for help, but nobody hears you.")
</script>
</command>
To create that in the editor, just click on Commands and then "Add Command". Set the command pattern to "scream for help; shout for help; shout help", and then do what you like in the script. If you want the command to only be available in a specific room, then either create the command in the room or drag/drop it on the desired room after you create it.
HegemonKhan
31 May 2014, 04:22the two most powerful~useful scripts that enable you to almost everything within quest, aka within your game, hehe:
the ' if [EXPRESSION] ' script
~and~
the ' set a variable or an attribute ' script
in code they look like this:
if (Variable = Value_or_Expression) {
-> // script(s)
}
if (result = "yes") {
-> // script(s)
}
if (you_go_first = true) {
-> // script(s)
}
if (Object.Attribute = Value_or_Expression) {
-> // script(s)
}
if (orc.dead = true) {
-> player.cash = player.cash + orc.cash
-> msg ("You loot the dead orc of its cash")
}
if (player.speed_integer - player.encumbrance_integer > orc.speed_integer - orc.encumbrance_integer) {
-> you_go_first = true
}
Object.Attribute = Value_or_Expression
orc.dead_boolean = true
player.strength_integer = 100
player.hair_color_string = "black"
player.favorite_colors_stringlist = split ("blue;green;yellow", ";")
player.y = x + 5
Variable = Value_or_Expression
result = "yes"
handled = false
you_go_first = false
y = x + 5
value = 10
------------
another alternative (though this may not be what you want for your game) is to have just one verb, but have it give you choices, which will give you a different response~action~script depending on what you choose (your choices can either: be given to you, as a popup menu box or as text in the big huge text rectangle left side~pane, or you can type in your choices ~ though this will require a bit of more advanced coding for it to work flawlessly):
"whatever" Verb of "whatever" Object, two examples:
show menu ("What is your response?", split ("scream for help;crawl faster;fart... sorry I couldn't resist... I feel sorry for the killer crawling after you in a tunnel lol;etc", ";"), false) {
-> if (result = "scream for help") {
->-> // whatever script(s)_1
-> } else if (result = "crawl faster") {
->-> // whatever script(s)_2
-> } else if ... etc {
->-> // etc
-> }
}
~OR~
(simplified, it'll need much more coding though for it to be flawless)
msg ("What is your response")
get input {
-> // you type in your responce during game play
-> if (result = "scream for help") {
->-> // whatever script(s)_1
-> } else if (result = "crawl faster") {
->-> // whatever script(s)_2
-> } else if ... etc {
->-> // etc
-> }
}
---------
there are ways to not have a verb, and then after you do some script, now that verb appears as a button (, and then you can get rid of it again when you're done with it), though this is a bit more complex in coding.
-------------------------
a very simple method:
within any script (such as within a Verb ~ simpliest way), at the end of it:
(in the GUI~Editor's 'add a script', I think the 'wait' script is called 'wait for key press' )
wait {
-> player.parent = name_of_your_new_destination_room_object
}
~OR~ a simple Command:
<command name="goto_command">
-> <pattern>goto #object#</pattern>
-> <script>
->-> if (object = null) {
->->-> foreach (object_x, AllObjects () ) {
->->->-> if (object_x.alias = object)
->->->->-> object = object_x
->-> }
->-> if (object = null) {
->->-> msg ("Wrong input, try again.")
->-> } else {
->->-> msg ("You cast the teleportation spell and find yourself in the " + object.alias + ".")
->->-> player.parent = object
->-> }
-> </script>
</command
this way you can type in:
goto dungeon
and it moves you to the 'dungeon' room object
the ' if [EXPRESSION] ' script
~and~
the ' set a variable or an attribute ' script
in code they look like this:
if (Variable = Value_or_Expression) {
-> // script(s)
}
if (result = "yes") {
-> // script(s)
}
if (you_go_first = true) {
-> // script(s)
}
if (Object.Attribute = Value_or_Expression) {
-> // script(s)
}
if (orc.dead = true) {
-> player.cash = player.cash + orc.cash
-> msg ("You loot the dead orc of its cash")
}
if (player.speed_integer - player.encumbrance_integer > orc.speed_integer - orc.encumbrance_integer) {
-> you_go_first = true
}
Object.Attribute = Value_or_Expression
orc.dead_boolean = true
player.strength_integer = 100
player.hair_color_string = "black"
player.favorite_colors_stringlist = split ("blue;green;yellow", ";")
player.y = x + 5
Variable = Value_or_Expression
result = "yes"
handled = false
you_go_first = false
y = x + 5
value = 10
------------
another alternative (though this may not be what you want for your game) is to have just one verb, but have it give you choices, which will give you a different response~action~script depending on what you choose (your choices can either: be given to you, as a popup menu box or as text in the big huge text rectangle left side~pane, or you can type in your choices ~ though this will require a bit of more advanced coding for it to work flawlessly):
"whatever" Verb of "whatever" Object, two examples:
show menu ("What is your response?", split ("scream for help;crawl faster;fart... sorry I couldn't resist... I feel sorry for the killer crawling after you in a tunnel lol;etc", ";"), false) {
-> if (result = "scream for help") {
->-> // whatever script(s)_1
-> } else if (result = "crawl faster") {
->-> // whatever script(s)_2
-> } else if ... etc {
->-> // etc
-> }
}
~OR~
(simplified, it'll need much more coding though for it to be flawless)
msg ("What is your response")
get input {
-> // you type in your responce during game play
-> if (result = "scream for help") {
->-> // whatever script(s)_1
-> } else if (result = "crawl faster") {
->-> // whatever script(s)_2
-> } else if ... etc {
->-> // etc
-> }
}
---------
there are ways to not have a verb, and then after you do some script, now that verb appears as a button (, and then you can get rid of it again when you're done with it), though this is a bit more complex in coding.
-------------------------
marius wrote:I also wonder if there is a simple way to teleport a player from one room to another automatically once you press enter. I dont want to travel from intro to north. I want the player to teleport automatically by pressing enter or if one can make a continue command or something like that.
a very simple method:
within any script (such as within a Verb ~ simpliest way), at the end of it:
(in the GUI~Editor's 'add a script', I think the 'wait' script is called 'wait for key press' )
wait {
-> player.parent = name_of_your_new_destination_room_object
}
~OR~ a simple Command:
<command name="goto_command">
-> <pattern>goto #object#</pattern>
-> <script>
->-> if (object = null) {
->->-> foreach (object_x, AllObjects () ) {
->->->-> if (object_x.alias = object)
->->->->-> object = object_x
->-> }
->-> if (object = null) {
->->-> msg ("Wrong input, try again.")
->-> } else {
->->-> msg ("You cast the teleportation spell and find yourself in the " + object.alias + ".")
->->-> player.parent = object
->-> }
-> </script>
</command
this way you can type in:
goto dungeon
and it moves you to the 'dungeon' room object
Mareus
31 May 2014, 09:39jaynabonne wrote:What you're looking for is a command, not a verb. Verbs act on objects and have a specific form. They are really only meant for things like "eat apple" or "kill orc", where an object is provided (e.g. "apple" or "orc") that the verb can be found on.
With a command, you can just have a script run for something like what you're asking. Here is a sample (as you'd see it in Code View):<command>
<pattern>scream for help; shout for help; shout help</pattern>
<script>
msg ("You shout for help, but nobody hears you.")
</script>
</command>
To create that in the editor, just click on Commands and then "Add Command". Set the command pattern to "scream for help; shout for help; shout help", and then do what you like in the script. If you want the command to only be available in a specific room, then either create the command in the room or drag/drop it on the desired room after you create it.
Thank you for a nice and elegant solution. I tried it out and it works like a charm.
Mareus
31 May 2014, 09:45HegemonKhan wrote:"marius"
I also wonder if there is a simple way to teleport a player from one room to another automatically once you press enter. I dont want to travel from intro to north. I want the player to teleport automatically by pressing enter or if one can make a continue command or something like that.
a very simple method:
within any script (such as within a Verb ~ simpliest way), at the end of it:
(in the GUI~Editor's 'add a script', I think the 'wait' script is called 'wait for key press' )
wait {
-> player.parent = name_of_your_new_destination_room_object
}
~OR~ a simple Command:
<command name="goto_command">
-> <pattern>goto #object#</pattern>
-> <script>
->-> if (object = null) {
->->-> foreach (object_x, AllObjects () ) {
->->->-> if (object_x.alias = object)
->->->->-> object = object_x
->-> }
->-> if (object = null) {
->->-> msg ("Wrong input, try again.")
->-> } else {
->->-> msg ("You cast the teleportation spell and find yourself in the " + object.alias + ".")
->->-> player.parent = object
->-> }
-> </script>
</command
this way you can type in:
goto dungeon
and it moves you to the 'dungeon' room object
Thanks, this actually sounds very useful for the more advanced things that I am trying. As for just moving the player automatically I found another solution by myself yesterday. There is a script called move object. The only reason why I missed it is because it said move object, instead of move player. I didnt realize that the object can also be set to be a player, so I just didnt pay any attention to it, until I found it by accident when I was actually trying to move an object in my game.
HegemonKhan
31 May 2014, 16:56oops, hehe. I was going to mention how the GUI~Editor 's 'MoveObject (name_of_object_you_are_moving, name_of_your_destination_object_usually_it_is_a_room_object)' Script is the exact same as an in-code Script of 'name_of_object_you_are_moving.parent = name_of_your_destination_object_usually_it_is_a_room_object', but I forgot to do so, lol.
-------------------
just some terms~concepts of quest's object structure
Objects:
-> Types of Objects:
-> Game Object (the 'game' Object)
-> Player Objects (such as the default 'player' Player Object)
-> Room Objects (such as the default 'room' Room Object)
-> Object (non-game, non-player, and non-room) Objects (such as an 'orc' or a 'table' Object Object)
Objects can hold~have~contain Attributes and~or other Objects
-------------------
just some terms~concepts of quest's object structure
Objects:
-> Types of Objects:
-> Game Object (the 'game' Object)
-> Player Objects (such as the default 'player' Player Object)
-> Room Objects (such as the default 'room' Room Object)
-> Object (non-game, non-player, and non-room) Objects (such as an 'orc' or a 'table' Object Object)
Objects can hold~have~contain Attributes and~or other Objects