Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_ScenarioFrameworkSlotAI.c
Go to the documentation of this file.
1[EntityEditorProps(category: "GameScripted/ScenarioFramework/Slot", description: "")]
5
6// SCR_ScenarioFrameworkSlotAI Spawned Invoker
9typedef ScriptInvokerBase<ScriptInvokerScenarioFrameworkSlotAIMethod> ScriptInvokerScenarioFrameworkSlotAI;
10
12{
13 [Attribute(desc: "Waypoint Groups if applicable", category: "Waypoints")]
14 ref SCR_ScenarioFrameworkWaypointSet m_WaypointSet;
15
16 [Attribute(desc: "Spawn AI on the first WP Slot", defvalue: "1", category: "Waypoints")]
17 bool m_bSpawnAIOnWPPos;
18
19 [Attribute(desc: "Default waypoint if any WP group is defined", "{93291E72AC23930F}Prefabs/AI/Waypoints/AIWaypoint_Defend.et", category: "Waypoints")]
20 ResourceName m_sWPToSpawn;
21
22 [Attribute(defvalue: "0", desc: "Balancing group sizes based on number of players", category: "Balance")]
23 bool m_bBalanceOnPlayersCount;
24
25 [Attribute(defvalue: "1", desc: "Least amount of AIs in the group after balancing occurs. Will not exceed maximum number of units defined in the group prefab.", category: "Balance")]
26 int m_iMinUnitsInGroup;
27
28 [Attribute(defvalue: "1", desc: "When enabled and AI enters a vehicle, whole AI group won't be despawned by the Dynamic Despawn feature until the whole group is outside the vehicle", category: "Activation")]
29 bool m_bExcludeFromDynamicDespawnOnVehicleEntered;
30
31 [Attribute(defvalue: SCR_EAIGroupFormation.Wedge.ToString(), UIWidgets.ComboBox, "AI group formation", "", ParamEnumArray.FromEnum(SCR_EAIGroupFormation), category: "Common")]
32 SCR_EAIGroupFormation m_eAIGroupFormation;
33
34 [Attribute(defvalue: EAISkill.REGULAR.ToString(), UIWidgets.ComboBox, "AI skill in combat", "", ParamEnumArray.FromEnum(EAISkill), category: "Common")]
35 EAISkill m_eAISkill;
36
37 [Attribute(defvalue: "1", uiwidget: UIWidgets.EditBox, desc: "Sets perception ability. Affects speed at which perception detects targets. Bigger value means proportionally faster detection.", params: "0 100 0.001", category: "Common")]
38 float m_fPerceptionFactor;
39
40 [Attribute(defvalue: "{000CD338713F2B5A}Prefabs/AI/Groups/Group_Base.et", category: "Common")]
41 ResourceName m_sGroupPrefab;
42
43 ref array<AIWaypoint> m_aWaypoints = {};
44 SCR_AIGroup m_AIGroup;
45 ref array<ResourceName> m_aAIPrefabsForRemoval = {};
46
47 ref array<SCR_ScenarioFrameworkSlotWaypoint> m_aSlotWaypoints = {};
48 int m_iCurrentlySpawnedWaypoints;
49
50 // Temporary solution as we don't know if invoker or a different method will initialize waypoints
51 bool m_bWaypointsInitialized;
52 bool m_bGroupWasNull;
53
54 //------------------------------------------------------------------------------------------------
56 void SetAIPrefabsForRemoval(array<ResourceName> arrayForRemoval)
57 {
58 m_aAIPrefabsForRemoval = arrayForRemoval;
59 }
60
61 //------------------------------------------------------------------------------------------------
63 array<ResourceName> GetAIPrefabsForRemoval()
64 {
65 return m_aAIPrefabsForRemoval;
66 }
67
68 //------------------------------------------------------------------------------------------------
73 override void RestoreToDefault(bool includeChildren = false, bool reinitAfterRestoration = false, bool affectRandomization = true, bool deleteSpawnedEntities = true)
74 {
75 m_aWaypoints.Clear();
76 m_AIGroup = null;
77 m_aAIPrefabsForRemoval.Clear();
78 m_aSlotWaypoints.Clear();
79 m_iCurrentlySpawnedWaypoints = 0;
80 m_bWaypointsInitialized = false;
81
82 super.RestoreToDefault(includeChildren, reinitAfterRestoration, affectRandomization, deleteSpawnedEntities);
83 }
84
85 //------------------------------------------------------------------------------------------------
88 override void DynamicDespawn(SCR_ScenarioFrameworkLayerBase layer)
89 {
90 GetOnAllChildrenSpawned().Remove(DynamicDespawn);
91 if (!m_Entity && !SCR_StringHelper.IsEmptyOrWhiteSpace(m_sObjectToSpawn))
92 {
93 GetOnAllChildrenSpawned().Insert(DynamicDespawn);
94 return;
95 }
96
99
101 return;
102
103 m_bInitiated = false;
105 if (m_Entity)
106 m_vPosition = m_Entity.GetOrigin();
107
108 if (m_AIGroup)
109 m_AIGroup.GetOnAgentRemoved().Remove(DecreaseAIGroupMemberCount);
110
111 m_AIGroup = null;
112
113 m_aSpawnedEntities.RemoveItem(null);
114 foreach (IEntity entity : m_aSpawnedEntities)
115 {
116 m_vPosition = entity.GetOrigin();
117 SCR_EntityHelper.DeleteEntityAndChildren(entity);
118 }
119
120 m_aSpawnedEntities.Clear();
121 m_aWaypoints.Clear();
122 }
123
124 //------------------------------------------------------------------------------------------------
125 protected void OnAgentCompartmentEntered(AIAgent agent, IEntity targetEntity, BaseCompartmentManagerComponent manager, int mgrID, int slotID, bool move)
126 {
128 return;
129
130 if (!agent || !Vehicle.Cast(targetEntity))
131 return;
132
134 }
135
136 //------------------------------------------------------------------------------------------------
137 protected void OnAgentCompartmentLeft(AIAgent agent, IEntity targetEntity, BaseCompartmentManagerComponent manager, int mgrID, int slotID, bool move)
138 {
140 return;
141
142 if (!agent || !Vehicle.Cast(targetEntity))
143 return;
144
145 array<AIAgent> agents = {};
146 m_AIGroup.GetAgents(agents);
147
148 bool isInVehicle;
149 foreach (AIAgent groupAgent : agents)
150 {
151 ChimeraCharacter character = ChimeraCharacter.Cast(groupAgent.GetControlledEntity());
152 if (character && character.IsInVehicle())
153 {
154 isInVehicle = true;
155 break;
156 }
157 }
158
159 if (!isInVehicle)
161 }
162
163 //------------------------------------------------------------------------------------------------
166 override bool InitOtherThings()
167 {
169
170 if (!m_bWaypointsInitialized &&
172 m_WaypointSet &&
173 !m_WaypointSet.m_aLayerName.IsEmpty())
174 {
176 }
177
178 return super.InitOtherThings();
179 }
180
181 //------------------------------------------------------------------------------------------------
185 {
186 if (m_bInitiated)
187 {
189 return;
190 }
191
192 m_bInitiated = true;
193
194 if (m_Entity)
195 ActivateAI();
196 else
198
200 }
201
202 //------------------------------------------------------------------------------------------------
205 {
206 if (!m_bInitiated)
207 return;
208
209 foreach (SCR_ScenarioFrameworkPlugin plugin : m_aPlugins)
210 {
211 plugin.Init(this);
212 }
213
215
216 if (m_ParentLayer)
217 m_ParentLayer.CheckAllChildrenSpawned(this);
218
219 if (!m_bWaypointsInitialized)
220 SetWaypointToAI(this);
221
223 }
224
225 //------------------------------------------------------------------------------------------------
228 {
229 if (m_AIGroup) // Group alraedy setup from e.g. save-game
230 {
232 return;
233 }
234
235 m_bGroupWasNull = false;
236 m_AIGroup = SCR_AIGroup.Cast(m_Entity);
237 if (!m_AIGroup)
238 m_bGroupWasNull = true;
239
240 if (!m_AIGroup && !CreateAIGroup())
241 {
243 return;
244 }
245
246 if (!m_aAIPrefabsForRemoval.IsEmpty())
247 {
248 foreach (ResourceName prefabToRemove : m_aAIPrefabsForRemoval)
249 {
250 for (int i = m_AIGroup.m_aUnitPrefabSlots.Count() - 1; i >= 0; i--)
251 {
252 if (m_AIGroup.m_aUnitPrefabSlots[i] != prefabToRemove)
253 continue;
254
255 m_AIGroup.m_aUnitPrefabSlots.Remove(i);
256 break;
257 }
258 }
259 }
260 else if (m_bBalanceOnPlayersCount)
261 {
262 int iMaxUnitsInGroup = m_AIGroup.m_aUnitPrefabSlots.Count();
263 float iUnitsToSpawn = Math.Map(GetPlayersCount(), 1, GetMaxPlayersForGameMode(), Math.RandomInt(1, 3), iMaxUnitsInGroup);
264
265 if (iUnitsToSpawn < m_iMinUnitsInGroup)
266 iUnitsToSpawn = m_iMinUnitsInGroup;
267
268 m_AIGroup.SetMaxUnitsToSpawn(iUnitsToSpawn);
269 }
270
272
273 if (m_bGroupWasNull)
274 {
275 m_AIGroup.SetNumberOfMembersToSpawn(1);
276 OnAgentAdded(null);
277 return;
278 }
279
280 m_AIGroup.SetMemberSpawnDelay(200);
281 m_AIGroup.GetOnAgentAdded().Insert(OnAgentAdded);
282 m_AIGroup.SpawnUnits();
283 }
284
285 //------------------------------------------------------------------------------------------------
287 void OnAgentAdded(AIAgent child)
288 {
289 if (!m_AIGroup)
290 {
292 return;
293 }
294
295 if (m_AIGroup.GetNumberOfMembersToSpawn() != m_AIGroup.GetAgentsCount())
296 return;
297
298 m_AIGroup.GetOnAgentAdded().Remove(OnAgentAdded);
299
301
302 if (m_aSlotWaypoints.IsEmpty())
303 SetWaypointToAI(this);
304
306 }
307
308 //------------------------------------------------------------------------------------------------
310 protected void InitGroupComponents()
311 {
312 array<AIAgent> agents = {};
313 m_AIGroup.GetAgents(agents);
314
315 AIFormationComponent formComp = AIFormationComponent.Cast(m_AIGroup.FindComponent(AIFormationComponent));
316 if (formComp)
317 {
318 formComp.SetFormation(SCR_Enum.GetEnumName(SCR_EAIGroupFormation, m_eAIGroupFormation));
319
320 AIFormationDefinition formDef = formComp.GetFormation();
321 if (formDef)
322 {
323 foreach (int i, AIAgent agent : agents)
324 {
325 IEntity agentEntity = agent.GetControlledEntity();
326 if (!agentEntity)
327 continue;
328
329 vector basePosition = m_vPosition;
330 if (basePosition == vector.Zero)
331 {
332 basePosition = m_AIGroup.GetOrigin();
333 // Set the Y-Level to the Slot height to allow mission makers to tune the spawn height.
334 basePosition[1] = GetOwner().GetOrigin()[1];
335 }
336 vector formationPosition = basePosition + formDef.GetOffsetPosition(i);
337
338 World world = agentEntity.GetWorld();
339 if (world)
340 {
341 float surfaceY = world.GetSurfaceY(formationPosition[0], formationPosition[2]);
342 float oceanY = world.GetOceanHeight(formationPosition[0], formationPosition[2]);
343 formationPosition[1] = Math.Max(Math.Max(oceanY, surfaceY), formationPosition[1]);
344 vector floorPosition;
345 if (SCR_EmptyPositionHelper.TryFindNearbyFloorPositionForEntity(world, agentEntity, formationPosition, floorPosition))
346 formationPosition = floorPosition;
347 }
348 agentEntity.SetOrigin(formationPosition);
349 agentEntity.Update();
350
351 SCR_AICombatComponent combatComponent = SCR_AICombatComponent.Cast(agentEntity.FindComponent(SCR_AICombatComponent));
352 if (combatComponent)
353 {
354 combatComponent.SetAISkill(m_eAISkill);
355 combatComponent.SetPerceptionFactor(m_fPerceptionFactor);
356 }
357
358 if (!m_bExcludeFromDynamicDespawnOnVehicleEntered)
359 continue;
360
361 SCR_ChimeraAIAgent chimeraAgent = SCR_ChimeraAIAgent.Cast(agent);
362 if (!chimeraAgent)
363 continue;
364
365 SCR_AIInfoComponent info = chimeraAgent.m_InfoComponent;
366 if (!info)
367 continue;
368
371 }
372 }
373 }
374 else
375 {
376 foreach (AIAgent agent : agents)
377 {
378 IEntity agentEntity = agent.GetControlledEntity();
379 if (!agentEntity)
380 continue;
381
382 SCR_AICombatComponent combatComponent = SCR_AICombatComponent.Cast(agentEntity.FindComponent(SCR_AICombatComponent));
383 if (combatComponent)
384 {
385 combatComponent.SetAISkill(m_eAISkill);
386 combatComponent.SetPerceptionFactor(m_fPerceptionFactor);
387 }
388
389 if (!m_bExcludeFromDynamicDespawnOnVehicleEntered)
390 continue;
391
392 SCR_ChimeraAIAgent chimeraAgent = SCR_ChimeraAIAgent.Cast(agent);
393 if (!chimeraAgent)
394 continue;
395
396 SCR_AIInfoComponent info = chimeraAgent.m_InfoComponent;
397 if (!info)
398 continue;
399
402 }
403 }
404 }
405
406 //------------------------------------------------------------------------------------------------
408 protected void InitWaypoints()
409 {
410 array<string> WaypointSetLayers = {};
411 WaypointSetLayers = m_WaypointSet.m_aLayerName;
412 array<SCR_ScenarioFrameworkLayerBase> layerBases = {};
413 array<SCR_ScenarioFrameworkLayerBase> layerChildren = {};
416
417 BaseWorld world = GetGame().GetWorld();
418 if (!world)
419 return;
420
421 foreach (string waypointSetLayer : WaypointSetLayers)
422 {
423 IEntity layerEntity = world.FindEntityByName(waypointSetLayer);
424 if (!layerEntity)
425 continue;
426
428 if (layerBase && !SCR_ScenarioFrameworkSlotWaypoint.Cast(layerBase))
429 {
430 if (layerBases.Contains(layerBase))
431 continue;
432
433 layerChildren = layerBase.GetChildrenEntities();
434 foreach (SCR_ScenarioFrameworkLayerBase child : layerChildren)
435 {
436 slotWaypoint = SCR_ScenarioFrameworkSlotWaypoint.Cast(child);
437 if (slotWaypoint && !m_aSlotWaypoints.Contains(slotWaypoint))
438 m_aSlotWaypoints.Insert(slotWaypoint);
439 }
440 }
441 else
442 {
444 if (slotWaypoint && !m_aSlotWaypoints.Contains(slotWaypoint))
445 m_aSlotWaypoints.Insert(slotWaypoint);
446 }
447 }
448
449 int waypointCount = m_aSlotWaypoints.Count();
450 foreach (SCR_ScenarioFrameworkSlotWaypoint waypoint : m_aSlotWaypoints)
451 {
452 if (waypoint.GetIsInitiated())
453 m_iCurrentlySpawnedWaypoints++;
454 else
455 waypoint.GetOnAllChildrenSpawned().Insert(CheckWaypointsAfterInit);
456
457 if (waypointCount == m_iCurrentlySpawnedWaypoints)
459 }
460 }
461
462 //------------------------------------------------------------------------------------------------
466 {
468 if (slotWaypoint)
469 {
470 SCR_ScenarioFrameworkWaypointCycle cycleWP = SCR_ScenarioFrameworkWaypointCycle.Cast(slotWaypoint.m_Waypoint);
471 if (cycleWP)
472 {
473 if (!cycleWP.m_bInitiated)
474 {
476 return;
477 }
478 else if (cycleWP.m_OnAllWaypointsSpawned)
479 {
481 }
482 }
483 }
484
485 m_iCurrentlySpawnedWaypoints++;
486 if (m_iCurrentlySpawnedWaypoints == m_aSlotWaypoints.Count())
487 ProcessWaypoints(this);
488
489 layer.GetOnAllChildrenSpawned().Remove(CheckWaypointsAfterInit);
490 }
491
492 //------------------------------------------------------------------------------------------------
496 {
497 if (m_bInitiated && !m_bWaypointsInitialized)
498 SetWaypointToAI(this);
499 else if (!m_bGroupWasNull)
501 }
502
503 //------------------------------------------------------------------------------------------------
506 {
508 m_bWaypointsInitialized = true;
509
510 if (!m_Entity)
511 {
512 Print(string.Format("ScenarioFramework: Trying to add waypoints to non existing entity! Did you select the object to spawn for %1?", GetOwner().GetName()), LogLevel.ERROR);
514 return;
515 }
516
517 if (m_aSlotWaypoints.IsEmpty())
518 {
520 }
521 else
522 {
523 AIWaypoint waypoint;
524 foreach (SCR_ScenarioFrameworkSlotWaypoint waypointSlot : m_aSlotWaypoints)
525 {
526 waypoint = AIWaypoint.Cast(waypointSlot.GetSpawnedEntity());
527 if (waypoint)
528 m_aWaypoints.Insert(waypoint);
529 }
530 }
531
532 if (!m_AIGroup)
533 m_AIGroup = SCR_AIGroup.Cast(m_Entity);
534
535 if (!m_AIGroup)
536 {
537 if (!CreateAIGroup())
538 {
539 m_bWaypointsInitialized = true;
540 return;
541 }
542 }
543
544 m_aWaypoints.RemoveItemOrdered(null);
545
546 foreach (AIWaypoint waypoint : m_aWaypoints)
547 {
548 m_AIGroup.AddWaypoint(waypoint);
549 }
550
551 if (m_aWaypoints.IsEmpty())
552 {
553 m_bWaypointsInitialized = false;
554 return;
555 }
556
557 if (m_vPosition != vector.Zero || !m_bSpawnAIOnWPPos || m_aWaypoints.IsEmpty())
558 return;
559
560 AIWaypoint waypoint = m_aWaypoints[0];
561 AIWaypointCycle cycleWaypoint = AIWaypointCycle.Cast(waypoint);
562 if (cycleWaypoint)
563 {
564 array<AIWaypoint> cycleWaypoints = {};
565 cycleWaypoint.GetWaypoints(cycleWaypoints);
566 if (!cycleWaypoints.IsEmpty() && cycleWaypoints[0] != null)
567 {
568 waypoint = cycleWaypoints[0];
569 }
570 else
571 {
572 m_bWaypointsInitialized = false;
573 return;
574 }
575 }
576
577 AIFormationComponent formComp = AIFormationComponent.Cast(m_AIGroup.FindComponent(AIFormationComponent));
578 if (!formComp)
579 return;
580
581 AIFormationDefinition formDef = formComp.GetFormation();
582 if (!formDef)
583 return;
584
585 array<AIAgent> agents = {};
586 m_AIGroup.GetAgents(agents);
587
588 foreach (int i, AIAgent agent : agents)
589 {
590 IEntity agentEntity = agent.GetControlledEntity();
591 if (!agentEntity)
592 continue;
593
594 agentEntity.SetOrigin(waypoint.GetOrigin() + formDef.GetOffsetPosition(i));
595 }
596 }
597
598 //------------------------------------------------------------------------------------------------
601 protected AIWaypoint CreateDefaultWaypoint()
602 {
603 if (!m_Entity)
604 return null;
605
606 EntitySpawnParams spawnParams = new EntitySpawnParams();
607 spawnParams.TransformMode = ETransformMode.WORLD;
608 spawnParams.Transform[3] = m_Entity.GetOrigin();
609
610 Resource resWP = Resource.Load(m_sWPToSpawn);
611 if (!resWP || !resWP.IsValid())
612 return null;
613
614 AIWaypoint waypoint = AIWaypoint.Cast(GetGame().SpawnEntityPrefab(resWP, GetGame().GetWorld(), spawnParams));
615 if (!waypoint)
616 return null;
617
618 m_aWaypoints.Insert(waypoint);
619 return waypoint;
620 }
621
622 //------------------------------------------------------------------------------------------------
626 void DecreaseAIGroupMemberCount(SCR_AIGroup group, AIAgent agent)
627 {
628 if (group.GetAgentsCount() == 0)
629 {
631 {
633 SetIsTerminated(true);
634 }
635 else
636 {
637 SetIsTerminated(true);
638 }
639 }
640
641 IEntity agentEntity = agent.GetControlledEntity();
642 if (!agentEntity)
643 {
644 Print("ScenarioFramework: Decreasing AI member count failed due to not getting AI entity!", LogLevel.ERROR);
645 return;
646 }
647
648 EntityPrefabData prefabData = agentEntity.GetPrefabData();
649 if (!prefabData)
650 {
651 Print("ScenarioFramework: Decreasing AI member count failed due to not getting entity prefab data", LogLevel.ERROR);
652 return;
653 }
654
655 ResourceName resource = prefabData.GetPrefabName();
656 if (resource)
657 m_aAIPrefabsForRemoval.Insert(resource);
658 }
659
660 //------------------------------------------------------------------------------------------------
663 protected bool CreateAIGroup()
664 {
665 EntitySpawnParams paramsPatrol = new EntitySpawnParams();
666 paramsPatrol.TransformMode = ETransformMode.WORLD;
667
668 paramsPatrol.Transform[3] = m_Entity.GetOrigin();
669 Resource groupResource = Resource.Load(m_sGroupPrefab);
670 if (!groupResource.IsValid())
671 return false;
672
673 m_AIGroup = SCR_AIGroup.Cast(GetGame().SpawnEntityPrefab(groupResource, GetGame().GetWorld(), paramsPatrol));
674 if (!m_AIGroup)
675 return false;
676
677 FactionAffiliationComponent facComp = FactionAffiliationComponent.Cast(m_Entity.FindComponent(FactionAffiliationComponent));
678 if (!facComp)
679 return false;
680
681 m_AIGroup.SetFaction(facComp.GetAffiliatedFaction());
682 m_AIGroup.AddAIEntityToGroup(m_Entity);
683
684 if (m_vPosition != vector.Zero)
685 m_Entity.SetOrigin(m_vPosition);
686
687 return true;
688 }
689
690 //------------------------------------------------------------------------------------------------
691 // constructor
696 {
697 m_iDebugShapeColor = ARGB(100, 0x00, 0x10, 0xFF);
698 }
699}
ArmaReforgerScripted GetGame()
Definition game.c:1398
LayerPresets layer
vector m_vPosition
enum EAITargetInfoCategory m_Entity
enum SCR_ECompassType EntityEditorProps(category:"GameScripted/Gadgets", description:"Compass", color:"0 0 255 255")
Prefab data class for compass component.
void OnAgentAdded()
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
ref array< IEntity > m_aSpawnedEntities
SCR_ScenarioFrameworkEActivationType m_eActivationType
bool m_bEnableRepeatedSpawn
SCR_ScenarioFrameworkLayerBase m_ParentLayer
ScriptInvokerScenarioFrameworkLayer GetOnAllChildrenSpawned()
bool m_bExcludeFromDynamicDespawn
void SetIsTerminated(bool state)
void InitActivationActions()
void SCR_ScenarioFrameworkLayerBase(IEntityComponentSource src, IEntity ent, IEntity parent)
ref array< ref SCR_ScenarioFrameworkPlugin > m_aPlugins
int GetMaxPlayersForGameMode(FactionKey factionName="")
bool m_bDynamicallyDespawned
void RestoreToDefault()
ScriptInvokerBase< ScriptInvokerScenarioFrameworkSlotAIMethod > ScriptInvokerScenarioFrameworkSlotAI
func ScriptInvokerScenarioFrameworkSlotAIMethod
void SCR_ScenarioFrameworkSlotBase(IEntityComponentSource src, IEntity ent, IEntity parent)
array< ResourceName > GetAIPrefabsForRemoval()
void SCR_ScenarioFrameworkSlotWaypoint(IEntityComponentSource src, IEntity ent, IEntity parent)
proto external Managed FindComponent(typename typeName)
proto external void SetOrigin(vector orig)
proto external vector GetOrigin()
proto external int Update()
proto external BaseWorld GetWorld()
proto external EntityPrefabData GetPrefabData()
Definition Math.c:13
Object holding reference to resource. In destructor release the resource.
Definition Resource.c:25
ScriptInvoker GetOnAgentRemoved()
static void IgnoreSpawning(bool ignore)
bool SetFaction(Faction faction)
ref ScriptInvokerBase< SCR_AIOnCompartmentLeft > m_OnCompartmentLeft
ref ScriptInvokerBase< SCR_AIOnCompartmentEntered > m_OnCompartmentEntered
static bool TryFindNearbyFloorPositionForEntity(BaseWorld world, IEntity entity, vector position=vector.Zero, out vector floorPos=vector.Zero)
void OnAgentCompartmentLeft(AIAgent agent, IEntity targetEntity, BaseCompartmentManagerComponent manager, int mgrID, int slotID, bool move)
void CheckWaypointsAfterInit(SCR_ScenarioFrameworkLayerBase layer)
override void AfterAllChildrenSpawned(SCR_ScenarioFrameworkLayerBase layer)
void SetWaypointToAI(SCR_ScenarioFrameworkLayerBase layer)
void ActivateAI()
Activates AI group, removes unwanted prefabs, balances units count, sets on agent remove and add even...
void AfterAllAgentsSpawned()
Initializes plugins, actions, and checks for parent layer spawn completion, then sets waypoints for A...
void OnAgentCompartmentEntered(AIAgent agent, IEntity targetEntity, BaseCompartmentManagerComponent manager, int mgrID, int slotID, bool move)
void DecreaseAIGroupMemberCount(SCR_AIGroup group, AIAgent agent)
void InitWaypoints()
Initializes waypoints by finding them in specified layers, adding them to list, and processing them a...
void ProcessWaypoints(SCR_ScenarioFrameworkLayerBase layer)
void SCR_ScenarioFrameworkSlotAI(IEntityComponentSource src, IEntity ent, IEntity parent)
void InitGroupComponents()
Initializes AI group components, sets formation, and combat parameters for agents in the group.
static void InvokeSlotAISpawned(SCR_ScenarioFrameworkLayerBase layer, IEntity entity)
ScriptInvokerScenarioFrameworkLayer GetOnAllWaypointsSpawned()
static bool IsEmptyOrWhiteSpace(string input)
Definition World.c:16
enum EPhysicsLayerPresets Vehicle
Definition gameLib.c:24
void EntitySpawnParams()
Definition gameLib.c:130
IEntity GetOwner()
Owner entity of the fuel tank.
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
LogLevel
Enum with severity of the logging message.
Definition LogLevel.c:14
SCR_FieldOfViewSettings Attribute
proto int ARGB(int a, int r, int g, int b)