-
Notifications
You must be signed in to change notification settings - Fork 5
Triggers
Every time a new projectile appears in the game, it is checked against the triggers conditions. If the trigger passed the test, it modifies the projectile parameters, changes the projectile type, call function according to the data in TriggerFunctions
.
If several triggers pass the test, then their functions are all applys, but the result depends on the feature used. For example, if two triggers use the Homing feature, then the result of the latter is applies. If both triggers use the Multicast feature, then both MultiCasts happens.
The Triggers
section is an array of objects with the following fields:
- The
event
field shows when the trigger is triggered. Can be one of the following:-
ProjAppeared
: Appearance of a projectile (from cast or from ranged weapon) -
Swing
: Melee weapon swing. -
HitMelee
: Actor hits someone. -
HitByMelee
: Actor was hit. -
HitProjectile
: Actor hits someone with projectile. -
HitByProjectile
: Actor was hit with projectile. -
Cast
: Actor casts a spell. -
EffectStart
: Actor get applied an effect. Called frequently for concentration spells. -
EffectEnd
: Actor get dispelled an effect. Called frequently for concentration spells. -
ProjDestroyed
: A projectile is destroyed. Usually after hit/end of lifetime/end of range. -
ProjImpact
: A projectile hits someone or something.
The event emitted even when hitting REFRs, not actors, so be careful in conditions/functions.
To get only actor hits, useHitProjectile
/HitByProjectile
.
-
- The
conditions
field is an object of conditions that the trigger must satisfy. - The
TriggerFunctions
field is an object that describes functions that are called if checks passed.
Every key-value pair represents a condition. Key is a name of the condition, value -- the value that is needed to the condition. The condition functions can be one of the following:
-
Hand
: comparevalue
with the casting source. One of the following:Both
,Left
,Right
. -
ProjBaseIsFormID
: comparevalue
with the projectile's base FormID. -
EffectHasKwd
: check if the projectile's spell has an effect with keyword with FormID =value
. -
EffectIsFormID
: comparevalue
with the effect FormID. -
SpellHasKwd
: check if the projectile's spell has keyword with FormID =value
. -
SpellIsFormID
: comparevalue
with the spell FormID. -
CasterIsFormID
: comparevalue
with the projectile caster FormID. -
CasterBaseIsFormID
: comparevalue
with the projectile caster's base FormID. -
CasterHasKwd
: check if the caster has keyword (either on base or in active effects) with FormID =value
. -
WeaponBaseIsFormID
: comparevalue
with the bow's FormID. -
WeaponHasKwd
: check if the bow has keyword with FormID =value
.
In the TriggerFunctions
section, specify the functions that are called in this trigger. This is a json-object. In the disableOrigin
field, specify whether to cancel the launch of the projectile (for ProjAppeared
condition) (default: false). The functions
field is an array of objects, each of which describes a trigger function.
In the type
field, specify the type of function to be called. It can be one of:
-
SetRotationHoming
: Aim the projectile at the target.
In theid
field, specify HomingData instance key. -
SetRotationToSight
: Aim the projectile at the caster's point of view. -
SetHoming
: Make the projectile homing.
In theid
field, specify HomingData instance key. -
SetEmitter
: Make a projectile Emitter.
In theid
field, specify EmitterData instance key. -
SetFollower
: Make a projectile Follower.
In theid
field, specify FollowerData instance key. -
DisableHoming
: disable (Homing)[Homing] feature on the projectile. -
DisableFollower
: disable (Followers)[Followers] feature on the projectile.
In therestore_speed
field, specify whether to set the default speed or not. -
DisableEmitter
: disable (Emitters)[Emitters] feature on the projectile. -
ApplyMultiCast
: Perform MultiCast.
In theid
field, specify MulticastData instance key. -
ChangeSpeed
: Change the projectile speed.
The function allows you to change the speed value. In thetype
field, specify the type of change (Set
,Add
,Mul
), in thevalue
field, specify the value to change. -
ChangeRange
: Change the Range of the projectile. Same as forChangeSpeed
. -
Placeatme
: Spawns an object at the event position. In theform
field set the formid of the object to spawn. -
SendAnimEvent
: Sends animation event. In theevent
field set the name (tag) of the event. -
Explode
: Explodes at the event position. In theexplosion
field set the formid of the explosion. Spell/effect of explosion is default, not the one from the projectile. -
SetColLayer
: Change collision layer. In thelayer
field set one ofActor
,Spell
,None
. First collides only with actors, second is default projectile collision, third do not collides.
"Triggers": [
{
"event": "ProjAppeared",
"conditions": {
"CasterIsFormID": "0x14"
},
"TriggerFunctions": {
"functions": [
{
"type": "SetHoming",
"id": "key_H_1"
}
]
}
}
]