About Parameters

Parameters are whatever appears between "<" and ">" characters - after an msg command, give command, etc.

A parameter could be completely static - always returning the same string. Indeed, some parameters must always be static - the parameter for the start room, for example, might be something like "<house>". This parameter always gives Quest the text "house".

However, for flexibility, you can make parameters return different things when it makes sense to do so by making them include the contents of variables or the output of functions. You include the contents or output from a variable or function by surrounding the variable or function name with special characters: "#" denotes a string variable; "%" a numeric variable and "$" a function.

For example, a parameter for a msg script command, which prints a message, could contain the contents of a string variable "playername", which holds the player's name. You could use:

msg <Your name is #playername#>

If the string variable "playername" contained the name "Alex", this parameter would then return the text "Your name is Alex", which would then be printed on the screen by the msg command.

You can also include expressions within parameters by surrounding the expression with brace characters { }. For example:

msg <Including tax, the total is { %total% * 1.175 }>

 

< Back