Castagne Engine

Documentation (Dev Branch)

Castagne Engine

Getting Started

Editor

Gametypes

Intermediate

Making a Game

Pushing Castagne

Advanced

Modules

Attacks Reference

Specialized module to help with making attacks and combat systems.

Attack Basics

Functions

AttackRegister[1, 2][AllPhases, Init, Action, Reaction, Manual, Subentity]Basic
Initiates an attack with default parameters. This should be the first function called for a new attack, then you use other Attack functions to customize it, and finally you use Hitbox to apply it.
  • Arg 1: Type
  • Arg 2: (Optional) Notation
AttackRegisterNoNotation[1][AllPhases, Init, Action, Reaction, Manual, Subentity]Intermediate
Same as AttackRegister, but won't actually add the attack to the list of cancels, which you'll have to do manually.
  • Arg 1: Type
AttackAddNotation[1][AllPhases, Init, Action, Reaction, Manual, Subentity]Intermediate
Registers the attack under an additional notation input. This will still count as the same attack.
  • Arg 1: Notation
AttackDuration[1][Init, Action, Manual, Subentity]Basic
Changes the total duration of the attack. Can replace Attack's second parameter but must be called before it.
  • Arg 1: Total frames
AttackRearm[0, 1][Init, Action, Manual, Subentity]Intermediate
Sets the variables to be able to hit with another attack, and should be used between multihits. Resets the hit detection.
  • Arg 1: (Optional) Treat as a new attack instead of a multihit (reapplies proration and resets hit/block/clash flags) (Default: False)

Variables

_AttackData{}[ResetEachFrame]
_AttackDuration600[]
_AttackHitEntities[][]
_RecievedAttackData{}[]
Stores the last attack recieved.
_LastAttackFlags[][]
Stores the attack flags of the last attack recieved.
_RegisteredAttacksForEntityByType{}[]

Generics

Config

AttackDefault-Flags[][]

Functions

AttackFlag[1][Init, Action, Manual, Subentity]Basic
Sets a flag on the attack. All flags are transfered to the hit opponent with the AF prefix (meaning Low become AFLow), and are used by modules during attack checking. See the list of flags for more information.
  • Arg 1: Flag name
AttackUnflag[1][Init, Action, Manual, Subentity]Intermediate
Removes a flag from an attack.
  • Arg 1: Flag name
AttackRecievedFlag[1][Init, Action, Manual, Subentity]Advanced
Set an attack flag as if the entity recieved an attack having this flag.
  • Arg 1: Flag name
AttackRecievedUnflag[1][Init, Action, Manual, Subentity]Advanced
Removes an attack flag from a recieved attack.
  • Arg 1: Flag name
AttackParam[2][Init, Action, Manual, Subentity]Advanced
Sets a generic attack parameter directly. This is an advanced function and should be used either when you need some really specific adjustment, or when you want to add functionality without a module.
  • Arg 1: Parameter name
  • Arg 2: Parameter value
AttackRecievedGetParam[2, 3][Init, Action, Manual, Subentity]Intermediate
Extracts a parameter from the recieved attack
  • Arg 1: Parameter name
  • Arg 2: Target Variable
  • Arg 3: (Optional) Default Value
AttackRecievedSetParam[2][Init, Action, Manual, Subentity]Advanced
Sets a parameter in the recieved attack data
  • Arg 1: Parameter name
  • Arg 2: Parameter Value

Stuns

Config

AttackDefault-Hitstun-1[]
AttackDefault-Blockstun-1[]
AttackDefault-Hitstop4[]
AttackDefault-Blockstop2[]

Functions

AttackFrameAdvantage[1, 2][Init, Action, Manual, Subentity]Basic
Sets an attack's frame advantage automatically on hit and block. This is based on the total duration of the attack and the last use of the multihit flag. Same functionality as AttackSetHitstunBlockstun, but in an easier way.
  • Arg 1: Frame advantage on hit
  • Arg 2: Frame advantage on block
AttackFrameAdvantageHit[1][Init, Action, Manual, Subentity]Basic
Sets an attack's frame advantage automatically on hit. This is based on the total duration of the attack and the last use of the AttackRearm function. Same functionality as AttackSetHitstunBlockstun, but in an easier way.
  • Arg 1: Frame advantage on hit
