Display Stringsg in messages.

MyronGanes
Noob question.

How do I create a string variable and then have this variable displayed in a message? For example allowing the reader to choose a name for the characters in the story. Thanks

HegemonKhan
if you want pre-built string variables set up in your game there's the 'template' Attributes~Elements, or you can just create your own custom string variable too, and then you can use these within a 'msg [EXPRESSION] ~ print a message [EXPRESSION]' Script Attribute.

HOWEVER, writing in the correct syntax for messages (text) that also uses the variables (dynamic messages), takes quite some practice to do it right. If you have trouble, ask me, and I'll give you my secret to doing it: breaking it into 'chunks', I'll have to explain the 'chunks' to you.

1. http://docs.textadventures.co.uk/quest/ ... plate.html
2. http://docs.textadventures.co.uk/quest/ ... plate.html
3. http://docs.textadventures.co.uk/quest/ ... lates.html

as for getting input during game play, you use the 'get input' script:

4. http://docs.textadventures.co.uk/quest/ ... ation.html

msg ("What is your name?")
get input {
// quest engine automatically sets the built-in variable: result = your_typed_in_input_during_game_play
player.alias = result
msg ("What is your age?")
get input {
player.age_integer = ToInt (result)
msg ("What is your favorite sport?")
get input {
player.sport_string = result
}
}
}

This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums