slight improvement that Pertex forgot to do (or he was just keeping it more simple for you), so you don't have to manage changing list quantity of items:
(learning and understanding List/Dictionary Attributes is quite advanced for those who don't know how to code already, this isn't easy stuff to grasp or to explain about it too)
roomarray= split("room1;room2;room3", ";")
MoveObject(yourobject, GetObject(StringListItem(roomarray, GetRandomInt (0, ListCount (roomarray) - 1))))
---------
quest has 4 built-in Randomization Functions:
http://docs.textadventures.co.uk/quest/ ... omint.htmlhttp://docs.textadventures.co.uk/quest/ ... ouble.htmlhttp://docs.textadventures.co.uk/quest/ ... eroll.htmlhttp://docs.textadventures.co.uk/quest/ ... hance.html^^^^^^^^^^^
http://docs.textadventures.co.uk/quest/ ... tions.html (the above 4 links are found here)
------------
1. GetRandomInt (<min_value>, <max_value>)
2. GetRandomDouble () // it automatically chooses between 0.0 and 1.0
3. DiceRoll (<number of die>d<number of sides on die>)
4. RandomChance (<0-100>) // this is the percent chance of something being (returns) true
---------
List and Dictionary Attribute Usage:
http://docs.textadventures.co.uk/quest/ ... lists.htmlhttp://docs.textadventures.co.uk/quest/ ... aries.html--------
a good combination is to use 'GetRandomInt()' to select an item from a group (Using Lists/Dictionaries), and then use the 'RandomChance()' for the percent chance of actually doing something/whatever or getting_it/whatever with that item or not.
for conceptual example:
treasure chest / drop :
-> 1. candy
-> 2. chocolate
-> 3. sugar
-> 4. honey
'GetRandomInt()' will select one of these items // ie chocolate is chosen
and then 'RandomChance()' will determine whether you actually get that item (if its actually given to you/put in your inventory), or not (failure) // ie will you now actually receive the selected chocolate item or not