AttackFrameAdvantageBlock[1][Init, Action, Manual, Subentity]Basic
Sets an attack's frame advantage automatically on block. This is based on the total duration of the attack and the last use of the AttackRearm function. Same functionality as AttackSetHitstunBlockstun, but in an easier way.
  • Arg 1: Frame advantage on block
AttackHitstunBlockstun[2][Init, Action, Manual, Subentity]Basic
Sets an attack's hitstun and blockstun. Same functionality as AttackFrameAdvantage, but in a more direct way.
  • Arg 1: Hitstun
  • Arg 2: Blockstun
AttackHitstun[1][Init, Action, Manual, Subentity]Basic
Sets an attack's hitstun. Same functionality as AttackFrameAdvantage, but in a more direct way.
  • Arg 1: Hitstun
AttackBlockstun[1][Init, Action, Manual, Subentity]Basic
Sets an attack's blockstun. Same functionality as AttackFrameAdvantage, but in a more direct way.
  • Arg 1: Blockstun

Variables

_HitstunDuration0[]
_BlockstunDuration0[]

Damage

Config

AttackDefault-Damage100[]
AttackDefault-ChipDamage0[]

Functions

AttackDamage[1][Init, Action, Manual, Subentity]
Unspecified.
AttackChipDamage[1][Init, Action, Manual, Subentity]Intermediate
Sets an attack's chip damage, the damage that gets inflicted when an opponent blocks.
  • Arg 1: The amount of chip damage

Blocking

Flags

AF_MustBlock-XAttack can't be blocked unless it has a CanBlock-[X] and Blocking-[X] flag.
AF_Unblockable-XAttack can't be blocked if opponent has [X] flag
AF_PhaseBlockAttack counts as missing instead of blocked.
CanBlockAllows blocking using the Blocking flag.
CanBlock-XAllows blocking attacks using the MustBlock-[X] flag.
CanBlock-AllSame as CanBlock-[X] for all values of [X].
BlockingSignifies the character is attempting to block, and will do so if abled by the CanBlock flag.
Blocking-XSignifies the character is attempting to block [X] attacks, and will do so if abled by a corresponding CanBlock-[X] flag.
Blocking-AllCounts as Blocking-[X] for all values of [X].

TODO PRORATION

Config

AttackDefault-ProrationDamage700[]
AttackDefault-StarterProrationDamage950[]
AttackDefault-ProrationHitstun900[]
AttackDefault-StarterProrationHitstun950[]
AttackDefault-MinDamage1[]

Functions

AttackProrationHitstun[2][Init, Action, Manual, Subentity]Intermediate
Sets an attack's proration for hitstun. The lower it is, the more hitstun will decay with each hit. Values are in permil.
  • Arg 1: First hit proration (used instead of proration for the first hit)
  • Arg 2: Subsequent hit proration
AttackProrationDamage[2][Init, Action, Manual, Subentity]Intermediate
Sets an attack's proration for damage. The lower it is, the more damage will decay with each hit. Values are in permil.
  • Arg 1: First hit proration (used instead of proration for the first hit)
  • Arg 2: Subsequent hit proration
AttackMinDamage[1][Init, Action, Manual, Subentity]Intermediate
Sets an attack's minimum damage.
  • Arg 1: The minimum amount of damage

Variables

_ProrationHitstun1000[]
_ProrationDamage1000[]

Movement

Config

AttackDefault-HitMomentumX1000[]
AttackDefault-HitMomentumY0[]
AttackDefault-HitMomentumAirX1000[]
AttackDefault-HitMomentumAirY200[]
AttackDefault-BlockMomentumX1000[]
AttackDefault-BlockMomentumY0[]
AttackDefault-BlockMomentumAirX1000[]
AttackDefault-BlockMomentumAirY200[]
AttackDefault-InheritMomentumHitGroundX1000[]
AttackDefault-InheritMomentumHitGroundY1000[]
AttackDefault-InheritMomentumHitAirX1000[]
AttackDefault-InheritMomentumHitAirY1000[]
AttackDefault-InheritMomentumBlockGroundX1000[]
AttackDefault-InheritMomentumBlockGroundY1000[]
AttackDefault-InheritMomentumBlockAirX1000[]
AttackDefault-InheritMomentumBlockAirY1000[]

