Combat effects

Usage guide of fx.hit_flash and fx.ability_vfx: the flash on a hit, the effect bound to an ability, settings and defaults, services, modding.

Source: module-kits:kits/fx_hit_flash/usage/en.mdView Markdown source

Also read offline — CLI: grip-forge docs fx-kitsMCP tool: gripforge_docs { "topic": "fx-kits" }

Visual effects of combat (fx.* kits) #

Short presentation effects tied to combat events: a library effect when an ability fires, a flash when something is hit. Readable offline: gripforge docs fx-kits, or the MCP tool gripforge_docs (topic fx-kits).

The map #

KitWhat it doesNeeds
fx.ability_vfxplays a library effect (kind vfx) where an ability lands, turned the way the caster facescombat.abilities
fx.hit_flashwhatever takes damage flashes: a bright tint that fades, with a small scale punchnothing besides game.engine

Both are views (role view): headless, they decide where and how and emit an event; the renderer plays or tints once. Neither takes a decision of the game, so neither declares a hook. They work on the web and in the native Rust player.

Turn it on #

gripforge_gamekit_install   { project_id: "gkp_…", id: "fx.hit_flash" }
gripforge_gamekit_configure { project_id: "gkp_…", id: "fx.hit_flash", config: { "playerColor": "#ff3b30", "duration": 0.2 } }
gripforge_gamekit_install   { project_id: "gkp_…", id: "fx.ability_vfx" }

Only the keys that differ from the defaults need to be written. The full reference is gripforge kit api <id>.

fx.hit_flash #

It listens to combat.damaged { target, amount, kind?, killed? }, so any combat kit triggers it. Without this kit, the web renderer keeps a plain white 0.08 s flash.

KeyDefaultMeaning
color#ffffffflash colour of a hit entity
playerColor#ff5a4aflash colour when the player is hit
duration0.14seconds; the tint fades over that time (0.03 to 1)
intensity2.4peak emissive strength (0.2 to 8)
punch0.06scale added at the peak (0.06 is +6 %); 0 turns it off
killBoost1.6multiplier of intensity and duration on the killing blow
minInterval0.06seconds before the same entity flashes again
onlyTags[]flash only entities carrying one of these tags; empty means everything
skipKinds["status"]damage kinds that do not flash (damage over time by default)
playertruethe player flashes too

Service fx.flash: flash(entity, { color?, duration?, intensity?, punch? }) tints any entity for a moment: a heal in green, a pickup, a parry. It emits the same event fx.hit_flash and uses the same renderer path. The time of the last flash is not saved.

fx.ability_vfx #

Bind a library effect to the slot ability_vfx:<ability id> (the ids of the abilities collection). It plays each time the ability reaches the configured phase, on the event ability.cue. An ability without a bound effect plays nothing: the game keeps its own cast feedback.

KeyDefaultMeaning
phaseactivethe ability phase that plays the effect: windup, active, or hit (on each target struck)
scale1size factor of every ability effect (0.1 to 10)
fitAreatruearea abilities scale their effect to the radius of the area
authoredRadius2.5radius in metres of the disc the effects are authored at; the divisor of the size of an area effect

Where it plays:

Ability shapePositionSize
selfon the casterscale
arc, lineon the caster, turned along its facingscale
circleahead of the caster by the ability's offsetradius / authoredRadius x scale when fitArea
phase hiton each target struckscale

Service fx.effects: play(slot, position, { yaw?, scale?, entity? }) plays any bound vfx slot at a point (an explosion on a death, a pickup sparkle) with the same event, fx.effect, and the same renderer path.

Modding and hooks #

Every config key of both kits is moddable (a mod may recolour or retime the flash, change the phase or the scale of ability effects). Whether an ability is cast is the decision of combat.abilities; whether a hit lands is the hook combat.damage of combat.core: a hit that a tap cancels emits no combat.damaged, so nothing flashes.

{ "schema": "gripforge.mod/1", "id": "red_flash", "name": "Red flash", "version": "1.0.0",
  "requires": { "fx.hit_flash": "^1" }, "config": { "fx.hit_flash": { "color": "#ff4040", "punch": 0.1 } } }

When it does not do what you expect #

SymptomCause and fix
Nothing flashesthe damage kind is in skipKinds, onlyTags excludes the entity, or the hit was cancelled upstream
The ability plays no effectno library effect is bound to ability_vfx:<id>, or phase is not the phase that fires
The area effect is the wrong sizeauthoredRadius differs from the radius the effect was authored at, or fitArea is false
The same entity flashes too oftenraise minInterval