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.

Attacks

Config

Attack-ThrowInHitstunFalse[]
Attack-ThrowInBlockstunFalse[]

Functions

Attack[1, 2][Init, Action, Manual]
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: Damage
  • Arg 2: (Optional) Total frames (must be specified at the first attack at least)
AttackDuration[1][Init, Action, Manual]
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][Init, Action, Manual]
Sets the variables to be able to hit with another attack, and should be used between multihits. Resets the hit detection.
AttackParam[2][Init, Action, Manual]
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
AttackFlag[1][Init, Action, Manual]
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]
Removes a flag from an attack.
  • Arg 1: Flag name
AttackRecievedFlag[1][Init, Action, Manual]
Set an attack flag as if the entity recieved an attack having this flag.
  • Arg 1: Flag name
AttackRecievedUnflag[1][Init, Action, Manual]
Removes an attack flag from a recieved attack.
  • Arg 1: Flag name
AttackAttribute[0, 1][Init, Action, Manual]
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
AttackFrameAdvantage[1, 2][Init, Action, Manual]
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]
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 multihit flag. Same functionality as AttackSetHitstunBlockstun, but in an easier way.
  • Arg 1: Frame advantage on hit
AttackFrameAdvantageBlock[1][Init, Action, Manual]
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 multihit flag. Same functionality as AttackSetHitstunBlockstun, but in an easier way.
  • Arg 1: Frame advantage on block
AttackHitstunBlockstun[2][Init, Action, Manual]
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]
Sets an attack's hitstun. Same functionality as AttackFrameAdvantage, but in a more direct way.
  • Arg 1: Hitstun
AttackBlockstun[1][Init, Action, Manual]
Sets an attack's blockstun. Same functionality as AttackFrameAdvantage, but in a more direct way.
  • Arg 1: Blockstun
AttackProrationHitstun[2][Init, Action, Manual]
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]
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
AttackChipDamage[1][Init, Action, Manual]
Sets an attack's chip damage, the damage that gets inflicted when an opponent blocks.
  • Arg 1: The amount of chip damage
AttackMinDamage[1][Init, Action, Manual]
Sets an attack's minimum damage.
  • Arg 1: The minimum amount of damage
AttackMomentum[1, 2, 3, 4][Init, Action, Manual]
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]
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]
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
AttackFloat[1][Init, Action, Manual]
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]
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, 3][Init, Action, Manual]
Sets an attack's groundbounce
  • Arg 1: Groundbounce time
  • Arg 2: Groundbounce Momentum
  • Arg 3: (Optional) Maximum ground bounces

Variables

_AttackData{}[ResetEachFrame]
_AttackDuration600[]
_AttackHitEntities[][]
_HitstunDuration0[]
_BlockstunDuration0[]
_ProrationHitstun1000[]
_ProrationDamage1000[]
_KnockdownTimeMin13[]
_KnockdownTimeMax43[]
_GroundbounceTime0[]
_GroundbounceMomentum0[]
_Groundbounces0[]
_AttackMomentumX0[]
_AttackMomentumY0[]

Flags

MultihitAllow an attack to hit again.
AFLowMakes an attack unblockable while standing up.
AFOverheadMakes an attack unblockable while crouching.
AFInheritMomentumMakes it so that the attack inherits the attacker's momentum.
AFFloatSet by the AttackFloat function. Tells the opponent to override the usual gravity for the next hit.
Invul-AllCan't by hit by any attacks, they will count as whiffed.
Invul-Air
Invul-High
Invul-Mid
Invul-Low
Invul-Throw
Invul-AirThrow
Invul-Projectile
Guard-AllCan't by hit by any attacks, they will count as blocked.
Guard-Air
Guard-High
Guard-Mid
Guard-Low
Guard-Throw
Guard-AirThrow
Guard-Projectile
Invuled
Guarded

Attack Cancels

Functions

AttackApplyCancels[0, 1][Reaction, Manual]
Manages the transitions of attacks using numpad notation. A prefix can be added. It will only cancel into an attack if it wasn't already used since the last call to AttackResetDoneCancels.
  • Arg 1: (Optional) Prefix
AttackResetDoneCancels[0][Init, Action, Manual]
Resets the list of used attacks in cancels, meaning you can use them again. Mostly used when returning to neutral.
AttackCancelOnWhiff[1, 2][Init, Action, Manual]
Adds a possible cancel on whiff.
  • Arg 1: The command to be used in numpad notation.
  • Arg 2: (Optional) Attack name if different from the numpad notation.
