spacer graphic
spacer graphic
Montage of games AGS Logo
spacer graphic

 

spacer graphic
Menu
spacer graphic Home
About
News
Features
Download AGS
spacer graphic Games 
Games main page
Award Winners
Picks of the month
Short games
Medium length games
Full length games
In Production
Hints & Tips
Community
Forums
AGSers World Map
Member websites
Chat
Resources
Tutorials
FAQ
Knowledge Base
Downloads
Links
AGS-related links
* AGS Manual
  * Scripting
    * Room functions

HasPlayerBeenInRoom

HasPlayerBeenInRoom(int room_number)
Checks whether the player has ever been in ROOM_NUMBER (ie. has the 'First Time Player Enters Room' event there ever been run). Returns 1 if they have, and 0 if they haven't.

You can use this function to determine whether the player has been to a particular location previously. If you reset the room with ResetRoom, then this command will return 0 until they enter the room again.

This command will always return 1 if you ask it about the current room; and it will always return 0 if you ask it about a non-state saving room (ie. rooms numbered > 300).

Example:

if (HasPlayerBeenInRoom(14)) {
  Display("The player has been to room 14 before.");
}
will display a message if the player has been to room 14.

See Also: ResetRoom


User comments and notes
There are currently no user comments on this page.
The user comment facility is currently disabled.