3.4 KiB
Table of Contents
Entry Points
For backwards compatibility reasons and so as to not bloat the ZScript language itself, many interactions with the engine are not defined in ZScript. This section describes all ZScript interactions with the engine, both inside and outside of ZScript itself.
Actors
Actor classes can be replaced by the replaces
class flag, which during dynamic actor replacement will choose to spawn this class over its replaced actor, unless the replaced actor is later replaced again by another class. Dynamic actor replacement can also be overridden with an event handler's CheckReplacement
virtual function.
For example:
class MyActor : Actor replaces OtherActor {} // OtherActor will be dynamically replaced with MyActor
class MyOtherActor : Actor replaces OtherActor {} // OtherActor will now be replaced with MyOtherActor instead of MyActor
CVARINFO
Any CVars declared as a server CVar in CVARINFO
or by the engine will be accessible as a global variable in ZScript, which has a special type that can be implicitly cast to the type of the CVar. They cannot be set this way, only accessed.
DECALDEF
DECALDEF
can set the decal generator for a specific Actor
class with the generator
keyword. An actor can also define its generator and inherited classes' generators with the Decal
property.
DECORATE
TODO: lots of things to note here
LOCKDEFS
Key and lock groups in LOCKDEFS
are defined as groups of Inventory
or Key
descendants.
GLDEFS
Lights can be associated with Actor
classes and frames in GLDEFS
.
KEYCONF
TODO: this can be used for custom buttons
MAPINFO
In MAPINFO
, the GameInfo
block (referred to as MAPINFO
/GameInfo in this document) the following properties interact directly with ZScript:
EventHandlers
andAddEventHandlers
override or add to the list ofStaticEventHandler
orEventHandler
classes registered by the game (as opposed to event handlers registered per-map.)MessageBoxClass
sets theMessageBoxMenu
class to use for message boxes used by the engine's GUI.PlayerClasses
andAddPlayerClasses
override or add to the list ofPlayerPawn
classes the game provides.PrecacheClasses
will pre-cache all sprites used by anActor
class. Note that this also works forStateProvider
degenerates likeWeapon
.StatScreen_CoOp
sets theStatusScreen
class to use for co-op intermission screens.StatScreen_DM
sets theStatusScreen
class to use for Deathmatch intermission screens.StatScreen_Single
sets theStatusScreen
class to use for single-player intermission screens.StatusBarClass
sets the status bar class used by the game to the providedBaseStatusBar
class.WeaponSlot
sets the game's default weapon slots to the providedWeapon
classes.
TODO: there are other things here as well, like map event handlers
MENUDEF
TODO: this directly uses ZScript classes
TERRAIN
The SmallSplash
, SplashBase
and SplashChunk
properties of Splash
blocks use Actor
s.