BioWare Atari
Information de BioWare Jeux BioWare Assistance Forums Visit the BioWare Store
Neverwinter Nights Home
Neverwinter Nights Home

Using Area Events

Intended Audience: For Builders
By David Gaider

[Printer Friendly / Syntax Highlight]

Keep in mind that when you create scripts for the area events (or, indeed, for the module events) that the default 'performer' of any action-related commands is the area, itself.

If you refer to OBJECT_SELF, you are referring to the area object. If you use an action-related command such as ActionMoveToObject without using AssignCommand to firs send that command to a creature object, you are telling the area to move (which it, of course, cannot). Simply keep this in mind as you code, so you can differentiate between telling the area what to do and telling things within the area what to do.

Area Events Listing

Event: OnEnter, triggered by: something (not necessarily a player character) has entered the area, what triggered it? Use GetEnteringObject() to return the object that has entered the area.

An example: Let's say you wanted to set an object variable called "PC_Entered" that was on the area whenever a player character entered the area (with the object being equal to the PC)... and then send a UserDefined event to a particular creature in the area with the unique tag "HUNTER" (I could then have an OnUserDefined event for that creature to come looking for the PC). You would place the following script in the OnEnter event for that area -

NWScript:

Event: OnExit, triggered by: someone has left the current area, what triggered it? Use GetExitingObject().

An example: Let's take the same script above and set the "PC_Entered" area-set variable to an invalid object if the PC leaves. Let's also check if the exiting object is the monster from above (chasing the PC, no doubt)... and if it is, tell him to return to his cave (where there is a waypoint laid down with the tag "HUNTER_CAVE") -

NWScript:

Event: OnHeartbeat, triggered by: Nothing is required to trigger the heartbeat... any script that is placed here will be automatically triggered once every 6 seconds. As with the module events, be careful of placing scripts in here that would run constantly.

Event: OnUserDefined, triggered by: This can only be triggered by someone using the SendSignal command to specifically send a UserDefined event to the area object (usually via the GetArea command or GetObjectByTag using the area's tag).

 

 

BioWare Store
Neverwinter Nights 2 Forums
Cacher/Afficher

English
Deutsch
Français
Español
Italiano

Cacher/Afficher

Voir les dernières captures d'écran 

Voir les dernières captures d'écran
Cacher/Afficher

Multiplayer Games at Neverwinter Connections

Today
Schedule a Game...



Il est actuellement: (régler heure)
dim, 22 novembre 2009 01:23

Cacher/Afficher

Download Modules

Top NWN: HotU Modules:
1. Good vs Evil III
2. More...

Top NWN: SoU Modules:
1. Good vs Evil III
2. More...

Top CEP Modules:
1. The Lord of Terror The Diablo Campa...
2. More...

Top Modules - NWVault:
1. Hall of Fame
2. More...

Total Modules: 4423

Cacher/Afficher

5,049,135 utilisateurs sur le site de BioWare:
  52 connectés
  3 invisibles
  229 invités

1372 Playing Online
  100% NWN
  100% NWN: SoU
  100% NWN: HotU

447 Registered Guilds

8,768,500 messages dans les forums

Sujets les plus récents dans les forums:
1. Freezing at Specific character's... (Baldur's Gate II: SoA and ToB Technical Support)

2. Won't let me create new topic (Web Site Help)

3. BUILDERS - Showcase YOUR Talent! (NWN 1: Guilds and Registry - Ye Olde Tavern)

4. Weapons Of choice? (Jade Empire Xbox General Discussion (Spoilers Will Be Moved))

5. setting time in a script. did I... (NWN 1: Scripting)