1[
ComponentEditorProps(
category:
"GameScripted/GameMode/CaptureAndHold", description:
"Manager component allowing access and API over CaptureAndHold areas.")]
12 [
Attribute(defvalue:
"0",
desc:
"If enabled, custom weather Id will be used. Authority only.",
category:
"CaptureAndHold: Environment")]
13 bool m_bUseCustomWeather;
16 [
Attribute(defvalue:
"",
desc:
"Weather IDs are the same as used in the TimeAndWeatherManager. Weather set on game start. Authority only.",
category:
"CaptureAndHold: Environment")]
20 [
Attribute(defvalue:
"0",
desc:
"If enabled, custom time of the day will be used. Authority only.",
category:
"CaptureAndHold: Environment")]
24 [
Attribute(defvalue:
"12",
desc:
"Time of the day set on game start. Authority only.",
category:
"CaptureAndHold: Environment",
params:
"0 24 0.01")]
28 [
Attribute(defvalue:
"0",
desc:
"Should actions be persistent (sticky) in the sense that they are not cleared when players leave the area?")]
32 protected static SCR_CaptureAndHoldManager s_Instance;
35 protected ref array<SCR_CaptureAndHoldArea>
m_aAreas = {};
102 int GetAreas(notnull array<SCR_CaptureAndHoldArea> outAreas)
107 outAreas.Insert(area);
115 int GetAreas(notnull array<SCR_CaptureAndHoldSpawnArea> outAreas)
120 outAreas.Insert(area);
138 super.OnPostInit(owner);
150 super.OnDelete(owner);
177 vector worldPos = area.GetWorldObjectiveCenter();
195 vector usize = mapWidget.GetSizeInUnits();
196 float zoomVal = usize[0] / (usize[0] * mapWidget.PixelPerUnit());
207 super.OnPlayerKilled(instigatorContextData);
209 SCR_ChimeraCharacter character = SCR_ChimeraCharacter.Cast(instigatorContextData.GetVictimEntity());
213 Faction faction = character.GetFaction();
219 Faction areaFaction = area.GetAffiliatedFaction();
223 if (!areaFaction.IsFactionFriendly(faction))
227 if (!area.QueryEntityInside(character))
244 respawnTimer.SetRespawnTime(instigatorContextData.GetVictimPlayerID(), 0.0);
250 static SCR_CaptureAndHoldManager GetAreaManager()
252 BaseGameMode gameMode =
GetGame().GetGameMode();
257 s_Instance = SCR_CaptureAndHoldManager.Cast(gameMode.FindComponent(SCR_CaptureAndHoldManager));
270 if (weatherId.IsEmpty())
280 Print(
"Cannot initialize weather: TimeAndWeatherManagerEntity not found!",
LogLevel.WARNING);
301 Print(
"Cannot initialize TimeOfTheDay: TimeAndWeatherManagerEntity not found!",
LogLevel.WARNING);
305 weatherManager.SetTimeOfTheDay(timeOfTheDay,
true);
317 if (m_bUseCustomWeather)
ArmaReforgerScripted GetGame()
enum EAIGroupCombatMode ComponentEditorProps(category:"GameScripted/AI", description:"Component for utility AI system for groups")
SCR_BaseGameModeComponentClass m_pGameMode
The game mode entity this component is attached to.
SCR_BaseGameMode GetGameMode()
void SCR_BaseGameModeComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
void OnMapOpen(MapConfiguration config)
void OnPlayerKilled(notnull SCR_InstigatorContextData instigatorContextData)
string m_sCustomWeatherId
Weather IDs are the same as used in the TimeAndWeatherManager. Weather set on game start....
SCR_CaptureAndHoldSpawnArea GetSpawnArea(int index)
Returns a spawn area at given index.
bool GetIsAreaFactionPersistent()
int GetAreas(notnull array< SCR_CaptureAndHoldArea > outAreas)
Fills the provided array with all registered zones and returns the count.
void SetTimeOfTheDay(float timeOfTheDay)
Forcefully sets time of the day to provided value. Authority only.
float m_fCustomTimeOfTheDay
Time of the day set on game start. Authority only.
SCR_CaptureAndHoldArea GetArea(int index)
Returns an area at given index.
void RegisterSpawnArea(SCR_CaptureAndHoldSpawnArea spawnArea)
Register a spawn area to this manager. Area must be unique.
bool m_bUseCustomTime
If enabled custom time of the day will be used on session start. Authority only.
void UnregisterArea(SCR_CaptureAndHoldArea area)
Unregisters a capture area from this manager.
int GetAreaCount()
Returns the number of registered capture areas.
bool m_bPersistentAreaFactions
If enabled then capture status is persistent.
void DoPanZoomMap(float x, float z, float zoom)
Pans the map to provided world coordinates.
void UnregisterSpawnArea(SCR_CaptureAndHoldSpawnArea spawnArea)
Unregisters a capture area from this manager.
ref array< SCR_CaptureAndHoldArea > m_aAreas
Array of all areas registered within this manager.
void SetWeather(string weatherId)
Forcefully sets weather to provided weatherId. Authority only.
ref array< SCR_CaptureAndHoldSpawnArea > m_aSpawnAreas
Array of all spawn areas registered within this manager.
void RegisterArea(SCR_CaptureAndHoldArea area)
Register a capture area to this manager. Area must be unique.
int GetSpawnAreaCount()
Returns the number of registered spawn areas.
SCR_DestructionSynchronizationComponentClass ScriptComponentClass int index
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
void SCR_RespawnTimerComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
SCR_SpawnerSlotManagerClass s_Instance
Class used for managing changes and removals of slots present in world.
proto external BaseWorld GetWorld()
CanvasWidget GetMapWidget()
Get map widget.
static ScriptInvokerBase< MapConfigurationInvoker > GetOnMapOpen()
Get on map open invoker.
void ZoomPanSmooth(float targetPixPerUnit, float worldX, float worldY, float zoomTime=0.25)
static SCR_MapEntity GetMapInstance()
Get map entity instance.
void ForceWeatherTo(bool setLooping, string weatherID=string.Empty, float transitionDuration=0, float stateDuration=0.001, int playerThatChangedWeather=0)
void EOnInit(IEntity owner)
IEntity GetOwner()
Owner entity of the fuel tank.
override void EOnInit(IEntity owner)
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.