BioWare Atari
Información sobre BioWare Juegos de BioWare Soporte Foros 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
Mostrar/Ocultar

English
Deutsch
Français
Español
Italiano

Mostrar/Ocultar

Ver las últimas pantallas 

Ver las últimas pantallas
Mostrar/Ocultar

Multiplayer Games at Neverwinter Connections

Today
Schedule a Game...



La hora actual es: (insertar hora)
dom, 22 noviembre 2009 03:59

Mostrar/Ocultar

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

Mostrar/Ocultar

5,050,398 usuarios de BioWare:
  57 conectados
  3 ocultos
  203 invitados

1226 Playing Online
  100% NWN
  102% NWN: SoU
  102% NWN: HotU

447 Registered Guilds

8,768,635 mensajes en los foros

Temas más recientes de los foros:
1. Drowned Dead Test (NWN2: Players - Storm of Zehir (Spoilers Warning))

2. 2 newb problems: Lever puzzle, a... (NWN2: Builders - NWN2 Scripting)

3. Vorcha + Krogans o_0 (Mass Effect 2 General Discussion (No Spoilers Allowed))

4. Video games? (NWN 1: General Discussion (No Spoilers Allowed))

5. How to Change the Death Message (NWN 1: Toolset)