VFXLoop ​
Inherited by: VFXEnchant, VFXWeather
Loop VFX - Continuous effects like auras, channeling, persistent buffs/debuffs Supports start/loop/end animation sequence Now supports duration override with graceful stop sequence
Variables ​
LoopState | loop_state | LoopState.STARTING |
bool | manually_stopped | false |
bool | has_start_animation | false |
bool | has_loop_animation | false |
bool | has_end_animation | false |
Methods ​
void | activate_vfx( selection: VFXSelection = null ) |
void | stop_loop_vfx() |
void | attach_to_entity( entity: Variant, location: VFXSelection.VfxLocation, offset: Vector3 = Vector3.ZERO ) |
void | deactivate_vfx() |
float | default_fade_in() |
float | default_fade_out() |
float | end_animation_length( effect: VFX, fallback: float ) static |
void | spawn_at_position( pos: Vector3, new_rotation: Vector3 = Vector3.ZERO ) |
void | spawn_attached_to_entity( entity: Entity, location: VFXSelection.VfxLocation, offset: Vector3 = Vector3.ZERO ) |
bool | is_fading() |
bool | is_looping() |
bool | is_ending() |
void | force_stop() |
void | restart_loop() |
bool | has_duration_override() |
Enumerations ​
enum LoopState ​
Animation state management
- STARTING =
0 - LOOPING =
1 - ENDING =
2 - FINISHED =
3
Variable descriptions ​
LoopState loop_state = LoopState.STARTING ​
Which part of the effect plays: starting, looping or ending.
bool manually_stopped = false ​
Track if we've been manually stopped
bool has_start_animation = false ​
Animation references
bool has_loop_animation = false ​
True when the effect has a loop animation.
bool has_end_animation = false ​
True when the effect has an end animation.
Method descriptions ​
void activate_vfx( selection: VFXSelection = null ) ​
Loop VFX should NOT auto-cleanup by default (manual control)
void stop_loop_vfx() ​
Manually stop the loop VFX (triggers end sequence)
void attach_to_entity( entity: Variant, location: VFXSelection.VfxLocation, offset: Vector3 = Vector3.ZERO ) ​
Attaches the effect to a place on an entity, with an offset.
void deactivate_vfx() ​
Ends the effect (it plays its end animation first).
float default_fade_in() ​
A loop fades in over 0.25 s
float default_fade_out() ​
A loop with an end animation fades out over that animation (both end together), without one over 0.35 s
float end_animation_length( effect: VFX, fallback: float ) ​
The length of the end animation of an effect (clamped to 0.1 to 3 s), or fallback when it has none
void spawn_at_position( pos: Vector3, new_rotation: Vector3 = Vector3.ZERO ) ​
Starts the effect at a position and a rotation.
void spawn_attached_to_entity( entity: Entity, location: VFXSelection.VfxLocation, offset: Vector3 = Vector3.ZERO ) ​
Starts the effect attached to an entity.
bool is_fading() ​
Is the effect fading out?
bool is_looping() ​
Is the effect in its loop part?
bool is_ending() ​
Is the effect in its end part?
void force_stop() ​
Stops the effect at once.
void restart_loop() ​
Starts the effect again from its start part.
bool has_duration_override() ​
Does the effect have a timer that sets how long it lasts?