Contains the absolute core functions of the engine. This should be included in virtually all cases, and tends to be relied upon by the engine itself.
These functions are focused on basic variable and flag manipulation.
Flag | [1] | [Init, Action, Manual, Subentity] | Basic |
---|---|---|---|
Raises a flag. Flags are reset at the beginning of each frame and allow you to communicate easily between modules. Flags are tested with L branches.
| |||
Unflag | [1] | [Init, Action, Manual, Subentity] | Basic |
Unsets a flag, if it was set earlier.
| |||
FlagNext | [1] | [Init, Action, Manual, Subentity] | Basic |
Raises a flag at the beginning of the next frame.
| |||
UnflagNext | [1] | [Init, Action, Manual, Subentity] | Basic |
Unsets a flag for the next frame, if it was set earlier with FlagNext.
| |||
Set | [2] | [Init, Action, Manual, Subentity] | Basic |
Sets a variable to a given integer value.
| |||
SetStr | [2] | [Init, Action, Manual, Subentity] | Basic |
Sets a variable to a given string (text) value.
|
_Flags | [] | [ResetEachFrame] | |
---|---|---|---|
The list of flags held by the entity | |||
_FlagsNext | [] | [] | |
The list of flags to be raised at the beginning of next frame. |
Basic mathematical functions.
Add | [2, 3] | [Init, Action, Manual, Subentity] | Basic |
---|---|---|---|
Adds two numbers and stores it in the first variable or an optional third variable.
| |||
Sub | [2, 3] | [Init, Action, Manual, Subentity] | Basic |
Substracts two numbers and stores it in the first variable or an optional third variable.
| |||
Mul | [2, 3] | [Init, Action, Manual, Subentity] | Basic |
Multiplies two numbers and stores it in the first variable or an optional third variable.
| |||
Div | [2, 3] | [Init, Action, Manual, Subentity] | Basic |
Divides two numbers and stores it in the first variable or an optional third variable.
| |||
Mod | [2, 3] | [Init, Action, Manual, Subentity] | Basic |
Computes the remainder of the division between two numbers and stores it in the first variable or an optional third variable.
| |||
Max | [2, 3] | [Init, Action, Manual, Subentity] | Basic |
Stores the bigger of the two numbers in the first variable or an optional third variable.
| |||
Min | [2, 3] | [Init, Action, Manual, Subentity] | Basic |
Stores the smaller of the two numbers in the first variable or an optional third variable.
|
These functions are focused on entity manipulation.
These functions work using a concept known as the Target Entity, which can be any other entity. This may be selected through the 'TargetEntity' family of functions.
This entity may then be used as a reference point for specific functions. Something to keep in mind is that the data gathered from the target entity like this will be from the end of last frame, while the data alteration directives will be effective at the end of the phase. In the case of targetting an entity currently being created, the values will be set just after creation, at the beginning of the next frame.
If several entities want to alter the same value on the same target entity, the behaviour should be considered undefined (but in practice, will use the one from the entity with the highest ID).
The target entity is reset at the beginning of each frame, to the current entity (it targets itself). This can be overriden by other modules (mainly, FlowFighting which will target the opponent if playing with two players)
CreateEntity | [1] | [Init, Action, Manual, Subentity] | Intermediate |
---|---|---|---|
Creates a new entity at the beginning of the next frame, using the given entity name, and targets it.
Also sets some parameters to make entity creation easier (position at root, copy facing)
| |||
CreateEntityRaw | [1] | [Init, Action, Manual, Subentity] | Intermediate |
Creates a new entity at the beginning of the next frame, using the given entity name, and targets it.
| |||
DestroyEntity | [0] | [Init, Action, Manual, Subentity] | Intermediate |
Deletes the currently targetted entity at the beginning of the next frame. | |||
GetCurrentEntityID | [1] | [Init, Action, Manual, Subentity] | Advanced |
Write the current entity ID to a variable.
| |||
GetTargetEntityID | [1] | [Init, Action, Manual, Subentity] | Advanced |
Write the target entity ID to a variable.
| |||
TargetEntityByID | [1] | [Init, Action, Manual, Subentity] | Advanced |
Targets an entity using its ID
| |||
TargetEntitySelf | [0] | [Init, Action, Manual, Subentity] | Advanced |
Targets the current entity (autotargetting). | |||
TargetSave | [0] | [Init, Action, Manual, Subentity] | Advanced |
Saves the target, which can then be recalled with TargetRecall at will. This is used at regular intervals and should represent your main target. | |||
TargetRecall | [0] | [Init, Action, Manual, Subentity] | Advanced |
Recalls a previously set target. This is used at regular intervals and should represent your main target. | |||
CopyFromTarget | [1, 2] | [Init, Action, Manual, Subentity] | Intermediate |
Copies a variable from the target entity. This will however copy the variable value from the end of the last frame.
| |||
CopyFromTargetNow | [1, 2] | [Init, Action, Manual, Subentity] | Advanced |
Copies a variable from the target entity. THIS WILL COPY THE VALUE IMMEDIATELY AND AS SUCH IS SUSCEPTIBLE TO ORDER EXECUTION BUGS.
| |||
CopyToTarget | [1, 2] | [Init, Action, Manual, Subentity] | Intermediate |
Copies a variable to the target entity. This will be applied at the end of the phase, or at initialization for new entities.
| |||
SetIntInTarget | [2] | [Init, Action, Manual, Subentity] | Intermediate |
Sets a variable in the target entity. This will be applied at the end of the phase, or at initialization for new entities.
| |||
SetStrInTarget | [2] | [Init, Action, Manual, Subentity] | Intermediate |
Sets a variable in the target entity. This will be applied at the end of the phase, or at initialization for new entities.
| |||
FlagInTarget | [1] | [Init, Action, Manual, Subentity] | Intermediate |
Sets a flag in the target. This will be applied at the end of the phase, but doesn't carry over to the next frame, meaning you'll most likely only access it in Reaction phase.
| |||
UnflagInTarget | [1] | [Init, Action, Manual, Subentity] | Intermediate |
Unsets a flag in the target. This will be applied at the end of the phase, but doesn't carry over to the next frame, meaning you'll most likely only access it in Reaction phase.
|
_CopyToBuffer | [] | [] | |
---|---|---|---|
Global buffer to hold the variables entities set to each other. | |||
_FlagTargetBuffer | [] | [ResetEachFrame] | |
Global buffer to hold the flags entities set to each other. | |||
_TargetEID | -1 | [ResetEachFrame] | |
Hold the current target EID, reset each frame. | |||
_TargetSavedEID | -1 | [] | |
Hold the current saved target EID, persistent over frames. Should represent the main target. |
Holds functions and variables pertaining to the states themselves. Handles transitions, and state calls.
Transition | [0, 1, 2, 3] | [Init, Reaction, Manual] | Basic |
---|---|---|---|
Changes the current script/state. If multiple changes are made in the same frame, the first one with the biggest priority wins. Changes from one state to itself are ignored, except if allowing self-transition in the arguments. The change is buffered and executed at the end of the transition phase or the init phase. Calling the function without arguments will cancel the transition.
| |||
TransitionBuffer | [0, 1, 2, 3] | [Init, Action, Reaction, Manual, Subentity] | Basic |
Same as Transition, but also works during the action phase. This can make some code simpler, and is separated because some confusing logic may happen when buffering all the time.
| |||
Call | [1] | [Init, Action, Reaction, Freeze, Manual, Subentity] | Basic |
Executes another script/state. Script must be known at compile time.
| |||
CallParent | [0] | [Init, Action, Reaction, Freeze, Manual, Subentity] | Intermediate |
Execute the same script on the parent skeleton. | |||
CallFromMain | [1] | [Init, Subentity, Manual] | Basic |
Executes another script/state from the main entity. Script must be known at compile time.
| |||
CallAfter | [1] | [Init, Action, Reaction, Freeze, Manual, Subentity] | Intermediate |
Adds a static call at the end of the state.
|
_State | Init-Main | [NoInit] | |
---|---|---|---|
The name of the current state | |||
_StateTarget | Null | [ResetEachFrame] | |
The name of the state we want to transition to. | |||
_StateFrameID | 0 | [] | |
The FrameID counted from when we transitionned into the state. (Starts at 1, 0 being the frame the transition is done in.) | |||
_StateChangePriority | -100000 | [ResetEachFrame] | |
Current priority for the state transition, given by Transition() | |||
_StateStartFrame | 0 | [] | |
The FrameID the current state started in. |
Functions that help understanding what happens inside the code.
Log | [1] | [Init, Action, Freeze, Manual, Subentity] | Basic |
---|---|---|---|
Writes a log to the console output during the Action phase.
| |||
LogR | [1] | [Reaction, Manual] | Intermediate |
Writes a log to the console output during the Reaction phase only.
| |||
LogB | [1] | [Init, Action, Reaction, Manual, Subentity] | Intermediate |
Writes a log to the console output during the Init, Action, and Reaction phases.
|
Functions to control the engine flow.
FreezeFrames | [1] | [Init, Action, Manual, Subentity] | Intermediate |
---|---|---|---|
Sets an amount of freeze frames to be effective immediately. Freeze only affects this entity
| |||
HaltFrames | [1] | [Init, Action, Manual, Subentity] | Intermediate |
Sets an amount of freeze frames to be effective immediately. Halt stops time for everyone except this entity.
|
Configuration related to the game itself, including Characters and Stages.
GameTitle | Untitled Castagne Game | [Basic] | Basic | |
---|---|---|---|---|
The name of the game. | ||||
GameVersion | Unspecified Version | [Basic] | Basic | |
The version of the game, can be used to differenciate patches. | ||||
CharacterPaths | res://castagne/examples/fighters/baston/Baston-25D.casp, res://castagne/examples/fighters/baston/Baston-2D.casp | [Hidden] | ||
The list of characters that can be loaded. | ||||
Skeletons | [Hidden] | |||
The list of skeletons that may be loaded. Used when the Skeleton parameter of a character is set to an int, or when none is given. | ||||
StagePaths | res://castagne/examples/stages/default-25d-stage/Default25DStage.tscn | [Intermediate] | Intermediate | |
The list of stages that may be loaded. |
Variables and configurations relating to the engine itself. Please be careful when changing these.
CastagneVersion | Castagne v0.53 | [Hidden, Reload, Advanced] | Advanced | |
---|---|---|---|---|
Internal version of the Castagne engine. | ||||
PathEngine | res://castagne/engine/CastagneEngine.tscn | [Expert] | Expert | |
Filepath to the engine scene. | ||||
PathEditor | res://castagne/editor/CastagneEditor.tscn | [Expert] | Expert | |
Filepath to the editor scene. | ||||
PathDevTools | res://castagne/devtools/DevTools.tscn | [Expert] | Expert | |
Filepath to the devtools scene. | ||||
PathMainMenu | res://castagne/menus/mainmenu/DefaultMainMenu.tscn | [Advanced] | Advanced | |
Filepath to the main menu scene. | ||||
PathCharacterSelect | res://castagne/menus/characterselect/DefaultCharacterSelect.tscn | [Advanced] | Advanced | |
Filepath to the character select screen scene. | ||||
PathPostBattle | res://castagne/menus/postbattle/DefaultPostBattle.tscn | [Advanced] | Advanced | |
Filepath to the post battle scene. | ||||
ConfigSkeleton | [ReloadFull, Advanced] | Advanced | ||
Path to the config skeleton of this file. Used to build additively on top of a base config, which is done for the genre selection for instance. |
_FrameID | 0 | [] | |
---|---|---|---|
The number of game frames since the beginning of the match. | |||
_TrueFrameID | 0 | [] | |
The number of actual frames since the beginning of the match. | |||
_SkipFrame | False | [ResetEachFrame] | |
Tells the engine if it should do a skip loop. | |||
_FrozenFrame | False | [ResetEachFrame] | |
Tells the engine if it should do a freeze loop | |||
_SkipFrames | 0 | [] | |
Helper variable, counting the number of frames to skip remaining. | |||
_FreezeFrames | 0 | [] | |
Helper variable, counting the number of frames in freeze remaining. | |||
_HaltFrames | 0 | [] | |
Helper variable, counting the number of frames in halt phase remaining. | |||
_CurrentEntityID | 0 | [] | |
Remembers the next ID for a new entity. | |||
_EntitiesToInit | [] | [] | |
List of entities to handle in the next Init Phase | |||
_SubentitiesToInit | [] | [] | |
List of entities to handle in the next Init Phase | |||
_EntitiesToDestroy | [] | [] | |
List of entities to destroy at the beginning of the next loop. | |||
_ActiveEntities | [] | [] | |
List of entities that are executed each frame. | |||
_ActiveFullEntities | [] | [] | |
List of main entities that are executed each frame. | |||
_ActiveSubentities | [] | [] | |
List of subentities that are executed each frame. | |||
_Player | -1 | [] | |
_FighterID | -1 | [] | |
_EID | -1 | [] | |
_State | [] | ||
_NbPlayers | 0 | [] | |
Remembers the amount of players. |
Configurations relating to the module system of Castagne.
Modules | coreset, physics, graphics, flow, user | [Hidden, ReloadFull, Advanced] | Advanced | |
---|---|---|---|---|
List of modules to load for matches. | ||||
Modules-coreset | editor, functions, attacks, audio, input, menus | [Hidden, ReloadFull, Expert] | Expert | |
Standard Castagne Module. See the respective documentation for more info. | ||||
Modules-editor | res://castagne/modules/editor/CMEditor.gd | [Hidden, ReloadFull, Expert] | Expert | |
Standard Castagne Module. See the respective documentation for more info. | ||||
Modules-functions | res://castagne/modules/general/CMFunctions.gd | [Hidden, ReloadFull, Expert] | Expert | |
Standard Castagne Module. See the respective documentation for more info. | ||||
Modules-audio | res://castagne/modules/general/CMAudio.gd | [Hidden, ReloadFull, Expert] | Expert | |
Standard Castagne Module. See the respective documentation for more info. | ||||
Modules-attacks | res://castagne/modules/attacks/CMAttacks.gd | [Hidden, ReloadFull, Expert] | Expert | |
Standard Castagne Module. See the respective documentation for more info. | ||||
Modules-input | res://castagne/modules/general/CMInput.gd | [Hidden, ReloadFull, Expert] | Expert | |
Standard Castagne Module. See the respective documentation for more info. | ||||
Modules-menus | res://castagne/modules/general/CMMenus.gd | [Hidden, ReloadFull, Expert] | Expert | |
Standard Castagne Module. See the respective documentation for more info. | ||||
Modules-flow | flowfighting | [Hidden, ReloadFull, Expert] | Expert | |
Standard Castagne Module. See the respective documentation for more info. | ||||
Modules-flowgeneric | res://castagne/modules/flow/CMFlow.gd | [Hidden, ReloadFull, Expert] | Expert | |
Standard Castagne Module. See the respective documentation for more info. | ||||
Modules-flowfighting | res://castagne/modules/flow/CMFlowFighting.gd | [Hidden, ReloadFull, Expert] | Expert | |
Standard Castagne Module. See the respective documentation for more info. | ||||
Modules-flowuser | [Hidden, ReloadFull, Expert] | Expert | ||
Standard Castagne Module. See the respective documentation for more info. | ||||
Modules-physics | physics2d | [Hidden, ReloadFull, Expert] | Expert | |
Standard Castagne Module. See the respective documentation for more info. | ||||
Modules-physics2d | res://castagne/modules/physics/CMPhysics2D.gd | [Hidden, ReloadFull, Expert] | Expert | |
Standard Castagne Module. See the respective documentation for more info. | ||||
Modules-physicsuser | [Hidden, ReloadFull, Expert] | Expert | ||
Standard Castagne Module. See the respective documentation for more info. | ||||
Modules-graphics | graphics25d | [Hidden, ReloadFull, Expert] | Expert | |
Standard Castagne Module. See the respective documentation for more info. | ||||
Modules-graphics2d | res://castagne/modules/graphics/CMGraphics2D.gd | [Hidden, ReloadFull, Expert] | Expert | |
Standard Castagne Module. See the respective documentation for more info. | ||||
Modules-graphics25d | res://castagne/modules/graphics/CMGraphics2HalfD.gd | [Hidden, ReloadFull, Expert] | Expert | |
Standard Castagne Module. See the respective documentation for more info. | ||||
Modules-graphics3d | res://castagne/modules/graphics/CMGraphics3D.gd | [Hidden, ReloadFull, Expert] | Expert | |
Standard Castagne Module. See the respective documentation for more info. | ||||
Modules-graphicsuser | [Hidden, ReloadFull, Expert] | Expert | ||
Standard Castagne Module. See the respective documentation for more info. | ||||
Modules-user | [Hidden, ReloadFull, Expert] | Expert | ||
Standard Castagne Module. See the respective documentation for more info. | ||||
Modules-tmp | [Hidden, ReloadFull, Expert] | Expert | ||
Standard Castagne Module. See the respective documentation for more info. | ||||
Modules-castagne-standard | editor, functions, audio, attacks, input, menus, flowgeneric, flowfighting, physics2d, graphics2d, graphics25d, graphics3d | [Hidden, Advanced] | Advanced | |
List of the standard castagne modules, which are loaded automatically for documentation purposes |
Data relating to the CastagneStarter system, which may start the editor or game depending on how the project is launched.
Starter-Option | 0 | [Hidden, Advanced] | Advanced | |
---|---|---|---|---|
Remembers the option chosen in the starter. | ||||
Starter-Timer | 0 | [Intermediate] | Intermediate | |
Time before a choice is made automatically, can be stopped with any keyboard input. Set to zero to skip the timer, or -1 to disable the time limit. | ||||
Starter-P1 | 0 | [Hidden, Advanced] | Advanced | |
Obsolete | ||||
Starter-P2 | 0 | [Hidden, Advanced] | Advanced | |
Obsolete |