GetAreaFromLocation
GetAreaFromLocation(location)
Returns the area that a particular location is in.
Parameters
lLocation
The location (Default: None)
Description
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.
Remarks
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).
Version
1.22
Example
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);
See Also
functions: |
author: Steve Moseley, editor: Jasperre