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
    * Character functions and properties

PlaceOnWalkableArea

(Formerly known as MoveToWalkableArea, which is now obsolete)

Character.PlaceOnWalkableArea()
Places the character in the nearest walkable area to its current location. If the character is already on a walkable area, nothing happens.

This is useful for example in the Player Enters Room event of a room, to make sure the character can move if a ChangeRoom with co-ordinates has been issued to get there. You could also use this in on_event for eEventEnterRoomBeforeFadein to use whenever a player enters a room.

Example:

cEgo.x = Random(320);
cEgo.y = Random(200);
cEgo.PlaceOnWalkableArea();
will move character EGO to a random position but make sure that he is on a walkable area.

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