![]() |
![]() |
|||||||||||||||||||||||
|
|
||||||||||||||||||||||||
|
Using Area Events Intended Audience: [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 - 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") - 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).
|
|||||||||||||||||||||||
|
|
||
|
Multiplayer Games at Neverwinter Connections
|
||
|
Buy Premium Modules
|
||
|
4,052,294 BioWare Users:
|
||