fogmike 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.
<command>
<pattern>scream for help; shout for help; shout help</pattern>
<script>
msg ("You shout for help, but nobody hears you.")
</script>
</command>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.
jaynabonne 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.
HegemonKhan 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