Passive Tutorial

From Gothongs Wiki
Revision as of 14:28, 29 July 2023 by Panda (talk | contribs) (Created page with "The passives system is different from the Effects because of legacy memory reasons. Passives may only be applied to players and cannot affect NPCs. Technically passives are converted to Effects in the HUD but they use a different syntax and set of effect IDs for legacy reasons. See got Passives.lsl for a list of passive effect IDs (FXCUpd$*). Passives can be set by using the Passives$set method. Passives are stored in a 2-stride array of [(int)effectID, (var)effectData...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

The passives system is different from the Effects because of legacy memory reasons. Passives may only be applied to players and cannot affect NPCs. Technically passives are converted to Effects in the HUD but they use a different syntax and set of effect IDs for legacy reasons.

See got Passives.lsl for a list of passive effect IDs (FXCUpd$*).

Passives can be set by using the Passives$set method. Passives are stored in a 2-stride array of [(int)effectID, (var)effectData ... ]. Passives remain in the HUD until the HUD is reset by relogging, changing sim, or resetting. Or until unset by the Passives$rem method.

Example of adding 10% additional dodge chance with a passive:

Passives$set(llGetOwner(), "myDodgePassive", [FXCUpd$DODGE, 0.1], 0);

Procs

Just like active effects, passives can have procs: Apply a wrapper when an event is received.

Proc data is stored in array with the following syntax:

[
  // Triggers
  [
    [
      (int)wrapper_target,
      (str)event_script,
      (int)event,
      (arr)event_args,
      (float)max_range
    ],
    ...
  ],
  (int)max_targets,
  (float)proc_chance,
  (float)cooldown,
  (int)flags,
  (arr)wrapper
]