Different descriptions each time you read it
Laraqua
18 Jan 2018, 13:19I'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?

Dcoder
18 Jan 2018, 13:36In 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.
Laraqua
19 Jan 2018, 01:46Ahh, there we go! That is super simple. Cool!
Laraqua
19 Jan 2018, 01:56Oops 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.
19 Jan 2018, 02:07In code view, it should look like this:
msg("{random:descriptionA:descriptionB:descriptionC}")
http://docs.textadventures.co.uk/quest/text_processor.html
Laraqua
19 Jan 2018, 02:50There we go! Thanks all!