AttackCancelOnBlock[1, 2][Init, Action, Manual]
Adds a possible cancel on block.
  • Arg 1: The command to be used in numpad notation.
  • Arg 2: (Optional) Attack name if different from the numpad notation.
AttackCancelOnHit[1, 2][Init, Action, Manual]
Adds a possible cancel on hit.
  • Arg 1: The command to be used in numpad notation.
  • Arg 2: (Optional) Attack name if different from the numpad notation.
AttackCancelOnTouch[1, 2][Init, Action, Manual]
Adds a possible cancel on block or hit.
  • Arg 1: The command to be used in numpad notation.
  • Arg 2: (Optional) Attack name if different from the numpad notation.
AttackCancelOnTouchAndWhiff[1, 2][Init, Action, Manual]
Adds a possible cancel on whiff, block, or hit.
  • Arg 1: The command to be used in numpad notation.
  • Arg 2: (Optional) Attack name if different from the numpad notation.
AttackCancelNeutral[1, 2][Init, Action, Manual]
Adds a possible cancel when in a neutral state.
  • Arg 1: The command to be used in numpad notation.
  • Arg 2: (Optional) Attack name if different from the numpad notation.
AttackCancelOnTouchAndNeutral[1, 2][Init, Action, Manual]
Adds a possible cancel when in a neutral state or on block or hit.
  • Arg 1: The command to be used in numpad notation.
  • Arg 2: (Optional) Attack name if different from the numpad notation.
AttackAddAllCancelsOnWhiff[1, 2][Init, Action, Manual]
Adds all cancels from a button on whiff. For example using B and j as parameters will add j1B, j2B, j3B and so on.
  • Arg 1: The base button to use.
  • Arg 2: (Optional) Prefix.
AttackAddAllCancelsOnBlock[1, 2][Init, Action, Manual]
Adds all cancels from a button on block. For example using B and j as parameters will add j1B, j2B, j3B and so on.
  • Arg 1: The base button to use.
  • Arg 2: (Optional) Prefix.
AttackAddAllCancelsOnHit[1, 2][Init, Action, Manual]
Adds all cancels from a button on hit. For example using B and j as parameters will add j1B, j2B, j3B and so on.
  • Arg 1: The base button to use.
  • Arg 2: (Optional) Prefix.
AttackAddAllCancelsOnTouch[1, 2][Init, Action, Manual]
Adds all cancels from a button on block or hit. For example using B and j as parameters will add j1B, j2B, j3B and so on.
  • Arg 1: The base button to use.
  • Arg 2: (Optional) Prefix.
AttackAddAllCancelsOnTouchAndWhiff[1, 2][Init, Action, Manual]
Adds all cancels from a button on whiff, block, or hit. For example using B and j as parameters will add j1B, j2B, j3B and so on.
  • Arg 1: The base button to use.
  • Arg 2: (Optional) Prefix.
AttackAddAllCancelsNeutral[1, 2][Init, Action, Manual]
Adds all cancels from a button when in a neutral state. For example using B and j as parameters will add j1B, j2B, j3B and so on.
  • Arg 1: The base button to use.
  • Arg 2: (Optional) Prefix.
AttackAddAllCancelsOnTouchAndNeutral[1, 2][Init, Action, Manual]
Adds all cancels from a button when in a neutral state, or on block or hit. For example using B and j as parameters will add j1B, j2B, j3B and so on.
  • Arg 1: The base button to use.
  • Arg 2: (Optional) Prefix.

Variables

_AttackInitialFrame-1[]
_AttackHitconfirm_StateNull[]
_AttackDoneCancels[][]
_AttackPossibleCancelsWhiff{}[ResetEachFrame]
_AttackPossibleCancelsBlock{}[ResetEachFrame]
_AttackPossibleCancelsHit{}[ResetEachFrame]
_AttackPossibleCancelsNeutral{}[ResetEachFrame]
_AttackHasHitFalse[]
_AttackWasBlockedFalse[]
_AttackHasWhiffedFalse[]
_AttackHasTouchedFalse[]
_LastAttackFlags[][]
Stores the attack flags of the last attack recieved.

Default Attack Params

Config

AttackDefault-ProrationDamage700[]
AttackDefault-StarterProrationDamage950[]
AttackDefault-ProrationHitstun900[]
AttackDefault-StarterProrationHitstun950[]
AttackDefault-Hitstop4[]
AttackDefault-Blockstop2[]
AttackDefault-KnockdownTimeMin13[]
AttackDefault-KnockdownTimeMax43[]
AttackDefault-GroundbounceTime30[]
AttackDefault-GroundbounceMomentum1000[]
AttackDefault-MaxGroundbounces3[]
AttackDefault-FloatGravity0[]