BioWare Atari
Informazioni BioWare Giochi BioWare Supporto Forum 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).

 

 

Mass Effect Galaxy
Neverwinter Nights 2 Forums
Mostra/nascondi

English
Deutsch
Français
Español
Italiano

Mostra/nascondi

Vedi le immagini più recenti 

Vedi le immagini più recenti
Mostra/nascondi

Multiplayer Games at Neverwinter Connections

Today
Schedule a Game...



L'ora attuale è: (imposta ora)
sab, 21 novembre 2009 10:32

Mostra/nascondi

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

Mostra/nascondi

5,047,485 utenti BioWare:
  90 collegati
  4 nascosti
  202 ospiti

1552 Playing Online
  100% NWN
  98% NWN: SoU
  99% NWN: HotU

447 Registered Guilds

8,768,306 messaggi nei forum

Nuove discussioni:
1. Inferno armor available at Amaz... (Mass Effect 2 General Discussion (No Spoilers Allowed))

2. Will ME2 feature "ME1" or "DAO" ... (Mass Effect 2 General Discussion (No Spoilers Allowed))

3. conversation node spawning an it... (NWN2: Builders - NWN2 Scripting)

4. Stupid MAKO!! (Mass Effect 1 General Discussion (No spoilers allowed))

5. An Idea Realized and Marquee Abi... (Mass Effect 2 General Discussion (No Spoilers Allowed))