Returns the area that a particular location is in.
The location (Default: None)
Get the area's object ID from lLocation.
The function GetArea would generally be used more often, as it's parameter is an object, rather than a location, but GetAreaFromLocation is useful when a location is being manipulated. For example, when a new location is needed based on the facing, and/or the position of an existing location.
If the location provided isn't valid, the function returns OBJECT_INVALID.
It is a good way to get if a stored GetLocalLocation() is invalid or valid - it is basically the only way to do it! If the area is valid for the local location, a creature can be successfully moved there without problems (where they appear is another matter).
// Get the location of the calling object location lMyLocation = GetLocation (OBJECT_SELF); // Get the area, position and facing object oArea = GetAreaFromLocation (lMyLocation); vector vPosition = GetPositionFromLocation (lMyLocation); float fFacing = GetFacingFromLocation (lMyLocation); // Build a new location, which faces in the opposite direction location lNewLocation = Location (oArea, vPosition, fFacing + 180.0);
author: Steve Moseley, editor: Jasperre