Combat Logic #

Decision helpers, snapshot getter overview table, and getCharacterState rollback. Per-field docs: Real-time State Getters.

isCounterAttackPossible #

isCounterAttackPossible(FrameAdvantage)

Checks whether a counterattack is possible at the given frame advantage.

  • Returns: boolean

Demo:

local fa = getLocalFrameAdvantage()
if isCounterAttackPossible(fa) then
    print("Counter window open at FA", fa)
end
1
2
3
4

isNotCharacter #

isNotCharacter(CharId)

Returns whether the current character ID differs from CharId.

Demo:

-- Bryan = 7; exit if wrong character
if isNotCharacter(7) then
    return
end
1
2
3
4

Real-time snapshot getters #

Read the current frame from CharacterSnapshot — the same source as the in-game Character State debug window and getCharacterState(0).self / .enemy. Use these when you need one field without building a full snapshot table.

Naming: getLocal{Field}() for self, getOpponent{Field}() for enemy. In onTick, self / enemy tables expose the same fields; globals stay valid anywhere (menu, message, draw).

Last* vs current: getLocalLastAttackType / getLocalLastMoveId track hook-cached “last changed” values. For the live move/attack on this frame, use getLocalAttackType() / getLocalMoveId().

Getter pair Returns Notes
getLocalCharacterId() / getOpponentCharacterId() integer Character ID
getLocalMoveTimer() / getOpponentMoveTimer() integer Move frame timer
getLocalMoveId() / getOpponentMoveId() integer Current move ID
getLocalLastMoveId() / getOpponentLastMoveId() integer Last move ID (hook cache)
getLocalSimpleMoveState() / getOpponentSimpleMoveState() integer Standing/crouch/air enum
getLocalComplexMoveState() / getOpponentComplexMoveState() integer Block/SS/recovery enum
getLocalAttackType() / getOpponentAttackType() integer Current attack type
getLocalLastAttackType() / getOpponentLastAttackType() integer Last attack type (hook cache)
getLocalAttackBonesType() / getOpponentAttackBonesType() integer Attacking limb (9/13/16/19)
getLocalAttackDamage() / getOpponentAttackDamage() integer Attack damage
getLocalStunState() / getOpponentStunState() integer Stun / hitstun state
getLocalHitOutcome() / getOpponentHitOutcome() integer Block / hit / whiff
getLocalStartup() / getOpponentStartup() integer Startup frames
getLocalStartupEnd() / getOpponentStartupEnd() integer Startup end frame
getLocalEndFrame() / getOpponentEndFrame() integer Move end frame (debug UI: EndFrames)
getLocalRecovery() / getOpponentRecovery() integer Recovery frames
getLocalDistance() / getOpponentDistance() number Distance between fighters
getLocalThrowTech() / getOpponentThrowTech() number Throw break state (large uint)
getLocalInputDirection() / getOpponentInputDirection() integer Direction input bitmask
getLocalInputAttack() / getOpponentInputAttack() integer Attack input bitmask
getLocalFacingDirection() / getOpponentFacingDirection() integer 0 = left, 1 = right
getLocalFrameAdvantage() / getOpponentFrameAdvantage() integer Frame advantage (1000 = neutral)
getLocalHealthValue() / getOpponentHealthValue() integer Health
getLocalHeatSmashMeter() / getOpponentHeatSmashMeter() integer Heat meter
getLocalFuturePowerCrush() / getOpponentFuturePowerCrush() boolean Upcoming power crush
getLocalFutureHomingAttack() / getOpponentFutureHomingAttack() boolean Upcoming homing
getLocalFutureHeatSmashBeta() / getOpponentFutureHeatSmashBeta() boolean Upcoming Heat Smash
getLocalIsThrowing() / getOpponentIsThrowing() boolean In throw animation
getLocalIsAir() / getOpponentIsAir() boolean Airborne flag
getLocalIsRageStarte() / getOpponentIsRageStarte() boolean Rage active
getLocalIsHeatSmashUsed() / getOpponentIsHeatSmashUsed() boolean Heat Smash consumed
-- Same values as debug overlay, without getCharacterState(0)
print(getLocalMoveId(), getOpponentAttackType(), getLocalDistance())
if getOpponentFutureHomingAttack() then return end
1
2
3

getCharacterState #

getCharacterState(rollback_frame)

Character state snapshot at a rollback frame offset.

  • Parameters: rollback_frame (integer) — Rollback frame index

Snapshot #

Field Type Description
self CharacterState Local player
enemy CharacterState Opponent

CharacterState #

Field Type Description
FrameCount integer Current frame count
FacingDirection integer 0 = left, 1 = right
IsAir boolean Airborne
CharacterID integer Character ID
MoveID integer Current move ID
AttackType integer Attack type
MoveTimer integer Move frame timer
SimpleMoveState integer Simple move state
ComplexMoveState integer Complex move state
Distance number Distance to opponent
HitOutcome integer Last hit result (block/hit/whiff)
StunState integer Stun state
Recovery integer Recovery frames remaining
AttackDamage integer Attack damage
IsRageStarte boolean Rage active
IsHeatSmashUsed boolean Heat Smash used
ThrowTech integer Throw break state
InputAttack integer Attack input
InputDirection integer Direction input
Startup integer Startup frames
StartupEnd integer Startup end frame
EndFrame integer Move end frame
IsThrowing boolean Performing throw
AttackBonesType integer Attacking limb type (9/13/16/19 = R/L hand/foot; 0 = none)
FuturePowerCrush boolean Upcoming power crush
FutureHomingAttack boolean Upcoming homing attack
FutureHeatSmashBeta boolean Upcoming Heat Smash beta

Demo:

local snap = getCharacterState(0)
if snap and snap.self then
    print("Move:", snap.self.MoveID, "Distance:", snap.self.Distance)
end
1
2
3
4