124 return GetCollisionRadius();
141 if (
ins.GetObject() ==
object)
156 if (
ins.GetObject() ==
object)
255 obj.OnEnterTrigger(
this);
257#ifdef TRIGGER_DEBUG_NORMAL
266 insider.
GetObject().OnLeaveTrigger(
this);
268#ifdef TRIGGER_DEBUG_NORMAL
285 if (
ins.GetObject() ==
object)
319#ifdef TRIGGER_DEBUG_BASIC
357 case ERPCs.DIAG_TRIGGER_DEBUG:
374 data.param1 = GetWorldPosition();
378 data.param5 = GetCollisionRadius();
418 case "BarbedWireHit":
proto native void SetCollisionBox(vector mins, vector maxs)
Sets collision box for object.
proto native TriggerShape GetTriggerShape()
Get the current TriggerShape.
Super root of all classes in Enforce script.
static Shape DrawCylinder(vector pos, float radius, float height=1, int color=0x1fff7f7f, ShapeFlags flags=ShapeFlags.TRANSP|ShapeFlags.NOOUTLINE)
static Shape DrawSphere(vector pos, float size=1, int color=0x1fff7f7f, ShapeFlags flags=ShapeFlags.TRANSP|ShapeFlags.NOOUTLINE)
static Shape DrawArrow(vector from, vector to, float size=0.5, int color=0xFFFFFFFF, int flags=0)
static void TriggerLog(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
static Shape DrawBoxEx(vector pos1, vector pos2, int color=0x1fff7f7f, ShapeFlags flags=ShapeFlags.TRANSP|ShapeFlags.NOZWRITE)
The class that will be instanced (moddable)
Serialization general interface. Serializer API works with:
void Enter(TriggerInsider insider)
void Leave(TriggerInsider insider)
void StayStart(int nrOfInsiders)
void Stay(TriggerInsider insider, float deltaTime)
override void OnLeave(Object obj)
override void OnEnter(Object obj)
TriggerInsider CreateInsider(Object obj)
Used for easily overriding TriggerInsider creation without rewriting AddInsider.
override void EOnInit(IEntity other, int extra)
Set the default extents of the Trigger only once it is properly initialized.
void RemoveInsider(TriggerInsider insider, int index=-1)
Removing of TriggerInsider.
void OnLeaveBeginEvent(TriggerInsider insider)
override void EOnEnter(IEntity other, int extra)
When an Object enters the trigger add it to Insiders.
override void EOnFrame(IEntity other, float timeSlice)
When an Object touches the Trigger, we want to register it being inside the Trigger -> Replaced by EO...
TriggerInsider GetInsiderForObject(Object object)
Gets the TriggerInsider for the Object if it exists.
bool ShouldRemoveInsider(TriggerInsider insider)
Condition whether a TriggerInsider should still be updated or not (checked in update loop and before ...
ref array< ref TriggerInsider > m_insiders
The objects and their metadata which are currently inside the Trigger.
void SetExtents(vector mins, vector maxs)
Set the size of the Trigger, avoid using SetCollisionBox directly.
void UpdateInsiders(int timeout)
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
bool CanAddObjectAsInsider(Object object)
Condition whether an Object can be added as TriggerInsider (checked before calling AddInsider)
void OnEnterBeginEvent(TriggerInsider insider)
void RemoveInsiderByObject(Object object)
Removing of TriggerInsider through Object.
void AddInsider(Object obj)
Adding of new TriggerInsider.
array< ref TriggerInsider > GetInsiders()
Get the current TriggerInsider array, left for backwards compatibility, moved down from ManTrigger.
float GetRadius(vector min, vector max)
Get the radius of the CollisionBox, simply left for backwards compatibility.
bool ShouldRemoveInsiderNoLeave(TriggerInsider insider)
Condition whether a TriggerInsider should still be updated or not, skips OnLeaveEvent (checked in upd...
int GetInsiderIndexForObject(Object object)
Gets the index in m_insiders for the Object.
override void EOnLeave(IEntity other, int extra)
When an Object exits the trigger remove it from Insiders.
const int TIMEOUT
DEPRECATED.
The object which is in a trigger and its metadata.
int timeStamp
Last time the object was seen in ms.
Object m_Object
Object that data belongs to.
float lastUpdated
Last time the object was updated in seconds, is used for calculating deltaTime.
float timeEntered
Time the object was first seen in seconds.
void TriggerInsider(Object obj)
override string GetDebugName()
proto native CGame GetGame()
void Error(string err)
Messagebox with error message.
proto native void SetFlags(ShapeFlags flags)
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
EntityEvent
Entity events for event-mask, or throwing event from code.