room_previous

This will return the index of the room before the given room id.

Syntax:

room_previous(numb);


Argument Description
numb The index of the base room to check from.


Returns: Real


Description

With this function you can retrieve the index of the room before the room input into the function. For example you can use the read only variable room to get the index of the current room and then use this function to find the room that comes before it in the resource tree. If there is no room before the one you input then -1 is returned.


Example:

if room_previous(room) != -1
   {
   room_goto_previous();
   }

The above code will check to see if the previous room exists and if so, it will go to it.


Back: Rooms
Next: room
© Copyright YoYo Games Ltd. 2018 All Rights Reserved