t-programs
(Please read all the other parts of the tutorial first, if you haven't
already.)
If you want to evaluate information not available at the time you set
up an object, you can use programs to do so. Programs are much like
substitutions, only more flexible. For instance, if a player takes up
an object, you might want to know his/her/its gender. The @switch
function is ideal for that:
@desc cute baby dress=@switch("%s", "he", "The cute baby dress is light
blue", "she", "The cute baby dress is pink", "The cute baby dress is an
icky green with orange stripes.")
As you see, the @switch funtion takes an argument -- in this case the
"%s" after the bracket -- and an alternating list of possibilities and
their results. The last string is the default, which results if none of
the possibilities matches the argument.
[Type "help t-programs2" for more information.]