1[
EntityEditorProps(
category:
"GameScripted/GameMode/CaptureAndHold", description:
"This area trigger detects enemies not belonging to assigned faction, and raises callbacks which allow penalizing abusive behaviour.")]
10 [
Attribute(
"#AR-CAH-SpawnArea_LocalPlayer_Alert_Title",
UIWidgets.EditBox,
"The string that is shown as the main message to the local player upon entering this area as enemy faction.")]
13 [
Attribute(
"#AR-CAH-SpawnArea_LocalPlayer_Alert_Text",
UIWidgets.EditBox,
"The additional string that is shown as the main message to the local player upon entering this area as enemy faction.")]
16 [
Attribute(
"10.0",
UIWidgets.EditBox,
"Time spent in the are in seconds for an enemy to be killed after.")]
40 Print(
"SCR_CaptureAndHoldSpawnArea cannot find RplComponent! Functionality will be limited!",
LogLevel.WARNING);
43 SCR_CaptureAndHoldManager parentManager = SCR_CaptureAndHoldManager.GetAreaManager();
46 Print(
"SCR_CaptureAndHoldSpawnArea cannot find SCR_CaptureAndHoldManager! Functionality might be limited!",
LogLevel.WARNING);
50 parentManager.RegisterSpawnArea(
this);
69 array<IEntity> toRemove = {};
70 float now = GetWorld().GetWorldTime();
72 CharacterControllerComponent controller;
80 toRemove.Insert(occupant);
84 controller = character.GetCharacterController();
85 if (!controller.IsDead())
87 controller.ForceDeath();
88 toRemove.Insert(character);
94 foreach (
IEntity occupant : toRemove)
108 super.OnCharacterEnter(character, isFriendly);
139 if (!popupNotifications)
149 super.OnCharacterExit(character, isFriendly);
178 if (!popupNotifications)
192 SCR_CaptureAndHoldManager parentManager = SCR_CaptureAndHoldManager.GetAreaManager();
196 parentManager.UnregisterSpawnArea(
this);
ArmaReforgerScripted GetGame()
void ~SCR_CaptureAndHoldSpawnArea()
Unregister self from parent manager.
LocalizedString m_sLocalPlayerAlertText
event void OnLocalPlayerEnter(IEntity character, bool isFriendly)
Called when the local character enters this area.
RplComponent m_pRplComponent
RplComponent attached to this are or null if none.
IEntity m_pLastLocalEntity
Last entity stored as the "local offender" or null if none.
event void OnLocalPlayerExit(IEntity character, bool isFriendly)
Called when the local character leaves this area.
ref map< IEntity, float > m_mTimeStamps
Authority map for time spent in the trigger for individual entities (offending ones).
enum SCR_ECompassType EntityEditorProps(category:"GameScripted/Gadgets", description:"Compass", color:"0 0 255 255")
Prefab data class for compass component.
proto external Managed FindComponent(typename typeName)
static IEntity GetLocalControlledEntity()
Takes care of dynamic and static onscreen popups.
void PopupMsg(string text, float duration=DEFAULT_DURATION, string text2="", int prio=-1, string param1="", string param2="", string param3="", string param4="", string text2param1="", string text2param2="", string text2param3="", string text2param4="", string sound="", SCR_EPopupMsgFilter category=SCR_EPopupMsgFilter.ALL, WorldTimestamp progressStart=null, WorldTimestamp progressEnd=null)
static SCR_PopUpNotification GetInstance()
SCR_PopupMessage GetCurrentMsg()
event void OnCharacterExit(IEntity character, bool isFriendly)
event void OnCharacterEnter(IEntity character, bool isFriendly)
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
LogLevel
Enum with severity of the logging message.
SCR_FieldOfViewSettings Attribute
EntityEvent
Various entity events.