ExploreAreaForPlayer

From NWN Lexicon
Revision as of 01:31, 2 February 2020 by Shadguy (talk | contribs) (added new category)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search



ExploreAreaForPlayer(object, object, int)

Reveals the entire map of an area to a player.

void ExploreAreaForPlayer(
    object oArea,
    object oPlayer,
    int bExplored = TRUE
);

Parameters

oArea

The map of an area to reveal.

oPlayer

The player to reveal the area map to.

bExplored

TRUE (explored) or FALSE (hidden). Whether the map should be completely explored or hidden. If not set, defaults to TRUE.


Description

Reveals (or hides) the entire map of oArea to oPlayer.



Remarks

oPlayer doesn't have to be in oArea to reveal it. Also note that it happens instantly, and so it suddently happening in a fog-bound cave when they step on a trigger without warning is probably a bit confusing.

The most useful aspect of this is exploring a well known area, such as a city, or exploring an area in the OnEnter of an area, if they have the map for the area (as done in the Original Bioware Campaign).

Note there is no way to uncover specific parts of the map (apart from jumping the players to that location to reveal it naturally).


Version

1.67

Example

// if this code were placed in the OnEnter event
// of an area, the entire map would be revealed to the player
// even if they have never been there before.
 
void main()
{
   object oPlayer = GetEnteringObject();
   if (GetIsObjectValid(oPlayer) && GetIsPC(oPlayer))
   {
      // As this is firing in the Area's own events, we explore this
      // area's area. GetArea() might not always work, but this is fine anyway
      object oArea = OBJECT_SELF; 
      ExploreAreaForPlayer(oArea, oPlayer);
   }
}

See Also



 author: Brett Lathrope, editor: Jasperre, Mistress, additional contributor(s): Charles Feduke, Jasperre