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] | [AllPhases, Init, Action, Reaction, Manual] |
---|---|---|
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] | [AllPhases, Init, Action, Reaction, Manual] |
Unsets a flag, if it was set earlier.
| ||
FlagNext | [1] | [AllPhases, Init, Action, Reaction, Manual] |
Raises a flag at the beginning of the next frame.
| ||
UnflagNext | [1] | [AllPhases, Init, Action, Reaction, Manual] |
Unsets a flag for the next frame, if it was set earlier with FlagNext.
| ||
Set | [2] | [Init, Action, Manual] |
Sets a variable to a given integer 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] |
---|---|---|
Adds two numbers and stores it in the first variable or an optional third variable.
| ||
Sub | [2, 3] | [Init, Action, Manual] |
Substracts two numbers and stores it in the first variable or an optional third variable.
| ||
Mul | [2, 3] | [Init, Action, Manual] |
Multiplies two numbers and stores it in the first variable or an optional third variable.
| ||
Div | [2, 3] | [Init, Action, Manual] |
Divides two numbers and stores it in the first variable or an optional third variable.
| ||
Mod | [2, 3] | [Init, Action, Manual] |
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] |
Stores the bigger of the two numbers in the first variable or an optional third variable.
| ||
Min | [2, 3] | [Init, Action, Manual] |
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.
CreateEntity | [1] | [Init, Action, Manual] |
---|---|---|
Creates a new entity at the beginning of the next frame, using the given entity name, and targets it.
| ||
DestroyEntity | [0] | [Init, Action, Manual] |
Deletes the currently targetted entity at the beginning of the next frame. | ||
GetCurrentEntityID | [1] | [Init, Action, Manual] |
Write the current entity ID to a variable.
| ||
GetTargetEntityID | [1] | [Init, Action, Manual] |
Write the target entity ID to a variable.
| ||
TargetEntityByID | [1] | [Init, Action, Manual] |
Targets an entity using its ID
| ||
TargetEntityCurrent | [0] | [Init, Action, Manual] |
Targets the current entity (autotargetting). | ||
CopyFromTarget | [1, 2] | [Init, Action, Manual] |
Copies a variable from the target entity. This will however copy the variable value from the end of the last frame.
| ||
CopyToTarget | [1, 2] | [Init, Action, Manual] |
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] |
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] |
Sets a variable in the target entity. This will be applied at the end of the phase, or at initialization for new entities.
|
_CopyToBuffer | [] | [] |
---|---|---|
Global buffer to hold the variables entities set to each other. |
Holds functions and variables pertaining to the states themselves. Handles transitions, and state calls.
Transition | [0, 1, 2, 3] | [Init, Reaction, Manual] |
---|---|---|
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] |
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] |
Executes another script/state.
| ||
CallParent | [1] | [Init, Action, Reaction, Freeze, Manual] |
Execute another script/state on the parent skeleton.
| ||
ExecuteAfter | [0, 1] | [Init, Action, Reaction, Freeze, Manual] |
Schedules a call to be executed after the current one has been done.
These will be executed only once - ExecuteAfter calls inside an ExecuteAfter are ignored.
Giving no arguments will cancel existing calls, if done before the end.
|
_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 | [ResetEachFrame] |
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. | ||
_CallParentLevel | 0 | [ResetEachFrame] |
Helper variable for which level the CallParent function shall call to. | ||
_ExecuteAfterCalls | [] | [ResetEachFrame] |
Hold the list of states that will be called after the main state, filled by ExecuteAfter() |
Functions that help understanding what happens inside the code.
Log | [1] | [Init, Action, Manual] |
---|---|---|
Writes a log to the console output.
| ||
LogT | [1] | [Reaction, Manual] |
Writes a log to the console output during the Reaction phase only.
| ||
LogB | [1] | [Init, Action, Reaction, Manual] |
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] |
---|---|---|
Sets an amount of freeze frames to be effective immediately. Uses the max of the remaining frames and current frames.
|
Configuration related to the game itself, including Characters and Stages.
GameTitle | Untitled Castagne Game | [] | |
---|---|---|---|
The name of the game. | |||
GameVersion | Unspecified Version | [] | |
The version of the game, can be used to differenciate patches. | |||
CharacterPaths | res://castagne/example/fighter/Castagneur.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/example/stage/Stage.tscn | [] | |
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] | |
---|---|---|---|
Internal version of the Castagne engine. | |||
PathEngine | res://castagne/engine/CastagneEngine.tscn | [Advanced] | |
Filepath to the engine scene. | |||
PathEditor | res://castagne/editor/CastagneEditor.tscn | [Advanced] | |
Filepath to the editor scene. | |||
PathDevTools | res://castagne/devtools/DevTools.tscn | [Advanced] | |
Filepath to the devtools scene. | |||
PathMainMenu | res://castagne/menus/mainmenu/DefaultMainMenu.tscn | [Advanced] | |
Filepath to the main menu scene. | |||
PathCharacterSelect | res://castagne/menus/characterselect/DefaultCharacterSelect.tscn | [Advanced] | |
Filepath to the character select screen scene. | |||
PathPostBattle | res://castagne/menus/postbattle/DefaultPostBattle.tscn | [Advanced] | |
Filepath to the post battle scene. | |||
ConfigSkeleton | [ReloadFull, 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. | ||
_CurrentEntityID | 0 | [] |
Remembers the next ID for a new entity. | ||
_EntitiesToInit | [] | [] |
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. | ||
_NbPlayers | 0 | [] |
Remembers the amount of players. |
Configurations relating to the module system of Castagne.
Modules | coreset, physics, graphics, flow, user | [Hidden, ReloadFull] | |
---|---|---|---|
List of modules to load for matches. | |||
Modules-coreset | editor, functions, attacks, sound, input, menus, tmp | [Hidden, ReloadFull] | |
Standard Castagne Module. See the respective documentation for more info. | |||
Modules-editor | res://castagne/modules/castagne/CMEditor.gd | [Hidden, ReloadFull] | |
Standard Castagne Module. See the respective documentation for more info. | |||
Modules-functions | res://castagne/modules/coreset/CMFunctions.gd | [Hidden, ReloadFull] | |
Standard Castagne Module. See the respective documentation for more info. | |||
Modules-sound | res://castagne/modules/coreset/CMSound.gd | [Hidden, ReloadFull] | |
Standard Castagne Module. See the respective documentation for more info. | |||
Modules-attacks | res://castagne/modules/coreset/CMAttacks.gd | [Hidden, ReloadFull] | |
Standard Castagne Module. See the respective documentation for more info. | |||
Modules-input | res://castagne/modules/coreset/CMInput.gd | [Hidden, ReloadFull] | |
Standard Castagne Module. See the respective documentation for more info. | |||
Modules-menus | res://castagne/modules/coreset/CMMenus.gd | [Hidden, ReloadFull] | |
Standard Castagne Module. See the respective documentation for more info. | |||
Modules-flow | flowfighting | [Hidden, ReloadFull] | |
Standard Castagne Module. See the respective documentation for more info. | |||
Modules-flowgeneric | res://castagne/modules/flow/CMFlow.gd | [Hidden, ReloadFull] | |
Standard Castagne Module. See the respective documentation for more info. | |||
Modules-flowfighting | res://castagne/modules/flow/CMFlowFighting.gd | [Hidden, ReloadFull] | |
Standard Castagne Module. See the respective documentation for more info. | |||
Modules-flowuser | [Hidden, ReloadFull] | ||
Standard Castagne Module. See the respective documentation for more info. | |||
Modules-physics | physics2d | [Hidden, ReloadFull] | |
Standard Castagne Module. See the respective documentation for more info. | |||
Modules-physics2d | res://castagne/modules/physics/CMPhysics2D.gd | [Hidden, ReloadFull] | |
Standard Castagne Module. See the respective documentation for more info. | |||
Modules-physicsuser | [Hidden, ReloadFull] | ||
Standard Castagne Module. See the respective documentation for more info. | |||
Modules-graphics | graphics25d | [Hidden, ReloadFull] | |
Standard Castagne Module. See the respective documentation for more info. | |||
Modules-graphics2d | res://castagne/modules/graphics/CMGraphics2D.gd | [Hidden, ReloadFull] | |
Standard Castagne Module. See the respective documentation for more info. | |||
Modules-graphics25d | res://castagne/modules/graphics/CMGraphics2HalfD.gd | [Hidden, ReloadFull] | |
Standard Castagne Module. See the respective documentation for more info. | |||
Modules-graphics3d | res://castagne/modules/graphics/CMGraphics3D.gd | [Hidden, ReloadFull] | |
Standard Castagne Module. See the respective documentation for more info. | |||
Modules-graphicsuser | [Hidden, ReloadFull] | ||
Standard Castagne Module. See the respective documentation for more info. | |||
Modules-user | [Hidden, ReloadFull] | ||
Standard Castagne Module. See the respective documentation for more info. | |||
Modules-tmp | ui | [Hidden, ReloadFull] | |
Standard Castagne Module. See the respective documentation for more info. | |||
Modules-ui | res://castagne/modules/ui/FightingUI.tscn | [Hidden, ReloadFull] | |
Standard Castagne Module. See the respective documentation for more info. | |||
Modules-castagne-standard | editor, functions, sound, attacks, input, menus, flowgeneric, flowfighting, physics2d, graphics2d, graphics25d, graphics3d, ui | [Hidden] | |
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] | |
---|---|---|---|
Remembers the option chosen in the starter. | |||
Starter-Timer | 0 | [] | |
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] | |
Obsolete | |||
Starter-P2 | 0 | [Hidden] | |
Obsolete |