-
-
Notifications
You must be signed in to change notification settings - Fork 0
Cathode scripting overview
Matt Filer edited this page Feb 10, 2024
·
9 revisions
The Cathode Scripting system in Alien: Isolation is super cool, so lets break it down...
- The "COMMANDS.PAK" file holds all scripts for a level in the game, which in CathodeLib can load into (or be created via) a
Commands
class. - Scripts within
Commands
are objects calledComposite
s. These containEntity
types which perform our logic. - If you're familiar with Blueprint in Unreal Engine, the structure of
Composite
s should seem familiar. - There are four types of
Entity
which aComposite
can hold:-
FunctionEntity
- This executes a function. The function can either be hardcoded (which you can pick via the
FunctionType
enum when creating), or anotherComposite
within theCommands
object (which you can reference).
- This executes a function. The function can either be hardcoded (which you can pick via the
-
VariableEntity
- This acts as an instance of a variable, and can be accessed outside of the
Composite
as a parameter when its instanced as aFunctionEntity
.
- This acts as an instance of a variable, and can be accessed outside of the
-
ProxyEntity
- This acts as a proxy of an
Entity
in anotherComposite
instance from the level root. It's useful if you're scripting based on events that occur in otherComposite
script instances within the wider context of the level.
- This acts as a proxy of an
-
AliasEntity
- This acts as a reference to an
Entity
within a child of the currentComposite
. It can be used to override parameters within instanced composites, which can be useful to do things like change material properties or hide submeshes of reused models without creating a whole newComposite
.
- This acts as a reference to an
-
- All
Entity
types can containParameter
s, which supply them data. You instance data within aParameter
by giving it aParameterData
object, which can be either:-
cTransform
(a position and euler rotation) -
cInteger
(an integer) -
cString
(a string) -
cBool
(a boolean) -
cFloat
(a float) -
cEnum
(an enum, with an index value) -
cVector3
(a vector with X,Y,Z components - sometimes used for colour values) -
cResource
(a list of references to resources in the level) -
cSpline
(a spline, containing a list of cTransform objects for points along the spline)
-
-
Entity
objects can be linked, either to pass data between eachother, or to trigger events. For example, allEntity
objects have atrigger
parameter, which can be linked to in order to trigger them. -
Entity
objects can also reference resources within the game's level (via aresource
parameter which usescResource
type, or via a direct reference to theEntity
itself), such asRENDERABLE_INSTANCE
types, which reference an index in the level'sRenderableElements
(which can also be loaded using CathodeLib).
If you'd like to put all of this into action, check out "Creating your first Cathode script" to create an objective popup on level load from scratch!
You can also load existing COMMANDS.PAK files from the game & write handy scripts to change logic, or bulk edit things!