Castagne Engine

Documentation (Dev Branch)

Castagne Engine

Getting Started

Editor

Gametypes

Intermediate

Making a Game

Pushing Castagne

Advanced

Modules

Input Reference

Module handling Input inside of the Castagne Engine. Works closely together with CastagneInput.gd. Please read the Intermediate Guide/Castagne Input page for more details.

Input Definition

Holds the input layout and default bindings.

Config

InputLayout[{ControllerInputs:[[[14]], [[15]], [[13]], [[12]]], GameInputNames:[Left, Right, Down, Up, Back, Forward, Portside, Starboard, NeutralH, NeutralV], KeyboardInputs:[[[65, 81]], [[68]], [[83]], [[90, 87, 32]]], Name:Movement, Type:3}, {ControllerInputs:[[[2]]], KeyboardInputs:[[[72, 16777354]]], Name:A, Type:1}, {ControllerInputs:[[[3]]], KeyboardInputs:[[[74, 16777355]]], Name:B, Type:1}, {ControllerInputs:[[[1]]], KeyboardInputs:[[[75, 16777356]]], Name:C, Type:1}, {ControllerInputs:[[[0]]], KeyboardInputs:[[[76, 16777350]]], Name:D, Type:1}, {Combination:[[1, 0], [2, 0]], CombinationAny:False, ControllerInputs:[[[4]]], KeyboardInputs:[[[16777349]]], Name:Throw, Type:4}, {Combination:[[0, 3]], CombinationAny:True, ControllerInputs:[[]], KeyboardInputs:[[]], Name:Jump, Type:4}, {Combination:[[1, 0], [2, 0], [3, 0]], CombinationAny:True, ControllerInputs:[[]], KeyboardInputs:[[]], Name:Tech, Type:4}, {ControllerInputs:[[[11]]], KeyboardInputs:[[[16777221, 16777217]]], Name:Pause, Type:1}, {ControllerInputs:[[[10]]], KeyboardInputs:[[[16777280]]], Name:Reset, Type:1}, {ControllerInputs:[[[8]]], KeyboardInputs:[[[]]], Name:TrainingButton1, Type:1}, {ControllerInputs:[[[9]]], KeyboardInputs:[[[]]], Name:TrainingButton2, Type:1}][Hidden]
The complete InputLayout to use.
NumberOfKeyboardPlayers2[]
Number of keyboard devices to setup.
NumberOfKeyboardLayouts2[]
Number of keyboard default bindings to make available.
NumberOfControllerPlayers4[]
Number of controller devices to setup.
NumberOfControllerLayouts2[]
Number of controller default bindings to make available.
InputBufferSizePress3[Advanced]Advanced
Number of frames an input press/release event will be active.

Variables

_InputsRaw[][]
Hold the raw inputs themselves, set by the engine.
_InputsProcessed[][]
Holds the input data for each player.
_InputsProcessedPrevious[][]
Holds the previous values of _InputsProcessed
_Inputs{}[]
Holds the input data of the entity.
_InputsPrevious[][]
Holds the previous values of _Inputs

Fake Presses

Functions to simulate fake pressed during the AI phase. Untested.

Functions

InputPress[1][AI, Init, Action, Manual]Intermediate
Makes a fake input press. Untested.
  • Arg 1: Input Name
InputRelease[1][AI, Init, Action, Manual]Intermediate
Makes a fake input unpress. Untested.
  • Arg 1: Input Name

Input Transition

Functions relating to the Input Transition system, which allows a user to setup transitions when a certain input is pressed.

Config

InputTransitionDefaultPriority1000[]
The default Transition priority for InputTransition.

Functions

InputTransition[1, 2, 3][Action, Manual]Intermediate
Sets up an input transition, which will do a transition when the input given is pressed.
  • Arg 1: The input to watch for, in numpad notation.
  • Arg 2: (Optional) The name of the state to transition to. By default, the same as the notation.
  • Arg 3: (Optional) The priority for the transition. By default, the value specified in the castagne config.

Variables

_InputTransitionList[][ResetEachFrame]
List of the input transitions to watch for.

Motion Inputs

System for detecting when motion input has been performed by a player.

Config

DirectionalInputBuffer60[]
Number of frames the module retains the directional inputs from. This value should be greater than the longest motion input times the individual input interval for that motion.
ShortMotionInterval12[]
Maximum number of frames between inputs for a motion to remain valid. This value is for motions with three directions or less.
LongMotionInterval8[]
Maximum number of frames between inputs for a motion to remain valid. This value is for motions with more than three directions.
ButtonInterval8[]
Maximum number of frames between motion input and pressing the button for a motion to remain valid.
ValidMotionInputs236, 214, 623, 421, 41236, 63214, 252[]
Motion inputs in numpad notation that the system will check for.

Variables

DirectionalInputLog[]{Description:Array containing just the raw directional inputs for a player. Inputs are held for a number of frames equal to the buffer config variable.}
PerformedMotions[]{Description:Array containing the motions that have been performed by the player.}