Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_EditableGroupComponent.c
Go to the documentation of this file.
1 [ComponentEditorProps(category: "GameScripted/Editor (Editables)", description: "", icon: "WBData/ComponentEditorProps/componentEditor.png")]
3 {
4  //------------------------------------------------------------------------------------------------
5  static override bool GetEntitySourceBudgetCost(IEntityComponentSource editableEntitySource, out notnull array<ref SCR_EntityBudgetValue> budgetValues)
6  {
7  // Avoid fallback entityType cost
8  return true;
9  }
10 
11  //------------------------------------------------------------------------------------------------
13  static bool GetGroupSourceBudgetCost(IEntityComponentSource editableEntitySource, out notnull array<ref SCR_EntityBudgetValue> budgetValues)
14  {
15  if (!editableEntitySource)
16  return false;
17 
18  SCR_EditableGroupUIInfo editableEntityUIInfo = SCR_EditableGroupUIInfo.Cast(SCR_EditableGroupComponentClass.GetInfo(editableEntitySource));
19  if (editableEntityUIInfo)
20  return editableEntityUIInfo.GetGroupBudgetCost(budgetValues);
21 
22  return !budgetValues.IsEmpty();
23  }
24 }
25 
27 
30 {
31  protected SCR_AIGroup m_Group;
32 
33  [RplProp(onRplName: "OnLeaderIdChanged")]
34  protected RplId m_LeaderId;
35 
38  protected ref ScriptInvoker Event_OnUIRefresh = new ScriptInvoker;
39 
40  //~ Authority only, Forces spawned characters to be added to a specific vehicle position and will delete it if failed
41  protected ref array<ECompartmentType> m_aForceSpawnVehicleCompartments;
42 
44 
45  //------------------------------------------------------------------------------------------------
46 // protected void OnEmpty()
47 // {
48 // }
49 
50  //------------------------------------------------------------------------------------------------
51  protected void OnAgentAdded(AIAgent child)
52  {
53  if (!child)
54  return;
55 
56  //--- Add newly joined soldier to group's layer
57  SCR_EditableEntityComponent editableChild = SCR_EditableEntityComponent.GetEditableEntity(child.GetControlledEntity());
58  if (editableChild)
59  editableChild.SetParentEntity(this);
60  }
61 
62  //------------------------------------------------------------------------------------------------
63  protected void OnAgentRemoved(SCR_AIGroup group, AIAgent child)
64  {
65  if (!child)
66  return;
67 
68  //--- Remove the soldier who left from group's layer (only if the soldier is still this group's child)
69  SCR_EditableEntityComponent editableChild = SCR_EditableEntityComponent.GetEditableEntity(child.GetControlledEntity());
70  if (editableChild && editableChild.GetParentEntity() == this)
71  editableChild.SetParentEntity(null);
72  }
73 
74  //------------------------------------------------------------------------------------------------
75  protected void OnLeaderChanged(AIAgent currentLeader, AIAgent prevLeader)
76  {
77  if (!currentLeader)
78  return;
79 
80  //--- Update pointer to the leader on all clients
81  SCR_EditableEntityComponent editableLeader = SCR_EditableEntityComponent.GetEditableEntity(currentLeader.GetControlledEntity());
82  if (editableLeader)
83  {
84  m_Leader = editableLeader;
85  m_LeaderId = Replication.FindId(editableLeader);
86  Replication.BumpMe();
87  Refresh(); //--- Make the icon appear instantly
88  }
89  }
90 
91  //------------------------------------------------------------------------------------------------
92  protected void OnCurrentWaypointChanged(AIWaypoint currentWP, AIWaypoint prevWP)
93  {
95  }
96 
97  //------------------------------------------------------------------------------------------------
98  protected void OnWaypointCompleted(AIWaypoint wp)
99  {
101  }
102 
103  //------------------------------------------------------------------------------------------------
104  protected void OnWaypointAdded(AIWaypoint wp)
105  {
106  SCR_EditableWaypointComponent waypoint = SCR_EditableWaypointComponent.Cast(SCR_EditableEntityComponent.GetEditableEntity(wp));
107  if (waypoint)
108  {
109  waypoint.SetParentEntity(this);
110  }
112  }
113 
114  //------------------------------------------------------------------------------------------------
115  protected void OnWaypointRemoved(AIWaypoint wp)
116  {
117  //--- Delete waypoints which were not assigned to another group
118  SCR_EditableWaypointComponent waypoint = SCR_EditableWaypointComponent.Cast(SCR_EditableEntityComponent.GetEditableEntity(wp));
119  if (waypoint && waypoint.GetParentEntity() == this)
120  waypoint.Delete();
121 
123  }
124 
125  //------------------------------------------------------------------------------------------------
126  protected void ReindexWaypoints()
127  {
128  int index = 1;
129  SCR_EditableWaypointComponent waypoint, currentWaypoint;
130  array<SCR_EditableWaypointComponent> waypoints = new array<SCR_EditableWaypointComponent>;
131 
132  bool hasNonEditable, hasNull;
133  AIWaypoint aiWaypoint;
134  AIWaypoint currentAiWaypoint = m_Group.GetCurrentWaypoint();
135  array<AIWaypoint> aiWaypoints = {};
136  for (int i = 0, count = m_Group.GetWaypoints(aiWaypoints); i < count; i++)
137  {
138  aiWaypoint = aiWaypoints[i];
139  waypoint = SCR_EditableWaypointComponent.Cast(SCR_EditableEntityComponent.GetEditableEntity(aiWaypoint));
140  if (waypoint)
141  {
142  waypoints.Insert(waypoint);
143  if (aiWaypoint == currentAiWaypoint)
144  currentWaypoint = waypoint;
145  }
146  else if (aiWaypoint)
147  {
148  hasNonEditable = true;
149  }
150  else
151  {
152  hasNull = true;
153  }
154  }
155 
156  //--- Show warning when the group mixes editable and non-editable waypoints. The latter will not be visible in the editor, potentially causing confusion.
157  if (hasNull)
158  Log("Group contains null waypoints!", true, LogLevel.WARNING);
159  else if (!waypoints.IsEmpty() && hasNonEditable)
160  Log("Group has a mix of editable and non-editable waypoints. Please use only one of those!", true, LogLevel.WARNING);
161 
162  SCR_EditableWaypointComponent prevWaypoint;
163  for (int i = 0, count = waypoints.Count(); i < count; i++)
164  {
165  waypoint = waypoints[i];
166  waypoint.SetWaypointIndex(i + 1, waypoint == currentWaypoint, prevWaypoint);
167  prevWaypoint = waypoint;
168  }
169  }
170 
171  //------------------------------------------------------------------------------------------------
172  protected void OnLeaderIdChanged()
173  {
174  //--- Retrieve new leader from RplID
175  SetLeader(SCR_EditableEntityComponent.Cast(Replication.FindItem(m_LeaderId)));
176  }
177 
178  //------------------------------------------------------------------------------------------------
179  protected void SetLeader(SCR_EditableEntityComponent leader)
180  {
181  if (leader)
182  {
183  m_Leader = leader;
184  Refresh();
185  }
186  }
187 
188  //------------------------------------------------------------------------------------------------
189  protected void OnFactionChanged(Faction faction)
190  {
191  Event_OnUIRefresh.Invoke();
192 
193  //Call on faction changed of group children
194  if (m_Entities)
195  {
196  foreach (SCR_EditableEntityComponent entity: m_Entities)
197  {
198  SCR_EditableCharacterComponent editableCharacter = SCR_EditableCharacterComponent.Cast(entity);
199  if (editableCharacter)
200  editableCharacter.OnFactionChanged();
201  }
202  }
203  }
204 
205  //------------------------------------------------------------------------------------------------
207  {
208  //--- Create UI info for group instance, so we can change its symbol
209  if (!m_GroupInfo)
210  {
212  m_GroupInfo.CopyFrom(GetInfo());
213  SetInfoInstance(m_GroupInfo);
214  }
215 
216  m_GroupInfo.SetInstance(symbol, name);
217 
218  Event_OnUIRefresh.Invoke();
219  }
220 
221  //------------------------------------------------------------------------------------------------
225  {
226  return m_Group;
227  }
228 
229  //------------------------------------------------------------------------------------------------
230  override ScriptInvoker GetOnUIRefresh()
231  {
232  return Event_OnUIRefresh;
233  }
234 
235  //------------------------------------------------------------------------------------------------
236  override Faction GetFaction()
237  {
238  Faction faction;
239 
240  if (m_Leader)
241  faction = m_Leader.GetFaction();
242 
243  if (!faction)
244  faction = m_Group.GetFaction();
245 
246  return faction;
247  }
248 
249  //------------------------------------------------------------------------------------------------
251  {
252  return this;
253  }
254 
255  //------------------------------------------------------------------------------------------------
257  {
258  return m_Leader;
259  }
260 
261  //------------------------------------------------------------------------------------------------
264  int GetSize()
265  {
266  if (!m_Group)
267  return 0;
268 
269  return m_Group.GetPlayerAndAgentCount();
270  }
271 
272  //------------------------------------------------------------------------------------------------
276  {
277  int count = 0;
278  /*set <SCR_EditableEntityComponent> groupChildren = new set <SCR_EditableEntityComponent>;
279  GetChildren(groupChildren, true);*/
280 
281  if (m_Entities)
282  {
283  foreach (SCR_EditableEntityComponent child: m_Entities)
284  {
285  if (child.GetEntityType() == EEditableEntityType.WAYPOINT)
286  count++;
287  }
288  }
289 
290  return count;
291  }
292 
293  //------------------------------------------------------------------------------------------------
296  {
297  if (!m_Group)
298  return;
299 
300  array<AIWaypoint> aiWaypoints = {};
301  for (int i = 0, count = m_Group.GetWaypoints(aiWaypoints); i < count; i++)
302  {
303  SCR_EditableWaypointComponent waypoint = SCR_EditableWaypointComponent.Cast(SCR_EditableEntityComponent.GetEditableEntity(aiWaypoints[i]));
304  if (waypoint)
305  {
306  waypoint.Delete();
307  }
308  else
309  {
310  //--- Unassign non-editable waypoint, but don't delete it (multiple groupls may be assigned to it)
311  m_Group.RemoveWaypoint(aiWaypoints[i]);
312  }
313  }
314  }
315 
316  //------------------------------------------------------------------------------------------------
317  override bool GetEntityBudgetCost(out notnull array<ref SCR_EntityBudgetValue> outBudgets, IEntity owner = null)
318  {
319  return true;
320  }
321 
322  // Will have the correct value only on Authority
323  //------------------------------------------------------------------------------------------------
324  void GetRuntimeBudgetCost(out notnull array<ref SCR_EntityBudgetValue> outBudgets)
325  {
326  if (!m_Group)
327  return;
328 
329  array<AIAgent> agentsInGroup = {};
330  SCR_EditableCharacterComponent editableCharacter;
331  m_Group.GetAgents(agentsInGroup);
332 
333  foreach (AIAgent agent : agentsInGroup)
334  {
335  IEntity controlledEntity = agent.GetControlledEntity();
336 
337  if (!controlledEntity)
338  continue;
339 
340  editableCharacter = SCR_EditableCharacterComponent.Cast(controlledEntity.FindComponent(SCR_EditableCharacterComponent));
341 
342  array<ref SCR_EntityBudgetValue> characterBudget = {};
343  editableCharacter.GetEntityBudgetCost(characterBudget);
344 
345  SCR_EntityBudgetValue.MergeBudgetCosts(outBudgets, characterBudget);
346  }
347  }
348 
349  //------------------------------------------------------------------------------------------------
350  void GetPrefabBudgetCost(out notnull array<ref SCR_EntityBudgetValue> outBudgets)
351  {
352  SCR_AIGroup aiGroup = SCR_AIGroup.Cast(GetOwner());
353  if (!aiGroup)
354  return;
355 
356  array<ref SCR_EntityBudgetValue> groupBudgetCosts = {};
357  ResourceName resName = GetOwner().GetPrefabData().GetPrefabName();
358  IEntityComponentSource componentSourceC;
359 
360  Resource prefabResource = Resource.Load(resName);
361  if (!prefabResource)
362  return;
363 
364  BaseResourceObject baseResourceC = prefabResource.GetResource();
365  if (!baseResourceC)
366  return;
367 
368  IEntitySource entitySourceC = baseResourceC.ToEntitySource();
369  if (!entitySourceC)
370  return;
371 
372  for (int i = 0, count = entitySourceC.GetComponentCount(); i < count; i++)
373  {
374  componentSourceC = entitySourceC.GetComponent(i);
375  if (componentSourceC.GetClassName() == ((typename)SCR_EditableGroupComponent).ToString())
376  {
377  array<ref SCR_EntityBudgetValue> gropBudgetCosts = {};
378  SCR_EditableGroupComponentClass.GetGroupSourceBudgetCost(componentSourceC, gropBudgetCosts);
379 
380  SCR_EntityBudgetValue.MergeBudgetCosts(outBudgets, gropBudgetCosts);
381  }
382  }
383  }
384 
385  //------------------------------------------------------------------------------------------------
386  override bool CanDuplicate(out notnull set<SCR_EditableEntityComponent> outRecipients)
387  {
388  return false;
389  }
390 
391  //------------------------------------------------------------------------------------------------
393  {
394  if (!m_Leader)
395  return m_Entities[index]; //--- No leader, use default method
396  if (index == 0)
397  return m_Leader; //--- Return leader as the first item (needed for session saving - SCR_EditableEntityStruct)
398  else if (index <= m_Entities.Find(m_Leader))
399  return m_Entities[index - 1]; //--- Before leader, push by one
400  else
401  return m_Entities[index]; //--- After leader, use default method
402  }
403 
404  //------------------------------------------------------------------------------------------------
405  override bool GetPos(out vector pos)
406  {
407  if (!m_Leader)
408  return false;
409 
410  if (!m_Leader.GetPos(pos))
411  return false;
412 
413  pos += GetIconPos();
414  return true;
415  }
416 
417  //------------------------------------------------------------------------------------------------
418  override bool CanDestroy()
419  {
420  set<SCR_EditableEntityComponent> children = new set<SCR_EditableEntityComponent>();
421  GetChildren(children, true);
422 
423  foreach (SCR_EditableEntityComponent child : children)
424  {
425  if (child.CanDestroy())
426  return true;
427  }
428 
429  return false;
430  }
431 
432  //------------------------------------------------------------------------------------------------
433  override bool IsDestroyed()
434  {
435  set<SCR_EditableEntityComponent> children = new set<SCR_EditableEntityComponent>();
436  GetChildren(children, true);
437 
438  foreach (SCR_EditableEntityComponent child : children)
439  {
440  if (!child.IsDestroyed())
441  return false;
442  }
443 
444  return true;
445  }
446 
447  //------------------------------------------------------------------------------------------------
449  void HideIfEmpty()
450  {
451  RplComponent rpl = GetRplComponent();
452  if (!m_Group || !rpl || rpl.IsProxy()) // Only the Authority has the proper data needed to determine visibility
453  return;
454 
455  bool isGroupEmpty = m_Group.GetAgentsCount() == 0;
456  SetVisible(!isGroupEmpty);
457  }
458 
459  //------------------------------------------------------------------------------------------------
460  override bool Destroy()
461  {
462  if (!IsServer())
463  return false;
464 
465  set<SCR_EditableEntityComponent> children = new set<SCR_EditableEntityComponent>();
466  GetChildren(children, true);
467 
468  bool isDestroyed = true;
469 
470  foreach (SCR_EditableEntityComponent child : children)
471  {
472  isDestroyed &= child.Destroy();
473  }
474 
475  return isDestroyed;
476  }
477 
478  //------------------------------------------------------------------------------------------------
479 // override bool CanSetParent(SCR_EditableEntityComponent parentEntity)
480 // {
481 // if (!parentEntity)
482 // return true;
483 //
484 // EEditableEntityType type = parentEntity.GetEntityType();
485 // return super.CanSetParent(parentEntity) || type == EEditableEntityType.CHARACTER || type == EEditableEntityType.GROUP || type == EEditableEntityType.VEHICLE;
486 // }
487 
488  //------------------------------------------------------------------------------------------------
489  //~ Authority Only. When spawned will force characters of group into vehicle position
490  override void ForceVehicleCompartments(notnull array<ECompartmentType> forceVehicleCompartments)
491  {
492  if (forceVehicleCompartments.IsEmpty())
493  return;
494 
496 
497  foreach (ECompartmentType compartment: forceVehicleCompartments)
498  m_aForceSpawnVehicleCompartments.Insert(compartment);
499  }
500 
501  //------------------------------------------------------------------------------------------------
502  override void OnParentEntityChanged(SCR_EditableEntityComponent parentEntity, SCR_EditableEntityComponent parentEntityPrev, bool changedByUser)
503  {
504  EEditableEntityType parentType;
505  if (parentEntity) parentType = parentEntity.GetEntityType();
506 
507  switch (parentType)
508  {
509  case EEditableEntityType.GROUP:
510  case EEditableEntityType.CHARACTER:
511  case EEditableEntityType.VEHICLE:
512  {
513  if (!IsServer())
514  break;
515 
516  set<SCR_EditableEntityComponent> children = new set<SCR_EditableEntityComponent>;
517  GetChildren(children, true);
518  if (children.IsEmpty() && !parentEntityPrev)
519  {
520  //--- Group is still empty after placing. Wait a bit before attempting to move soldiers under another parent (to prevent endless loop, do it only once by overriding parentEntityPrev)
521  GetGame().GetCallqueue().CallLater(OnParentEntityChanged, 1, false, parentEntity, parentEntity, changedByUser);
522  }
523  else
524  {
525  foreach (SCR_EditableEntityComponent child: children)
526  {
527  if (child.GetEntityType() == EEditableEntityType.CHARACTER)
528  {
529  //~ Force children in vehicle position if any are assigned
531  child.ForceVehicleCompartments(m_aForceSpawnVehicleCompartments);
532 
533  child.SetParentEntity(parentEntity);
534  }
535  }
536 
537  //~ Clear force positions
540  }
541  break;
542  }
543  default:
544  {
545  super.OnParentEntityChanged(parentEntity, parentEntityPrev, changedByUser);
546  break;
547  }
548  }
549  }
550 
551  //------------------------------------------------------------------------------------------------
552  override void OnCreatedServer(notnull SCR_PlacingEditorComponent placedEditorComponent)
553  {
554  super.OnCreatedServer(placedEditorComponent);
555 
556  m_PlacedEditorComponent = placedEditorComponent;
557  if (m_Group == null)
558  return;
559 
560  int numberOfMembersToSpawn = m_Group.GetNumberOfMembersToSpawn();
561  if (numberOfMembersToSpawn < 1)
562  return;
563 
564  m_Group.GetOnAllDelayedEntitySpawned().Insert(OnAllMembersSpawned);
565  m_PlacedEditorComponent.SetPlacingBlocked(true);
566 
568  if (!budgetComponent)
569  return;
570 
571  SCR_EditableEntityCoreBudgetSetting aiBudget = budgetComponent.GetBudgetSetting(EEditableEntityBudget.AI);
572  if (aiBudget)
573  aiBudget.ReserveBudget(numberOfMembersToSpawn + 1);
574  }
575 
576  //------------------------------------------------------------------------------------------------
579  {
581  return;
582 
583  m_Group.GetOnAllDelayedEntitySpawned().Remove(OnAllMembersSpawned);
584 
585  m_PlacedEditorComponent.SetPlacingBlocked(false);
586 
588  if (!budgetComponent)
589  return;
590 
591  SCR_EditableEntityCoreBudgetSetting aiBudget = budgetComponent.GetBudgetSetting(EEditableEntityBudget.AI);
592  if (aiBudget)
593  aiBudget.UnreserveBudget(m_Group.GetNumberOfMembersToSpawn() + 1);
594  }
595 
596  //------------------------------------------------------------------------------------------------
597  override void OnChildEntityChanged(SCR_EditableEntityComponent child, bool isAdded)
598  {
599  if (!IsServer())
600  {
601  if (isAdded && Replication.FindId(child) == m_LeaderId)
602  SetLeader(child);
603 
604  return;
605  }
606 
607  switch (child.GetEntityType())
608  {
609  case EEditableEntityType.CHARACTER:
610  {
611  SCR_EditableCharacterComponent childCharacter = SCR_EditableCharacterComponent.Cast(child);
612  if (!childCharacter)
613  return;
614 
615  AIAgent childAgent = childCharacter.GetAgent();
616  if (!childAgent)
617  return;
618 
619  if (isAdded)
620  {
621  m_Group.AddAgent(childAgent);
622 
623  //--- Make sure newly joined member is on the same faction
624  Faction groupFaction = GetFaction();
625  if (groupFaction && groupFaction != childCharacter.GetFaction())
626  {
627  FactionAffiliationComponent charactedFactionComponent = FactionAffiliationComponent.Cast(childCharacter.GetOwner().FindComponent(FactionAffiliationComponent));
628  if (charactedFactionComponent)
629  charactedFactionComponent.SetAffiliatedFaction(groupFaction);
630 
631  //--- ToDo: Notify player that this is sus!
632  }
633  }
634  else
635  {
636  m_Group.RemoveAgent(childAgent);
637  }
638 
639  break;
640  }
641 
642  case EEditableEntityType.WAYPOINT:
643  {
644  AIWaypoint waypoint = AIWaypoint.Cast(child.GetOwner());
645  if (!waypoint)
646  return;
647 
648  if (isAdded)
649  {
650  //--- Check for duplicates, one waypoint can be added multiple times
651  array<AIWaypoint> waypoints = {};
652  m_Group.GetWaypoints(waypoints);
653  if (waypoints.Find(waypoint) == -1)
654  m_Group.AddWaypoint(waypoint);
655  }
656  else
657  {
658  m_Group.RemoveWaypoint(waypoint);
659  }
660 
661  break;
662  }
663  }
664  }
665 
666  //------------------------------------------------------------------------------------------------
667  override void OnPostInit(IEntity owner)
668  {
669  if (DiagMenu.GetValue(SCR_DebugMenuID.DEBUGUI_EDITOR_ENTITIES_DISABLE))
670  return;
671 
672  super.OnPostInit(owner);
673 
674  if (m_Group)
675  {
676  //--- Track group's events (no need to remove them, the group gets detsroyed when the component does)
677  if (IsServer())
678  {
679  //m_Group.GetOnEmpty().Insert(OnEmpty);
680  m_Group.GetOnAgentAdded().Insert(OnAgentAdded);
681  m_Group.GetOnAgentRemoved().Insert(OnAgentRemoved);
682  m_Group.GetOnLeaderChanged().Insert(OnLeaderChanged);
683  m_Group.GetOnCurrentWaypointChanged().Insert(OnCurrentWaypointChanged);
684  m_Group.GetOnWaypointCompleted().Insert(OnWaypointCompleted);
685  m_Group.GetOnWaypointAdded().Insert(OnWaypointAdded);
686  m_Group.GetOnWaypointRemoved().Insert(OnWaypointRemoved);
687  }
688 
689  //On faction changed
690  m_Group.GetOnFactionChanged().Insert(OnFactionChanged);
691 
692  SCR_GroupIdentityComponent groupIdentity = SCR_GroupIdentityComponent.Cast(owner.FindComponent(SCR_GroupIdentityComponent));
693  if (groupIdentity)
694  groupIdentity.GetOnIdentityChange().Insert(OnIdentityChange);
695  }
696  }
697 
698  //------------------------------------------------------------------------------------------------
699  // constructor
703  void SCR_EditableGroupComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
704  {
705  m_Group = SCR_AIGroup.Cast(ent);
706 
707  //--- Check if attached to correct entity type. Needs to be SCR_AIGroup, not just AIGroup, because it requires certain events.
708  if (!m_Group)
709  Print("SCR_EditableGroupComponent must be on SCR_AIGroup!", LogLevel.ERROR);
710 
711  //--- Check if entity type was configured correctly. Only in Workbench, no need to read sources in run-time.
712  if (SCR_Global.IsEditMode(ent) && SCR_EditableGroupComponentClass.GetEntityType(src) != EEditableEntityType.GROUP)
713  Print("SCR_EditableGroupComponent entity type must be set to GROUP!", LogLevel.ERROR);
714  }
715 }
ComponentEditorProps
SCR_FragmentEntityClass ComponentEditorProps
OnFactionChanged
protected void OnFactionChanged(Faction faction)
Definition: SCR_EditableGroupComponent.c:189
SCR_MilitarySymbol
Definition: SCR_MilitarySymbol.c:2
GetAIEntity
override SCR_EditableEntityComponent GetAIEntity()
Definition: SCR_EditableGroupComponent.c:256
OnParentEntityChanged
override void OnParentEntityChanged(SCR_EditableEntityComponent parentEntity, SCR_EditableEntityComponent parentEntityPrev, bool changedByUser)
Definition: SCR_EditableGroupComponent.c:502
IsDestroyed
override bool IsDestroyed()
Definition: SCR_EditableGroupComponent.c:433
SCR_EditableEntityCoreBudgetSetting
Definition: SCR_EditableEntityCoreBudgetSetting.c:2
m_PlacedEditorComponent
protected SCR_PlacingEditorComponent m_PlacedEditorComponent
Definition: SCR_EditableGroupComponent.c:43
OnChildEntityChanged
override void OnChildEntityChanged(SCR_EditableEntityComponent child, bool isAdded)
Definition: SCR_EditableGroupComponent.c:597
GetOnUIRefresh
override ScriptInvoker GetOnUIRefresh()
Definition: SCR_EditableGroupComponent.c:230
Event_OnUIRefresh
protected ref ScriptInvoker Event_OnUIRefresh
Definition: SCR_EditableGroupComponent.c:38
RplProp
SCR_RplTestEntityClass RplProp
Used for handling entity spawning requests for SCR_CatalogEntitySpawnerComponent and inherited classe...
Destroy
override bool Destroy()
Definition: SCR_EditableGroupComponent.c:460
GetGame
ArmaReforgerScripted GetGame()
Definition: game.c:1424
GetChild
override SCR_EditableEntityComponent GetChild(int index)
Definition: SCR_EditableGroupComponent.c:392
CanDestroy
override bool CanDestroy()
Definition: SCR_EditableGroupComponent.c:418
ClearWaypoints
void ClearWaypoints()
Remove all waypoints from the group.
Definition: SCR_EditableGroupComponent.c:295
OnIdentityChange
protected void OnIdentityChange(SCR_MilitarySymbol symbol, LocalizedString name)
Definition: SCR_EditableGroupComponent.c:206
GetWaypointCount
int GetWaypointCount()
Definition: SCR_EditableGroupComponent.c:275
ReindexWaypoints
protected void ReindexWaypoints()
Definition: SCR_EditableGroupComponent.c:126
GetInfo
override SCR_UIInfo GetInfo(IEntity owner=null)
Definition: SCR_EditablePlayerDelegateComponent.c:140
ECompartmentType
ECompartmentType
Definition: ECompartmentType.c:7
OnCreatedServer
override void OnCreatedServer(notnull SCR_PlacingEditorComponent placedEditorComponent)
Definition: SCR_EditableGroupComponent.c:552
SCR_EditableGroupComponent
void SCR_EditableGroupComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
Definition: SCR_EditableGroupComponent.c:703
GetRplComponent
RplComponent GetRplComponent()
Returns the replication component associated to this entity.
Definition: SCR_RespawnComponent.c:200
EEditableEntityBudget
EEditableEntityBudget
Definition: EEditableEntityBudget.c:1
SCR_BudgetEditorComponent
Definition: SCR_BudgetEditorComponent.c:18
GetAIGroup
override SCR_EditableEntityComponent GetAIGroup()
Definition: SCR_EditableGroupComponent.c:250
GetRuntimeBudgetCost
void GetRuntimeBudgetCost(out notnull array< ref SCR_EntityBudgetValue > outBudgets)
Definition: SCR_EditableGroupComponent.c:324
m_Group
SCR_EditableGroupComponentClass m_Group
Special configuration for editable group.
ForceVehicleCompartments
override void ForceVehicleCompartments(notnull array< ECompartmentType > forceVehicleCompartments)
Definition: SCR_EditableGroupComponent.c:490
SetVisible
void SetVisible(int layer)
Definition: SCR_ServicePointMapDescriptorComponent.c:95
OnCurrentWaypointChanged
protected void OnCurrentWaypointChanged(AIWaypoint currentWP, AIWaypoint prevWP)
Definition: SCR_EditableGroupComponent.c:92
OnLeaderIdChanged
protected void OnLeaderIdChanged()
Definition: SCR_EditableGroupComponent.c:172
GetEntityBudgetCost
override bool GetEntityBudgetCost(out notnull array< ref SCR_EntityBudgetValue > outBudgets, IEntity owner=null)
Definition: SCR_EditableGroupComponent.c:317
OnAgentRemoved
protected void OnAgentRemoved(SCR_AIGroup group, AIAgent child)
Definition: SCR_EditableGroupComponent.c:63
EEditableEntityType
EEditableEntityType
Defines type of SCR_EditableEntityComponent. Assigned automatically based on IEntity inheritance.
Definition: EEditableEntityType.c:5
OnPostInit
override void OnPostInit(IEntity owner)
Called on PostInit when all components are added.
Definition: SCR_EditableGroupComponent.c:667
m_Entities
protected ref SCR_SortedArray< SCR_EditableEntityComponent > m_Entities
Definition: SCR_EntitiesToolbarEditorUIComponent.c:31
SCR_EntityBudgetValue
Definition: SCR_EntityBudgetValue.c:2
Refresh
bool Refresh()
Definition: SCR_HintManagerComponent.c:185
HideIfEmpty
void HideIfEmpty()
Definition: SCR_EditableGroupComponent.c:449
GetOwner
IEntity GetOwner()
Owner entity of the fuel tank.
Definition: SCR_FuelNode.c:128
SCR_EditableEntityComponent
Definition: SCR_EditableEntityComponent.c:13
Faction
Definition: Faction.c:12
SCR_EditableGroupComponentClass
Definition: SCR_EditableGroupComponent.c:2
m_LeaderId
protected RplId m_LeaderId
Definition: SCR_EditableGroupComponent.c:34
OnAllMembersSpawned
void OnAllMembersSpawned(SCR_AIGroup group)
Definition: SCR_EditableGroupComponent.c:578
index
SCR_DestructionSynchronizationComponentClass ScriptComponentClass int index
Definition: SCR_DestructionSynchronizationComponent.c:17
SCR_Global
Definition: Functions.c:6
GetFaction
override Faction GetFaction()
Definition: SCR_EditableGroupComponent.c:236
GetSize
int GetSize()
Definition: SCR_EditableGroupComponent.c:264
OnWaypointRemoved
protected void OnWaypointRemoved(AIWaypoint wp)
Definition: SCR_EditableGroupComponent.c:115
OnLeaderChanged
protected void OnLeaderChanged(AIAgent currentLeader, AIAgent prevLeader)
Definition: SCR_EditableGroupComponent.c:75
SCR_AIGroup
Definition: SCR_AIGroup.c:68
OnWaypointAdded
protected void OnWaypointAdded(AIWaypoint wp)
Definition: SCR_EditableGroupComponent.c:104
OnWaypointCompleted
protected void OnWaypointCompleted(AIWaypoint wp)
Definition: SCR_EditableGroupComponent.c:98
SCR_EditableGroupUIInfo
Definition: SCR_EditableGroupUIInfo.c:2
GetChildren
void GetChildren(out array< SCR_ScenarioFrameworkLayerBase > children)
Definition: SCR_ScenarioFrameworkLayerBase.c:359
m_Leader
protected SCR_EditableEntityComponent m_Leader
Definition: SCR_EditableGroupComponent.c:36
SCR_EditableEntityComponentClass
Definition: SCR_EditableEntityComponentClass.c:2
SCR_DebugMenuID
SCR_DebugMenuID
This enum contains all IDs for DiagMenu entries added in script.
Definition: DebugMenuID.c:3
SCR_PlacingEditorComponent
Definition: SCR_PlacingEditorComponent.c:118
LocalizedString
Definition: LocalizedString.c:21
CanDuplicate
override bool CanDuplicate(out notnull set< SCR_EditableEntityComponent > outRecipients)
Definition: SCR_EditableGroupComponent.c:386
GetPrefabBudgetCost
void GetPrefabBudgetCost(out notnull array< ref SCR_EntityBudgetValue > outBudgets)
Definition: SCR_EditableGroupComponent.c:350
GetPos
override bool GetPos(out vector pos)
Definition: SCR_EditableGroupComponent.c:405
SetLeader
protected void SetLeader(SCR_EditableEntityComponent leader)
Definition: SCR_EditableGroupComponent.c:179
Log
override void Log()
Definition: SCR_VotingBase.c:75
m_aForceSpawnVehicleCompartments
protected ref array< ECompartmentType > m_aForceSpawnVehicleCompartments
Definition: SCR_EditableGroupComponent.c:41
OnAgentAdded
protected void OnAgentAdded(AIAgent child)
Definition: SCR_EditableGroupComponent.c:51
category
params category
Definition: SCR_VehicleDamageManagerComponent.c:180
m_GroupInfo
protected ref SCR_EditableGroupUIInfo m_GroupInfo
Definition: SCR_EditableGroupComponent.c:37
GetAIGroupComponent
SCR_AIGroup GetAIGroupComponent()
Definition: SCR_EditableGroupComponent.c:224