Attacks and casts
The Model view's Attack tab shows a unit type's attacks and casts as a game plays them, and sets their timing and their look.
Time an attack to its clip
- Look into a unit type (Content: right-click › Look into it) and open the Attack tab.
- The model swings at a dummy beside it, over and over. Attack speed shows the swing faster or slower, as items and buffs make it.
- The timeline shows the swing:
- the clip as it is played (amber where it cannot be fitted to the swing);
- the clip's own blow (its
hitmark); - the blow (red) and the end of the backswing (violet), the attack's
damagePointandrecovery.
- Drag a marker to move the blow or the backswing, or press From the clip to put the blow on the clip's
hitmark and the backswing on the rest of it. - The timing is a change of the game's data, like any other in the Data panel: press Keep there to write it into
data.json.
Dragged at another attack speed, a marker is scaled back to the type's own speed, so damagePoint stays what the simulation reads.
Set how it looks
Under the timeline:
- Its clips: one, or several taken in turn or at random; Critical, the clip of a critical strike; Clip speed, a factor on the fitted pace, or own pace.
- Effects and sounds: Launch (at the point it leaves from), From, Impact, Swing sound, Hit sound, and the Swing trail of a melee attack.
- What it shoots, for a ranged attack: its Speed (
projectileSpeed, indata.json), and the shot's model, colour, size, arc, the point it leaves from, its trail, the effect on it and where it lands. - Dummy: how far off the dummy stands.
Each look field is written into looks.json at once (LooksEntry.attacks, by the attack's place). As the code's takes them out. A unit with several attacks has a picker for each.
Set how it casts
Its casts, below, lists the unit's abilities. For the one picked:
- its clips, how they take turns, and clip speed;
- Cast time, the ability's wind-up (
castTime, indata.json, for every unit that has it); - On its hands, an effect while it winds up, at the points in At;
- Sound, as it begins.
Cast it plays it on the stage. The look is this unit's own (LooksEntry.casts, over the ability's AbilityLook.cast field by field).
In code
The tab's sums are functions of the editor's:
ts
import { swingPlan, damagePointAt, timingFromClip, withAttackLook } from '@v12-engine/editor'
const plan = swingPlan({ damagePoint: 0.5, recovery: 0.3, base: 1, speed: 1.5, length: 1.2, hitAt: 0.4 })
plan.swing // seconds to the blow at 1.5 attacks a second
damagePointAt(0.3, 1, 1.5) // the damagePoint a blow dragged to 0.3 s says
timingFromClip(model, 'Attack', 1.2) // { damagePoint, recovery } from the clip's hit mark
withAttackLook(entry.attacks, 0, { clip: ['Chop', 'Slash'], order: 'random' }) // looks.json's attacks, one field changedReference
| Set here | File | Field |
|---|---|---|
| The blow, the backswing, the shot speed | data.json | attacks.<n>.damagePoint, recovery, projectileSpeed |
| A cast's wind-up | data.json | abilities.<id>.castTime |
| An attack's clips, effects, sounds, shot | looks.json | attacks[n] (AttackLook) |
| A cast's clips, effect, sound | looks.json | casts.<ability> (CastLook) |