struct IEntityScriptProxy : public IEntityProxy { };
IEntityProxy.h
Script proxy interface.
virtual void CallEvent(const char * sEvent) = 0;
virtual void CallEvent(const char * sEvent, EntityId nEntityId) = 0;
virtual void CallEvent(const char * sEvent, const Vec3 & vValue) = 0;
virtual void CallEvent(const char * sEvent, bool bValue) = 0;
virtual void CallEvent(const char * sEvent, const char * sValue) = 0;
virtual void CallEvent(const char * sEvent, float fValue) = 0;
virtual void ChangeScript(IEntityScript* pScript, SEntitySpawnParams * params) = 0;
Parameters |
Description |
IEntityScript* pScript |
an entity script object that has already been loaded with the new script |
SEntitySpawnParams * params |
parameters used to set the properties table if required |
virtual IScriptTable* GetScriptTable() = 0;
virtual const char* GetState() = 0;
Retrieves name of the currently active entity script state. Return: Name of current state.
virtual int GetStateId() = 0;
Retrieves the id of the currently active entity script state. Return: Index of current state.
virtual bool GotoState(const char * sStateName) = 0;
Change current state of the entity script. Return: If state was successfully set.
virtual bool GotoStateId(int nStateId) = 0;
Change current state of the entity script. Return: If state was successfully set.
virtual bool IsInState(const char * sStateName) = 0;
Parameters |
Description |
const char * sStateName |
Name of state table within entity script (case sensetive). |
Return |
If entity script is in specified state. |
Check if entity is in specified state.
virtual void SendScriptEvent(int Event, IScriptTable * pParamters, bool * pRet = NULL) = 0;
Fires an event in the entity script. This will call OnEvent(id,param) Lua function in entity script, so that script can handle this event.
EScriptEventId, IScriptObject
virtual void SendScriptEvent(int Event, const char * str, bool * pRet = NULL) = 0;
virtual void SendScriptEvent(int Event, int nParam, bool * pRet = NULL) = 0;
virtual void SetScriptUpdateRate(float fUpdateEveryNSeconds) = 0;