SetJohnnyOnLimbGoneEventHandler

From GECK
(Redirected from SetOnLimbGoneEventHandler)
Jump to: navigation, search


A function added by the JohnnyGuitar NVSE Plugin.

Description

Sets/removes the specified UDF Script as a handler that will be invoked when a specified Actor (or any Actor) loses a specified Limb (or any limb). Formlists are also accepted as filters. Limb IDs are as follows:
Torso 	       0
Head 1 	       1
Head 2 	       2
Left Arm 1     3
Left Arm 2     4
Right Arm 1    5
Right Arm 2    6
Left Leg 1     7
Left Leg 2     8
Left Leg 3     9
Right Leg 1    10
Right Leg 2    11
Right Leg 3    12
Brain          13
Hand or Weapon 14

When invoked, the script receives two arguments: Actor and a Limb ID.

Syntax

[help]
SetJohnnyOnLimbGoneEventHandler setORremove:1/0 handlerScript:ref flag:int actor:filter limbID:filter 

Or:

SetOnLimbGoneEventHandler setORremove:1/0 handlerScript:ref flag:int actor:filter limbID:filter

Example

SetJohnnyOnLimbGoneEventHandler 1 OnLimbGoneUDF 0 rActor 1

Sets the OnLimbGoneUDF script as a handler to be invoked when rActor's head gets detached from his body.

SetJohnnyOnLimbGoneEventHandler 0 OnLimbGoneUDF 0 rActor 1

Removes the OnLimbGoneUDF script as a handler of the above.

Handler Script

A skeleton handler script for this event:

scn OnLimbGoneUDF

ref rActor
int limbID

begin Function {rActor, limbID} 

...

end

Notes

  • Event must be registered in GameMode block (not MenuMode 4) as it is flushed every game load. This also means GetGameRestarted is NOT a viable option to set this event for the session. Instead consider using GetGameLoaded to (re)set the event handler.
  • Flag argument is reserved for future use and should always be 0.