Functions

AttackMomentum[1, 2, 3, 4][Init, Action, Manual, Subentity]Basic
Sets an attacks's added momentum to the opponent on hit and block.
  • Arg 1: Horizontal grounded momentum
  • Arg 2: (Optional) Vertical grounded momentum
  • Arg 3: (Optional) Horizontal airborne momentum
  • Arg 4: (Optional) Vertical airborne momentum
AttackMomentumHit[1, 2, 3, 4][Init, Action, Manual, Subentity]Intermediate
Sets an attacks's added momentum to the opponent on hit.
  • Arg 1: Horizontal grounded momentum
  • Arg 2: (Optional) Vertical grounded momentum
  • Arg 3: (Optional) Horizontal airborne momentum
  • Arg 4: (Optional) Vertical airborne momentum
AttackMomentumBlock[1, 2, 3, 4][Init, Action, Manual, Subentity]Intermediate
Sets an attacks's added momentum to the opponent on block.
  • Arg 1: Horizontal grounded momentum
  • Arg 2: (Optional) Vertical grounded momentum
  • Arg 3: (Optional) Horizontal airborne momentum
  • Arg 4: (Optional) Vertical airborne momentum
AttackInheritMomentum[0, 1, 2, 4][Init, Action, Manual, Subentity]Intermediate
Makes an attack inherit the momentum of the attacker, in permil. Happens on hit and block.
  • Arg 1: Ratio of Ground X Momentum conserved in permil
  • Arg 2: Ratio of Ground Y Momentum conserved in permil
  • Arg 3: Ratio of Air X Momentum conserved in permil
  • Arg 4: Ratio of Air Y Momentum conserved in permil
AttackInheritMomentumHit[0, 1, 2, 4][Init, Action, Manual, Subentity]Intermediate
Makes an attack inherit the momentum of the attacker, in permil. Happens on hit.
  • Arg 1: Ratio of Ground X Momentum conserved in permil
  • Arg 2: Ratio of Ground Y Momentum conserved in permil
  • Arg 3: Ratio of Air X Momentum conserved in permil
  • Arg 4: Ratio of Air Y Momentum conserved in permil
AttackInheritMomentumBlock[0, 1, 2, 4][Init, Action, Manual, Subentity]Intermediate
Makes an attack inherit the momentum of the attacker, in permil. Happens on block.
  • Arg 1: Ratio of Ground X Momentum conserved in permil
  • Arg 2: Ratio of Ground Y Momentum conserved in permil
  • Arg 3: Ratio of Air X Momentum conserved in permil
  • Arg 4: Ratio of Air Y Momentum conserved in permil

UNSORTED / TO REVIEW

Config

AttackDefault-AttributeAuto[]
AttackDefault-FloatGravity0[]
AttackDefault-KnockdownTimeMin13[]
AttackDefault-KnockdownTimeMax43[]
AttackDefault-GroundbounceTime30[]
AttackDefault-GroundbounceMomentum1000[]
Attack-ThrowInHitstunFalse[]
Attack-ThrowInBlockstunFalse[]

Functions

AttackAttribute[0, 1][Init, Action, Manual, Subentity]Intermediate
Sets an attack's attribute. This is used by the Invul-[Attrib] and Guard-[Attrib] family of flags. The Auto attribute will choose an attribute between Air, Mid, High, Low, Throw, and AirThrow depending on the attacker's state.
  • Arg 1: Attribute. Default: Auto
AttackFloat[1][Init, Action, Manual, Subentity]Intermediate
Sets the opponent's gravity on hit to the specified value until the next attack.
  • Arg 1: New Gravity
AttackKnockdown[0, 1, 2][Init, Action, Manual, Subentity]Intermediate
Sets an attack's minimum and maximum time on knockdown. Automatically applies the knockdown attack flag. If no arguments are given, use default values. If only one is given, the second is computed automatically from the difference between defaults.
  • Arg 1: (Optional) The minimum knockdown time
  • Arg 2: (Optional) Maximum knockdown time
