Rigs of Rods 2026.01
Soft-body Physics Simulation
Loading...
Searching...
No Matches
ScriptEngine.h
Go to the documentation of this file.
1/*
2 This source file is part of Rigs of Rods
3 Copyright 2005-2012 Pierre-Michel Ricordel
4 Copyright 2007-2012 Thomas Fischer
5 Copyright 2013-2020 Petr Ohlidal
6
7 For more information, see http://www.rigsofrods.org/
8
9 Rigs of Rods is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License version 3, as
11 published by the Free Software Foundation.
12
13 Rigs of Rods is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with Rigs of Rods. If not, see <http://www.gnu.org/licenses/>.
20*/
21
25
26#pragma once
27
28#ifdef USE_ANGELSCRIPT
29
30#define DEFAULT_TERRAIN_SCRIPT "default.as" // Used when map creator doesn't provide custom script.
31
32#include "AngelScriptBindings.h"
33#include "Application.h"
34#include "GameContext.h"
35#include "GameScript.h"
37#include "ScriptEvents.h"
38
39#include <Ogre.h>
40#include "scriptdictionary/scriptdictionary.h"
41#include "scriptbuilder/scriptbuilder.h"
42
43#include <map>
44
45namespace RoR {
46
49
51inline void TRIGGER_EVENT_ASYNC(scriptEvents type, int arg1, int arg2ex = 0, int arg3ex = 0, int arg4ex = 0, std::string arg5ex = "", std::string arg6ex = "", std::string arg7ex = "", std::string arg8ex = "")
52{
53 ScriptEventArgs* args = new ScriptEventArgs{ type, arg1, arg2ex, arg3ex, arg4ex, arg5ex, arg6ex, arg7ex, arg8ex };
55}
56
59{
60 INVALID,
61 ACTOR,
62 TERRAIN,
63 GADGET,
64 AI_BOT,
65 CUSTOM
66};
67
69
72{
73 ScriptUnit();
75
78 unsigned int eventMask = 0;
79 AngelScript::asIScriptModule* scriptModule = nullptr;
80 AngelScript::asIScriptFunction* frameStepFunctionPtr = nullptr;
81 AngelScript::asIScriptFunction* eventCallbackFunctionPtr = nullptr;
82 AngelScript::asIScriptFunction* eventCallbackExFunctionPtr = nullptr;
83 AngelScript::asIScriptFunction* defaultEventCallbackFunctionPtr = nullptr;
85 int32_t associatedNetUid = -1;
87 Ogre::String scriptName;
88 Ogre::String scriptHash;
89 Ogre::String scriptBuffer;
90};
91
92typedef std::map<ScriptUnitID_t, ScriptUnit> ScriptUnitMap;
93
101
109
114
115// Params to `RoR::ScriptEngine::getFunctionByDeclAndLogCandidates()`
116const std::string GETFUNC_DEFAULTEVENTCALLBACK_SIGFMT = "void {}(int, string, string, int)";
117const std::string GETFUNC_DEFAULTEVENTCALLBACK_NAME = "defaultEventCallback";
118
121{
122 // Generic success - 0 by common convention.
123 SCRIPTRETCODE_SUCCESS = AngelScript::asSUCCESS, // = AngelScript::0
124
125 // AngelScript technical codes
126 SCRIPTRETCODE_AS_ERROR = AngelScript::asERROR, // = AngelScript::-1 etc...
127 SCRIPTRETCODE_AS_CONTEXT_ACTIVE = AngelScript::asCONTEXT_ACTIVE,
128 SCRIPTRETCODE_AS_CONTEXT_NOT_FINISHED = AngelScript::asCONTEXT_NOT_FINISHED,
129 SCRIPTRETCODE_AS_CONTEXT_NOT_PREPARED = AngelScript::asCONTEXT_NOT_PREPARED,
130 SCRIPTRETCODE_AS_INVALID_ARG = AngelScript::asINVALID_ARG,
131 SCRIPTRETCODE_AS_NO_FUNCTION = AngelScript::asNO_FUNCTION,
132 SCRIPTRETCODE_AS_NOT_SUPPORTED = AngelScript::asNOT_SUPPORTED,
133 SCRIPTRETCODE_AS_INVALID_NAME = AngelScript::asINVALID_NAME,
134 SCRIPTRETCODE_AS_NAME_TAKEN = AngelScript::asNAME_TAKEN,
135 SCRIPTRETCODE_AS_INVALID_DECLARATION = AngelScript::asINVALID_DECLARATION,
136 SCRIPTRETCODE_AS_INVALID_OBJECT = AngelScript::asINVALID_OBJECT,
137 SCRIPTRETCODE_AS_INVALID_TYPE = AngelScript::asINVALID_TYPE,
138 SCRIPTRETCODE_AS_ALREADY_REGISTERED = AngelScript::asALREADY_REGISTERED,
139 SCRIPTRETCODE_AS_MULTIPLE_FUNCTIONS = AngelScript::asMULTIPLE_FUNCTIONS,
140 SCRIPTRETCODE_AS_NO_MODULE = AngelScript::asNO_MODULE,
141 SCRIPTRETCODE_AS_NO_GLOBAL_VAR = AngelScript::asNO_GLOBAL_VAR,
142 SCRIPTRETCODE_AS_INVALID_CONFIGURATION = AngelScript::asINVALID_CONFIGURATION,
143 SCRIPTRETCODE_AS_INVALID_INTERFACE = AngelScript::asINVALID_INTERFACE,
144 SCRIPTRETCODE_AS_CANT_BIND_ALL_FUNCTIONS = AngelScript::asCANT_BIND_ALL_FUNCTIONS,
145 SCRIPTRETCODE_AS_LOWER_ARRAY_DIMENSION_NOT_REGISTERED = AngelScript::asLOWER_ARRAY_DIMENSION_NOT_REGISTERED,
146 SCRIPTRETCODE_AS_WRONG_CONFIG_GROUP = AngelScript::asWRONG_CONFIG_GROUP,
147 SCRIPTRETCODE_AS_CONFIG_GROUP_IS_IN_USE = AngelScript::asCONFIG_GROUP_IS_IN_USE,
148 SCRIPTRETCODE_AS_ILLEGAL_BEHAVIOUR_FOR_TYPE = AngelScript::asILLEGAL_BEHAVIOUR_FOR_TYPE,
149 SCRIPTRETCODE_AS_WRONG_CALLING_CONV = AngelScript::asWRONG_CALLING_CONV,
150 SCRIPTRETCODE_AS_BUILD_IN_PROGRESS = AngelScript::asBUILD_IN_PROGRESS,
151 SCRIPTRETCODE_AS_INIT_GLOBAL_VARS_FAILED = AngelScript::asINIT_GLOBAL_VARS_FAILED,
152 SCRIPTRETCODE_AS_OUT_OF_MEMORY = AngelScript::asOUT_OF_MEMORY,
153 SCRIPTRETCODE_AS_MODULE_IS_IN_USE = AngelScript::asMODULE_IS_IN_USE,
154
155 // RoR ScriptEngine return codes
156 // Following is analysis of former state (most but not all funcs returned 0 on success)
157 // ~ executeString() [script: not exported] - used to return 0 on success, 1 on internal error and negative number otherwise.
158 // ~ addFunction() [script: `game.addScriptFunction()`] - used to return 0 on success, 1 on internal error and negative number otherwise.
159 // ~ functionExists() [script: `game.scriptFunctionExists()`] - used to return function ID (always >0) on success, negative number on error.
160 // ~ deleteFunction() [script: `game.deleteScriptFunction()`] - used to return function ID (always >0) on success, negative number on error.
161 // ~ addVariable() [script: `game.addScriptVariable()` ] - used to return 0 on success, 1 on internal error and negative number otherwise.
162 // ~ variableExists() [script: `game.scriptVariableExists()`] - newly added, returns 0 on success and negative number otherwise.
163 // ~ deleteVariable() [script: `game.deleteScriptVariable()` ] - used to return 0 on success, 1 on internal error and negative number otherwise.
164 // ~ getVariable() [script: `game.getScriptVariable()` ] - recently added, returns 0 on success and negative number otherwise.
168 SCRIPTRETCODE_SCRIPTUNIT_NOT_EXISTS = -1004, // The scpecified ScriptUnitID_t was invalid
171};
172
177class ScriptEngine : public Ogre::LogListener
178{
179 friend class GameScript;
180
181public:
182
183 ScriptEngine();
185
195 ScriptUnitID_t loadScript(Ogre::String filename, ScriptCategory category = ScriptCategory::TERRAIN,
196 ActorPtr associatedActor = nullptr, int32_t associatedNetUid = -1, std::string buffer = "");
197
202 void unloadScript(ScriptUnitID_t unique_id);
203
207 void unloadBotByUid(int32_t bot_net_uid);
208
213 void framestep(Ogre::Real dt);
214
215 void setForwardScriptLogToConsole(bool doForward);
216
221 void triggerEvent(scriptEvents eventnum, int arg1=0, int arg2ex=0, int arg3ex=0, int arg4ex=0, std::string arg5ex="", std::string arg6ex="", std::string arg7ex="", std::string arg8ex="");
222
223 void setEventsEnabled(bool val) { m_events_enabled = val; }
224
229 ScriptRetCode_t executeString(Ogre::String command);
230
237 void queueStringForExecution(const Ogre::String command);
238
244 ScriptRetCode_t addFunction(const Ogre::String& arg, const ScriptUnitID_t nid = SCRIPTUNITID_DEFAULT);
245
250 ScriptRetCode_t functionExists(const Ogre::String& arg, const ScriptUnitID_t nid = SCRIPTUNITID_DEFAULT);
251
256 ScriptRetCode_t deleteFunction(const Ogre::String& arg, const ScriptUnitID_t nid = SCRIPTUNITID_DEFAULT);
257
262 ScriptRetCode_t addVariable(const Ogre::String& arg, const ScriptUnitID_t nid = SCRIPTUNITID_DEFAULT);
263
268 ScriptRetCode_t variableExists(const Ogre::String& arg, const ScriptUnitID_t nid = SCRIPTUNITID_DEFAULT);
269
274 ScriptRetCode_t deleteVariable(const Ogre::String& arg, const ScriptUnitID_t nid = SCRIPTUNITID_DEFAULT);
275
279 ScriptRetCode_t getVariable(const Ogre::String& varName, void *ref, int typeID, ScriptUnitID_t nid = SCRIPTUNITID_DEFAULT);
280
285 AngelScript::asIScriptFunction* getFunctionByDeclAndLogCandidates(ScriptUnitID_t nid, GetFuncFlags_t flags, const std::string& funcName, const std::string& fmtFuncDecl);
286
287 int fireEvent(std::string instanceName, float intensity);
288
289 void envokeCallback(int functionId, eventsource_t* source, NodeNum_t nodenum = NODENUM_INVALID, int type = 0);
290
297 void forwardExceptionAsScriptEvent(const std::string& from);
298
299 AngelScript::asIScriptEngine* getEngine() { return engine; };
300
301 // method from Ogre::LogListener
302 void messageLogged(const Ogre::String& message, Ogre::LogMessageLevel lml, bool maskDebug, const Ogre::String& logName, bool& skipThisMessage);
303
304 inline void SLOG(const char* msg) { this->scriptLog->logMessage(msg); }
305 inline void SLOG(std::string msg) { this->scriptLog->logMessage(msg); }
306
307 bool scriptUnitExists(ScriptUnitID_t unique_id);
311 ScriptUnitMap const& getScriptUnits() const { return m_script_units; }
312
313protected:
314
317
321 void init();
322
326 Ogre::String composeModuleName(Ogre::String const& scriptName, ScriptCategory origin, ScriptUnitID_t id);
327
332 int setupScriptUnit(int unit_id);
333
338 bool prepareContextAndHandleErrors(ScriptUnitID_t nid, int asFunctionID);
339
345
350 ScriptRetCode_t validateScriptModule(const ScriptUnitID_t nid, AngelScript::asIScriptModule*& out_mod);
351
353
356
360 void msgCallback(const AngelScript::asSMessageInfo* msg);
361
366 void lineCallback(AngelScript::asIScriptContext* ctx);
367
372 void exceptionCallback(AngelScript::asIScriptContext* ctx);
373
375
376 AngelScript::asIScriptEngine* engine;
377 AngelScript::asIScriptContext* context;
378 Ogre::Log* scriptLog;
384 bool m_events_enabled = true;
385
387};
388
390
391} // namespace RoR
392
393#else // USE_ANGELSCRIPT
394inline void TRIGGER_EVENT_ASYNC(scriptEvents type, int arg1, int arg2ex = 0, int arg3ex = 0, int arg4ex = 0, std::string arg5ex = "", std::string arg6ex = "", std::string arg7ex = "", std::string arg8ex = "")
395{
396}
397#endif // USE_ANGELSCRIPT
Central state/object manager and communications hub.
#define BITMASK(OFFSET)
Definition BitFlags.h:10
uint32_t BitMask_t
Definition BitFlags.h:7
Game state manager and message-queue provider.
this class is a helper to exchange data in a class between different threads, it can be pushed and pu...
void PushMessage(Message m)
Doesn't guarantee order! Use ChainMessage() if order matters.
Proxy class that can be called by script functions.
Definition GameScript.h:42
This class represents the angelscript scripting interface.
ScriptUnit & getScriptUnit(ScriptUnitID_t unique_id)
ScriptUnitID_t getTerrainScriptUnit() const
ScriptRetCode_t variableExists(const Ogre::String &arg, const ScriptUnitID_t nid=SCRIPTUNITID_DEFAULT)
Adds a global variable to the script.
ScriptUnitID_t m_terrain_script_unit
void exceptionCallback(AngelScript::asIScriptContext *ctx)
Optional callback invoked when the script critically fails, allowing debugging.
bool m_events_enabled
Hack to enable fast shutdown without cleanup.
ScriptRetCode_t deleteVariable(const Ogre::String &arg, const ScriptUnitID_t nid=SCRIPTUNITID_DEFAULT)
Deletes a global variable from the script.
void forwardExceptionAsScriptEvent(const std::string &from)
Forwards useful info from C++ try{}catch{} exceptions to script in the form of game event.
ScriptRetCode_t addVariable(const Ogre::String &arg, const ScriptUnitID_t nid=SCRIPTUNITID_DEFAULT)
Adds a global variable to the script.
scriptEvents m_currently_executing_event_trigger
GameScript m_game_script
ScriptUnitMap m_script_units
void setEventsEnabled(bool val)
int setupScriptUnit(int unit_id)
Helper for loadScript(), does the actual building without worry about unit management.
AngelScript::asIScriptEngine * engine
instance of the scripting engine
bool scriptUnitExists(ScriptUnitID_t unique_id)
Ogre::Log * scriptLog
int fireEvent(std::string instanceName, float intensity)
ScriptRetCode_t deleteFunction(const Ogre::String &arg, const ScriptUnitID_t nid=SCRIPTUNITID_DEFAULT)
Deletes a global function from the script.
int executeContextAndHandleErrors(ScriptUnitID_t nid)
Helper for executing any script function/snippet; registers Line/Exception callbacks (on demand) and ...
InterThreadStoreVector< Ogre::String > stringExecutionQueue
The string execution queue.
ScriptUnitMap const & getScriptUnits() const
void unloadBotByUid(int32_t bot_net_uid)
Helper for ServerScriptEngine - requests unloading the AI_BOT script.
void msgCallback(const AngelScript::asSMessageInfo *msg)
Optional (but very recommended!) callback providing diagnostic info when things fail to start (most n...
void SLOG(const char *msg)
Replacement of macro.
ScriptRetCode_t getVariable(const Ogre::String &varName, void *ref, int typeID, ScriptUnitID_t nid=SCRIPTUNITID_DEFAULT)
Retrieves a global variable from any running script.
ScriptUnitID_t loadScript(Ogre::String filename, ScriptCategory category=ScriptCategory::TERRAIN, ActorPtr associatedActor=nullptr, int32_t associatedNetUid=-1, std::string buffer="")
Loads a script.
ScriptRetCode_t addFunction(const Ogre::String &arg, const ScriptUnitID_t nid=SCRIPTUNITID_DEFAULT)
Adds a global function to the script.
ScriptUnitID_t getCurrentlyExecutingScriptUnit() const
ScriptRetCode_t executeString(Ogre::String command)
executes a string (useful for the console)
ScriptRetCode_t validateScriptModule(const ScriptUnitID_t nid, AngelScript::asIScriptModule *&out_mod)
Helper for all manipulations with functions/variables; ensures the script unit exists and is fully se...
AngelScript::asIScriptContext * context
context in which all scripting happens
void queueStringForExecution(const Ogre::String command)
Queues a string for execution.
void envokeCallback(int functionId, eventsource_t *source, NodeNum_t nodenum=NODENUM_INVALID, int type=0)
void messageLogged(const Ogre::String &message, Ogre::LogMessageLevel lml, bool maskDebug, const Ogre::String &logName, bool &skipThisMessage)
ScriptUnitID_t m_currently_executing_script_unit
AngelScript::asIScriptFunction * getFunctionByDeclAndLogCandidates(ScriptUnitID_t nid, GetFuncFlags_t flags, const std::string &funcName, const std::string &fmtFuncDecl)
Finds a function by full declaration, and if not found, finds candidates by name and logs them to Ang...
void lineCallback(AngelScript::asIScriptContext *ctx)
Optional callback which receives diagnostic info for every executed statement.
Ogre::String composeModuleName(Ogre::String const &scriptName, ScriptCategory origin, ScriptUnitID_t id)
Packs name + important info to one string, for logging and reporting purposes.
ScriptRetCode_t functionExists(const Ogre::String &arg, const ScriptUnitID_t nid=SCRIPTUNITID_DEFAULT)
Checks if a global function exists.
AngelScript::asIScriptEngine * getEngine()
bool prepareContextAndHandleErrors(ScriptUnitID_t nid, int asFunctionID)
Helper for executing any script function/snippet; does asIScriptContext::Prepare() and reports any er...
void setForwardScriptLogToConsole(bool doForward)
void init()
This function initialzies the engine and registeres all types.
void framestep(Ogre::Real dt)
Calls the script's framestep function to be able to use timed things inside the script.
void triggerEvent(scriptEvents eventnum, int arg1=0, int arg2ex=0, int arg3ex=0, int arg4ex=0, std::string arg5ex="", std::string arg6ex="", std::string arg7ex="", std::string arg8ex="")
triggers an event; Not to be used by the end-user.
void unloadScript(ScriptUnitID_t unique_id)
Unloads a script.
void SLOG(std::string msg)
Replacement of macro.
@ MSG_SIM_SCRIPT_EVENT_TRIGGERED
Payload = RoR::ScriptEventArgs* (owner)
ScriptCategory
Note: Either of these can be loaded from script using game.pushMessage(MSG_APP_LOAD_SCRIPT_REQUESTED....
const std::string GETFUNC_DEFAULTEVENTCALLBACK_NAME
ScriptRetCode
Common return codes for script manipulation funcs (add/get/delete | funcs/variables)
BitMask_t GetFuncFlags_t
Flags for RoR::ScriptEngine::getFunctionByDeclAndLogCandidates()
void TRIGGER_EVENT_ASYNC(scriptEvents type, int arg1, int arg2ex=0, int arg3ex=0, int arg4ex=0, std::string arg5ex="", std::string arg6ex="", std::string arg7ex="", std::string arg8ex="")
Asynchronously (via MSG_SIM_SCRIPT_EVENT_TRIGGERED) invoke script function eventCallbackEx(),...
std::map< ScriptUnitID_t, ScriptUnit > ScriptUnitMap
const GetFuncFlags_t GETFUNCFLAG_OPTIONAL
Only logs warning if candidate is found, to help modder find a typo.
const std::string GETFUNC_DEFAULTEVENTCALLBACK_SIGFMT
const GetFuncFlags_t GETFUNCFLAG_REQUIRED
Always logs warning that function was not found.
const GetFuncFlags_t GETFUNCFLAG_SILENT
Never logs.
const char * ScriptCategoryToString(ScriptCategory c)
@ CUSTOM
Loaded by user via either: A) ingame console 'loadscript'; B) RoR.cfg 'app_custom_scripts'; C) comman...
@ AI_BOT
Only valid under MpState::LOCAL_SCRIPT; registers as RoRnet user in the server script (i....
@ GADGET
Associated with a .gadget mod file, launched via UI or any method given below for CUSTOM scripts (use...
@ TERRAIN
Defined in terrn2 file under '[Scripts]', receives terrain eventbox notifications.
@ ACTOR
Defined in truck file under 'scripts', contains global variable BeamClass@ thisActor.
@ SCRIPTRETCODE_SUCCESS
@ SCRIPTRETCODE_AS_CONTEXT_ACTIVE
@ SCRIPTRETCODE_AS_INVALID_TYPE
@ SCRIPTRETCODE_AS_CANT_BIND_ALL_FUNCTIONS
@ SCRIPTRETCODE_AS_MODULE_IS_IN_USE
@ SCRIPTRETCODE_AS_INVALID_NAME
@ SCRIPTRETCODE_AS_ERROR
@ SCRIPTRETCODE_AS_NAME_TAKEN
@ SCRIPTRETCODE_ENGINE_NOT_CREATED
@ SCRIPTRETCODE_AS_WRONG_CALLING_CONV
@ SCRIPTRETCODE_AS_ILLEGAL_BEHAVIOUR_FOR_TYPE
@ SCRIPTRETCODE_SCRIPTUNIT_NOT_EXISTS
@ SCRIPTRETCODE_AS_LOWER_ARRAY_DIMENSION_NOT_REGISTERED
@ SCRIPTRETCODE_AS_OUT_OF_MEMORY
@ SCRIPTRETCODE_UNSPECIFIED_ERROR
@ SCRIPTRETCODE_AS_NO_GLOBAL_VAR
@ SCRIPTRETCODE_AS_INVALID_ARG
@ SCRIPTRETCODE_AS_NO_FUNCTION
@ SCRIPTRETCODE_AS_MULTIPLE_FUNCTIONS
@ SCRIPTRETCODE_AS_BUILD_IN_PROGRESS
@ SCRIPTRETCODE_AS_NO_MODULE
@ SCRIPTRETCODE_AS_WRONG_CONFIG_GROUP
@ SCRIPTRETCODE_AS_CONTEXT_NOT_FINISHED
@ SCRIPTRETCODE_AS_INVALID_INTERFACE
@ SCRIPTRETCODE_AS_CONTEXT_NOT_PREPARED
@ SCRIPTRETCODE_CONTEXT_NOT_CREATED
@ SCRIPTRETCODE_AS_INVALID_DECLARATION
@ SCRIPTRETCODE_AS_INVALID_CONFIGURATION
@ SCRIPTRETCODE_AS_NOT_SUPPORTED
@ SCRIPTRETCODE_AS_ALREADY_REGISTERED
@ SCRIPTRETCODE_AS_INVALID_OBJECT
@ SCRIPTRETCODE_AS_CONFIG_GROUP_IS_IN_USE
@ SCRIPTRETCODE_AS_INIT_GLOBAL_VARS_FAILED
@ SCRIPTRETCODE_SCRIPTUNIT_NO_MODULE
@ SCRIPTRETCODE_FUNCTION_NOT_EXISTS
GameContext * GetGameContext()
static const NodeNum_t NODENUM_INVALID
int ActorInstanceID_t
Unique sequentially generated ID of an actor in session. Use ActorManager::GetActorById()
int ScriptRetCode_t
see enum RoR::ScriptRetCode - combines AngelScript codes and RoR internal codes.
int ScriptUnitID_t
Unique sequentially generated ID of a loaded and running scriptin session. Use ScriptEngine::getScrip...
static const ActorInstanceID_t ACTORINSTANCEID_INVALID
static const ScriptUnitID_t SCRIPTUNITID_INVALID
scriptEvents
This enum describes what events are existing. The script can register to receive events.
@ SE_NO_EVENTS
uint16_t NodeNum_t
Node position within Actor::ar_nodes; use RoR::NODENUM_INVALID as empty value.
static const ScriptUnitID_t SCRIPTUNITID_DEFAULT
The script defined in .terrn2 [Scripts], or 'default.as' ~ classic behavior.
std::string lsr_filename
Load from resource ('.as' file or '.gadget' file); If buffer is supplied, use this as display name on...
ScriptCategory lsr_category
std::string lsr_buffer
Load from memory buffer.
ActorInstanceID_t lsr_associated_actor
For ScriptCategory::ACTOR.
Unified game event system - all requests and state changes are reported using a message.
Definition GameContext.h:52
eventsource_t * eventsource
ScriptCallbackArgs(eventsource_t *evs, NodeNum_t nd)
Args for eventCallbackEx() queued via MSG_SIM_SCRIPT_EVENT_TRIGGERED See descriptions at enum RoR::sc...
Represents a loaded script and all associated resources/handles.
CacheEntryPtr originatingGadget
For ScriptCategory::GADGET ~ determines resource group.
int32_t associatedNetUid
For ScriptCategory::AI_BOT ~ used to identify the bot in the server script.
ScriptCategory scriptCategory
AngelScript::asIScriptFunction * frameStepFunctionPtr
script function pointer to the frameStep function
unsigned int eventMask
filter mask for script events
Ogre::String scriptHash
Ogre::String scriptBuffer
AngelScript::asIScriptFunction * defaultEventCallbackFunctionPtr
script function pointer for spawner events
Ogre::String scriptName
Name of the '.as' file exclusively.
AngelScript::asIScriptFunction * eventCallbackFunctionPtr
script function pointer to the event callback function
AngelScript::asIScriptModule * scriptModule
AngelScript::asIScriptFunction * eventCallbackExFunctionPtr
script function pointer to the event callback function
ActorPtr associatedActor
For ScriptCategory::ACTOR.
ScriptUnitID_t uniqueId
< Scripting
Definition Collisions.h:41