Different descriptions each time you read it

I'd like to create a bookcase that people can vaguely peruse, grabbing a different snippet each time. This is because I have a turnscript going that prevents people from spending too much time in a particular area, so I want to make each turn count. I'm just trying to figure out what I'd use for it. Any ideas?


In the bookcase description (or in your "read" verb/command), use the text processor:

{random:descriptionA:descriptionB:descriptionC}

Then you'll get a 1 in 3 chance for one of those descriptions each time you look at it.

Or have an integer attribute "bookcase.perusal" advance by 1 each time the bookcase is looked at (bookcase.perusal = bookcase.perusal + 1), and an if/then script giving a different description depending on the attribute's current value.


Ahh, there we go! That is super simple. Cool!


Oops spoke too soon. Actually just putting that in as a "read" verb threw up an error:

Failed to load game.
The following errors occurred:
Error: Error adding script attribute 'read' to element 'bookcases': Function not found: 'random:descriptionA:descriptionB:descriptionC'

Looks like I need to set up a random function first. How would I do that?


K.V.

In code view, it should look like this:

msg("{random:descriptionA:descriptionB:descriptionC}")

http://docs.textadventures.co.uk/quest/text_processor.html


There we go! Thanks all!


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

Support

Forums