AttackGroundbounce[1, 2][Init, Action, Manual, Subentity]Intermediate
Sets an attack's groundbounce
  • Arg 1: Groundbounce time
  • Arg 2: Groundbounce Momentum

Variables

_HitstunGravityFloat0[]
_KnockdownTimeMin13[]
_KnockdownTimeMax43[]
_GroundbounceTime0[]
_GroundbounceMomentum0[]
HP1[]
_AttackMomentumX0[]
_AttackMomentumY0[]

Attack Cancels

Config

AttackCancelPriorityDefault10000[]

Functions

AttackCancel[1, 2, 3, 4][Init, Action, Manual, Subentity]Basic
Adds an attack cancel. These will be active automatically in the sitations given by the 3rd argument.
  • Arg 1: State Name
  • Arg 2: (Optional) Command in numpad notation. See InputTransition for more details. (Default: State Name)
  • Arg 3: (Optional) Cancel situation using ATTACKCANCEL_ON flags (default: ATTACKCANCEL_ON_TOUCH_NEUTRAL)
  • Arg 4: (Optional) Priority (Default: AttackCancelPriorityDefault config key)
AttackAddRegisteredCancels[1, 2, 3][Init, Action, Manual, Subentity]Intermediate
Adds all attack cancels of a given type.
  • Arg 1: Attack type
  • Arg 2: (Optional) Cancel situation using ATTACKCANCEL_ON flags (default: ATTACKCANCEL_ON_TOUCH_NEUTRAL)
  • Arg 3: (Optional) Priority (Default: AttackCancelPriorityDefault config key)
AttackCancelPrefix[0, 1][Init, Action, Manual, Subentity]Intermediate
Set the prefix used when looking for attack cancels
  • Arg 1: New prefix to use for this frame.
AttackResetDoneCancels[0][Init, Action, Manual, Subentity]Advanced
Resets the list of used attacks in cancels, meaning you can use them again. Mostly used when returning to neutral.

Variables

ATTACKCANCEL_ON_HIT1[]
ATTACKCANCEL_ON_BLOCK2[]
ATTACKCANCEL_ON_HIT_BLOCK3[]
ATTACKCANCEL_ON_TOUCH3[]
ATTACKCANCEL_ON_WHIFF4[]
ATTACKCANCEL_ON_HIT_WHIFF5[]
ATTACKCANCEL_ON_BLOCK_WHIFF6[]
ATTACKCANCEL_ON_HIT_BLOCK_WHIFF7[]
ATTACKCANCEL_ON_TOUCH_WHIFF7[]
ATTACKCANCEL_ON_NEUTRAL8[]
ATTACKCANCEL_ON_HIT_NEUTRAL9[]
ATTACKCANCEL_ON_BLOCK_NEUTRAL10[]
ATTACKCANCEL_ON_HIT_BLOCK_NEUTRAL11[]
ATTACKCANCEL_ON_TOUCH_NEUTRAL11[]
ATTACKCANCEL_ON_WHIFF_NEUTRAL12[]
ATTACKCANCEL_ON_HIT_WHIFF_NEUTRAL13[]
ATTACKCANCEL_ON_BLOCK_WHIFF_NEUTRAL14[]
ATTACKCANCEL_ON_HIT_BLOCK_WHIFF_NEUTRAL15[]
ATTACKCANCEL_ON_TOUCH_WHIFF_NEUTRAL15[]
_AttackCancelPrefix[ResetEachFrame]
_AttackDoneCancels[][]
_AttackInitialFrame-1[]
_AttackHitconfirm_StateNull[]
_AttackPossibleCancelsWhiff{}[ResetEachFrame]
_AttackPossibleCancelsBlock{}[ResetEachFrame]
_AttackPossibleCancelsHit{}[ResetEachFrame]
_AttackPossibleCancelsNeutral{}[ResetEachFrame]

Flags

AttackHasHit
AttackWasBlocked
AttackHasWhiffed
AttackHasTouched
AttackHasHappened