How do I use the command {rndalt:object}?
Brian5757
24 Feb 2020, 12:56I like to understand how to use the command {rndalt:object}
Can you please give me an example in using this command
Pertex
24 Feb 2020, 15:04If you have an objekt named test with a list of alternativ names (tab object, "Other names")
{rndalt:test} will display a randam name from this list
hegemonkhan
24 Feb 2020, 20:28just to expand an explanation of Pertex' post:
every Object has a built-in 'alt' (alternative names) Stringlist Attribute, for holding multiple 'alias'-es ("names") for that Object:
https://docs.textadventures.co.uk/quest/attributes/alt.html
(hopefully you can find the 'alt' Stringlist Attribute in the GUI/Editor for Objects: one of an Object's Tabs, likely has the options, text-box or whatever, for inputting all the alternative names that you want for that Object, if it's a textbox, then usually the semicolon is used to separate values, example: behind;bottom;rear;etc)
(forgive the example, but couldn't think of anything else, less worse lol, with lots of alternative names for it, lol)
<object name="gluteus_maximus">
<attr name="alias" type="string">butt</attr>
<alt type="stringlist">
<value>buttocks</value>
<value>behind</value>
<value>bottom</value>
<value>tush</value>
<value>fanny</value>
<value>derriere</value>
<value>rear</value>
<value>rear end</value>
<value>backside</value>
<value>posterior</value>
<value>rump</value>
</alt>
</object>
so then when you use the text processor command of '{rndalt:NAME_OF_OBJECT}', it'll randomly pick one of those values in that Object's 'alt' Stringlist Attribute:
msg ("{rndalt:gluteus_maximum} is another name for your " + gluteus_maximus.name + " (" + gluteus_maximus.alias + ")")
example outputs:
bottom is another name for your gluteus_maximus (butt)
or
behind is another name for your gluteus_maximus (butt)
or
etc etc etc
Brian5757
24 Feb 2020, 22:17That's a good example thanks hegemonkhan. I like your humour