class
LevelScriptLoaderBinds an AngelScript script file to LevelHandler and executes the script.
Base classes
- class ScriptLoader
- Generic AngelScript script loader with
#include
and#pragma
directive support.
Constructors, destructors, conversion operators
- LevelScriptLoader(LevelHandler* levelHandler, StringView scriptPath)
Public functions
-
auto GetPlayers() const -> ArrayView<Actors::
Player*const> - Returns list of players.
-
auto GetPlayerBackingStore(Actors::
Player* player) -> jjPLAYER* - Returns script backing store for specified player.
-
auto GetPlayerBackingStore(std::
int32_t playerIndex) -> jjPLAYER* - void OnLevelLoad()
- Called when a level is loaded.
- void OnLevelBegin()
- Called when a level begins.
- void OnLevelReload()
- Called when a level reloads.
- void OnLevelUpdate(float timeMult)
- Called when a level updates (on the beginning of each frame)
-
void OnLevelCallback(Actors::
ActorBase* initiator, std:: uint8_t* eventParams) - Called when a level callback is triggered.
-
auto OnDraw(UI::
HUD* hud, Actors:: Player* player, const Rectf& view, DrawType type) -> bool - Called when a part of viewport or HUD is drawn.
-
void OnPlayerDied(Actors::
Player* player, Actors:: ActorBase* collider) - Called when a player dies.
Protected functions
- auto OnProcessInclude(StringView includePath, StringView scriptPath) -> String override
- Called when
#include
directive is encountered in a script file. - void OnProcessPragma(StringView content, ScriptContextType& contextType) override
- Called when
#pragma
directive is encountered in a script file.
Function documentation
jjPLAYER* Jazz2:: Scripting:: LevelScriptLoader:: GetPlayerBackingStore(std:: int32_t playerIndex)
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.