HitFX (Asset): Difference between revisions

From FetishQuest Wiki
Jump to navigation Jump to search
JasX (talk | contribs)
Created page with "A HitFX is a collection of particles, CSS effects, and audio to play. Often tied to a text to add particles and sound effects to attacks. {| class="wikitable" |+ !Field !Type !Default !Description |- |Label |String | |A unique label to access your HitFX by. '''Do not change after setting it up!''' |- |Description |String | |Describe your effect, only used in the editor. |- |Stagger |Int |0 |Force a time in milliseconds between triggers. Usually used for AoE to prevent t..."
 
JasX (talk | contribs)
No edit summary
Line 31: Line 31:
|0
|0
|Can be used for audio triggers to play the combat hit grunts after this amount of milliseconds.
|Can be used for audio triggers to play the combat hit grunts after this amount of milliseconds.
|-
|Data
|JSON Array
|[]
|Here is where you create various stages of the hit effect. The most simple hitFX has only one. See below.
|}
== Data ==
Data is a JSON array of stage objects. None of them are required, and you can omit anything where you want to use the default value.
{| class="wikitable"
|+
!Field
!Type
!Default
!Description
|-
|particles
|string or object
|none
|Label of a [[Particles (Asset)|particles]] asset to use for this stage. You can optionally make it an object if you wish to tweak some settings of the particle system, such as color. See below.
|-
|emit_duration
|int
|200
|How long to emit or play a sound for. In milliseconds.
|-
|fade_duration
|int
|2000
|Time in milliseconds after emit_duration to remove the particle system. Make sure all particles are dead before this time or they'll clip out.
|-
|hold
|int
|0
|Hold for this amount of milliseconds before advancing to the next stage.
|-
|tween
|boolean
|true
|Tween from origin to destination. If false, only destination is used.
|-
|origin
|string
|"victim"
|Where the particle system should originate from. Can be victim or sender.
|-
|origin_rand
|float
|none
|If unset, it'll use the last stage object's origin. Randomizes how far from the center of the origin portrait to start the particle system.
|-
|destination
|string
|"victim"
|Where the particle system should end up. Can be victim or sender.
|-
|destination_rand
|float
|none
|If unset, use the previous stage's origin. Randomizes how far from the center of the target portrait to end the particle system.
|-
|start_offs
|obj
|{"x":0,"y":0}
|Adds an offset to the starting position of the particle system.
|-
|end_offs
|obj
|{"x":0,"y":0}
|Adds an offset to the ending position of the particle system.
|-
|easing
|string
|"Cubic.In"
|An easing type from the Tween.js library.
|-
|sound_kits
|array
|[]
|An array of [[Audio Kit (Asset)|AudioKit]] labels.
|-
|css_fx
|str
|none
|Name of a CSS animation effect to run on the target. See the div.fx... styles in the [https://gitgud.io/JasX/fetishquest/-/blob/mistress/public/style.css?ref_type=heads#L618 main CSS] for viable options.
|-
|css_fx_targ
|str
|"victim"
|Target to run the css animation on. Either "victim" or "sender".
|}
|}

Revision as of 13:29, 11 June 2025

A HitFX is a collection of particles, CSS effects, and audio to play. Often tied to a text to add particles and sound effects to attacks.

Field Type Default Description
Label String A unique label to access your HitFX by. Do not change after setting it up!
Description String Describe your effect, only used in the editor.
Stagger Int 0 Force a time in milliseconds between triggers. Usually used for AoE to prevent the HitFX to play at the same time on all targets.
Once Boolean False Used in events with multiple targets (such as AoE) to only play the effect once. Especially if the effect only plays on the sender.
Hit Time Int 0 Can be used for audio triggers to play the combat hit grunts after this amount of milliseconds.
Data JSON Array [] Here is where you create various stages of the hit effect. The most simple hitFX has only one. See below.

Data

Data is a JSON array of stage objects. None of them are required, and you can omit anything where you want to use the default value.

Field Type Default Description
particles string or object none Label of a particles asset to use for this stage. You can optionally make it an object if you wish to tweak some settings of the particle system, such as color. See below.
emit_duration int 200 How long to emit or play a sound for. In milliseconds.
fade_duration int 2000 Time in milliseconds after emit_duration to remove the particle system. Make sure all particles are dead before this time or they'll clip out.
hold int 0 Hold for this amount of milliseconds before advancing to the next stage.
tween boolean true Tween from origin to destination. If false, only destination is used.
origin string "victim" Where the particle system should originate from. Can be victim or sender.
origin_rand float none If unset, it'll use the last stage object's origin. Randomizes how far from the center of the origin portrait to start the particle system.
destination string "victim" Where the particle system should end up. Can be victim or sender.
destination_rand float none If unset, use the previous stage's origin. Randomizes how far from the center of the target portrait to end the particle system.
start_offs obj {"x":0,"y":0} Adds an offset to the starting position of the particle system.
end_offs obj {"x":0,"y":0} Adds an offset to the ending position of the particle system.
easing string "Cubic.In" An easing type from the Tween.js library.
sound_kits array [] An array of AudioKit labels.
css_fx str none Name of a CSS animation effect to run on the target. See the div.fx... styles in the main CSS for viable options.
css_fx_targ str "victim" Target to run the css animation on. Either "victim" or "sender".