Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_RestrictedDeployableSpawnPointComponent.c
Go to the documentation of this file.
1 [EntityEditorProps(category: "GameScripted/DeployableItems", description: "")]
3 {
4 }
5 
6 //------------------------------------------------------------------------------------------------
8 class SCR_RestrictedDeployableSpawnPointComponent : SCR_BaseDeployableSpawnPointComponent
9 {
10  [Attribute(defvalue: "1")]
11  protected int m_iMaxSpawnPointsPerGroup;
12 
13  [Attribute(defvalue: "10")]
14  protected int m_iMaxRespawns;
15 
16  [Attribute(defvalue: "1", desc: "Check if bases are nearby before deploying")]
17  protected bool m_bQueryBases;
18 
19  [Attribute(defvalue: "0", desc: "Check if spawn points are nearby before deploying")]
20  protected bool m_bQuerySpawnPoints;
21 
22  [Attribute(defvalue: "0", desc: "Check if characters are nearby before deploying")]
23  protected bool m_bQueryCharacters;
24 
25  [Attribute(defvalue: "300.0", desc: "Query radius for military bases")]
26  protected float m_fQueryRadiusBases;
27 
28  [Attribute(defvalue: "250.0", desc: "Query radius for other existing spawn points")]
29  protected float m_fQueryRadiusSpawnPoints;
30 
31  [Attribute(defvalue: "100.0", desc: "Query radius for enemy characters")]
32  protected float m_fQueryRadiusCharacters;
33 
34  [Attribute(defvalue: "0", desc: "Query all military bases, not just Main Operating Bases")]
35  protected bool m_bQueryAllBases;
36 
37  [Attribute(defvalue: "0")]
38  protected bool m_bIgnoreEnemyBases;
39 
40  [Attribute(defvalue: "0")]
41  protected bool m_bIgnoreEnemySpawnPoints;
42 
43  [Attribute(defvalue: "0")]
44  protected bool m_bIgnoreEnemyCharacters;
45 
46  [Attribute(defvalue: "0")]
47  protected bool m_bUnlockActionsForEnemyFactions;
48 
49  [Attribute(defvalue: "0")]
50  protected bool m_bAllowAllGroupsToSpawn;
51 
52  [Attribute(defvalue: "0")]
53  protected bool m_bUnlockActionsForAllGroups;
54 
55  [Attribute(defvalue: "1", desc: "Play audio cue once spawn point can/cannot be deployed")]
56  protected bool m_bPlaySoundOnZoneEntered;
57 
58  [Attribute(defvalue: "1", desc: "Show notification once spawn point can/cannot be deployed")]
59  protected bool m_bShowNotificationOnZoneEntered;
60 
61  [Attribute(defvalue: "1.0", desc: "Rate at which spawn point will check if it can be deployed or not")]
62  protected float m_fUpdateRate;
63 
64  [Attribute(defvalue: "#AR-DeployableSpawnPoints_UserAction_OutsideDeployArea")]
65  protected string m_sOutsideDeployAreaMessage;
66 
67  [Attribute(defvalue: "#AR-DeployableSpawnPoints_UserAction_DeployLimitReached")]
68  protected string m_sDeployLimitReachedMessage;
69 
70  [Attribute(defvalue: "#AR-DeployableSpawnPoints_UserAction_NoGroupJoined")]
71  protected string m_sNoGroupJoinedMessage;
72 
73  [RplProp()]
74  protected int m_iGroupID = -1;
75 
76  [RplProp()]
77  protected bool m_bIsOutsideExclusionZone;
78 
79  protected bool m_bIsGroupLimitReached;
80  protected bool m_bNoGroupJoined;
81 
82  protected static ref array<int> s_aActiveDeployedSpawnPointGroupIDs = {};
83 
84  protected int m_iRespawnCount;
85 
86  protected bool m_bSpawnLimitReached;
87  protected bool m_bIsWornByPlayer;
88 
89  protected float m_fTimeSinceUpdate;
90 
91 #ifdef ENABLE_DIAG
92  protected static ref array<ref Shape> s_aDebugShapes = {};
93 #endif
94 
95  //------------------------------------------------------------------------------------------------
96  [RplRpc(RplChannel.Reliable, RplRcver.Broadcast)]
97  protected void RPC_AddSpawnPointGroupBroadcast(int groupID)
98  {
99  s_aActiveDeployedSpawnPointGroupIDs.Insert(groupID);
100  }
101 
102  //------------------------------------------------------------------------------------------------
103  [RplRpc(RplChannel.Reliable, RplRcver.Broadcast)]
104  protected void RPC_RemoveSpawnPointGroupBroadcast(int groupID)
105  {
106  s_aActiveDeployedSpawnPointGroupIDs.RemoveItem(groupID);
107  }
108 
109  //------------------------------------------------------------------------------------------------
110  [RplRpc(RplChannel.Unreliable, RplRcver.Broadcast)]
111  protected void RPC_PlaySoundOnZoneEnteredBroadcast(bool entered)
112  {
113  SoundComponent soundComp = SoundComponent.Cast(GetOwner().FindComponent(SoundComponent));
114  if (!soundComp)
115  return;
116 
117  if (entered)
118  soundComp.SoundEvent(SCR_SoundEvent.SOUND_DEPLOYED_RADIO_ENTER_ZONE);
119  else
120  soundComp.SoundEvent(SCR_SoundEvent.SOUND_DEPLOYED_RADIO_EXIT_ZONE);
121  }
122 
123  //------------------------------------------------------------------------------------------------
125  protected bool EntityQuery(notnull array<IEntity> entities, notnull Faction spawnPointFaction, vector spawnPointOrigin)
126  {
127  if (entities.IsEmpty())
128  return true;
129 
130  float queryRadius = 100; // Default 100 meters
131  bool isBase, isSpawnPoint, isCharacter;
132 
133  if (SCR_MilitaryBaseComponent.Cast(entities[0].FindComponent(SCR_MilitaryBaseComponent)))
134  {
135  queryRadius = m_fQueryRadiusBases;
136  isBase = true;
137  }
138  else if (SCR_SpawnPoint.Cast(entities[0]))
139  {
140  queryRadius = m_fQueryRadiusSpawnPoints;
141  isSpawnPoint = true;
142  }
143  else if (SCR_ChimeraCharacter.Cast(entities[0]))
144  {
145  queryRadius = m_fQueryRadiusCharacters;
146  isCharacter = true;
147  }
148 
149  float radiusSq = queryRadius * queryRadius;
150 
151  foreach (IEntity e : entities)
152  {
153  vector origin = e.GetOrigin();
154 
155 #ifdef ENABLE_DIAG
156  if (DiagMenu.GetBool(SCR_DebugMenuID.DEBUGUI_DEPLOYABLE_SPAWNPOINTS_ENABLE_DIAG))
157  s_aDebugShapes.Insert(Shape.CreateSphere(Color.RED, ShapeFlags.WIREFRAME, origin, queryRadius));
158 #endif
159 
160  float distanceToItemSq = vector.DistanceSq(spawnPointOrigin, origin);
161  bool isWithinRadius = distanceToItemSq < radiusSq;
162 
163  if (!isWithinRadius)
164  continue;
165 
166  SCR_Faction faction = SCR_Faction.Cast(SCR_Faction.GetEntityFaction(e));
167  if (!faction)
168  return false;
169 
170  bool isFriendlyFaction = faction.DoCheckIfFactionFriendly(spawnPointFaction);
171 
172  if (isBase)
173  {
174  if (isFriendlyFaction)
175  return false;
176 
177  if (!isFriendlyFaction && !m_bIgnoreEnemyBases)
178  return false;
179  }
180  else if (isSpawnPoint)
181  {
182  if (isFriendlyFaction)
183  return false;
184 
185  if (!isFriendlyFaction && !m_bIgnoreEnemySpawnPoints)
186  return false;
187  }
188  else if (isCharacter)
189  {
190  if (!isFriendlyFaction && !m_bIgnoreEnemyCharacters)
191  return false;
192  }
193  }
194 
195  return true;
196  }
197 
198  //------------------------------------------------------------------------------------------------
199  protected bool CanActionBeShown(notnull IEntity userEntity, bool checkCanDeploy, bool checkFaction = true, bool checkGroupID = true)
200  {
201  if (!s_bDeployableSpawnPointsEnabled)
202  return false;
203 
204  FactionAffiliationComponent factionAffiliation = FactionAffiliationComponent.Cast(userEntity.FindComponent(FactionAffiliationComponent));
205  if (!factionAffiliation)
206  return false;
207 
208  Faction affiliatedFaction = factionAffiliation.GetAffiliatedFaction();
209  if (!affiliatedFaction)
210  return false;
211 
212  FactionKey userFactionKey = affiliatedFaction.GetFactionKey();
213  if (!userFactionKey)
214  return false;
215 
216  if (userFactionKey != m_FactionKey && !m_bUnlockActionsForEnemyFactions && checkFaction)
217  return false;
218 
219  SCR_PossessingManagerComponent possessingManagerComp = SCR_PossessingManagerComponent.GetInstance();
220  if (!possessingManagerComp)
221  return false;
222 
223  int userID = possessingManagerComp.GetIdFromControlledEntity(userEntity);
224 
225  SCR_PlayerControllerGroupComponent playerControllerGroupComp = SCR_PlayerControllerGroupComponent.GetPlayerControllerComponent(userID);
226  if (!playerControllerGroupComp)
227  return false;
228 
229  int userGroupID = playerControllerGroupComp.GetGroupID();
230 
231  if (userFactionKey == m_FactionKey && userGroupID != m_iGroupID && !m_bUnlockActionsForAllGroups && checkGroupID)
232  return false;
233 
234  return true;
235  }
236 
237  //------------------------------------------------------------------------------------------------
238  protected bool CanBeDeployedAtPosition(vector position, IEntity userEntity, out int notification = -1)
239  {
240  array<IEntity> entities = {};
241 
242  FactionManager factionManager = GetGame().GetFactionManager();
243  if (!factionManager)
244  return false;
245 
246  SCR_Faction faction = SCR_Faction.Cast(factionManager.GetFactionByKey(m_FactionKey));
247 
248  // Check for nearby bases and prevent deploy if there are any
249  if (m_bQueryBases)
250  {
251  SCR_MilitaryBaseSystem baseManager = SCR_MilitaryBaseSystem.GetInstance();
252  if (!baseManager)
253  return false;
254 
255  array<SCR_MilitaryBaseComponent> baseComponents = {};
256 
257  baseManager.GetBases(baseComponents);
258 
259  foreach (SCR_MilitaryBaseComponent baseComponent : baseComponents)
260  {
261  if (m_bQueryAllBases)
262  {
263  entities.Insert(baseComponent.GetOwner());
264  continue;
265  }
266 
267  SCR_CampaignMilitaryBaseComponent campaignBaseComponent = SCR_CampaignMilitaryBaseComponent.Cast(baseComponent);
268  if (!campaignBaseComponent || !campaignBaseComponent.IsHQ())
269  continue;
270 
271  entities.Insert(baseComponent.GetOwner());
272  }
273 
274  if (!EntityQuery(entities, faction, position))
275  {
276  notification = ENotification.DEPLOYABLE_SPAWNPOINTS_ZONE_EXITED;
277  return false;
278  }
279  }
280 
281  // Check for nearby spawnpoints and prevent deploy if there are any
282  if (m_bQuerySpawnPoints)
283  {
284  entities = {};
285 
286  array<SCR_SpawnPoint> spawnPoints = SCR_SpawnPoint.GetSpawnPoints();
287 
288  foreach (SCR_SpawnPoint spawnPoint : spawnPoints)
289  {
290  if (!SCR_PlayerRadioSpawnPoint.Cast(spawnPoint))
291  entities.Insert(spawnPoint);
292  }
293 
294  if (!EntityQuery(entities, faction, position))
295  {
296  notification = ENotification.DEPLOYABLE_SPAWNPOINTS_ZONE_EXITED;
297  return false;
298  }
299  }
300 
301  // Check for nearby enemy characters and prevent deploy if there are any
302  if (m_bQueryCharacters)
303  {
304  entities = {};
305 
306  array<SCR_ChimeraCharacter> characters = SCR_CharacterRegistrationComponent.GetChimeraCharacters();
307  if (!characters)
308  return false;
309 
310  foreach (SCR_ChimeraCharacter character : characters)
311  {
312  if (character == userEntity || character.GetCharacterController().IsDead())
313  continue;
314 
315  entities.Insert(character);
316  }
317 
318  if (!EntityQuery(entities, faction, position))
319  {
320  notification = ENotification.DEPLOYABLE_SPAWNPOINTS_ZONE_EXITED;
321  return false;
322  }
323  }
324 
325  notification = ENotification.DEPLOYABLE_SPAWNPOINTS_ZONE_ENTERED;
326  return true;
327  }
328 
329  //------------------------------------------------------------------------------------------------
330  protected bool IsDeployLimitReachedLocal()
331  {
332  SCR_GroupsManagerComponent groupsManager = SCR_GroupsManagerComponent.GetInstance();
333  if (!groupsManager)
334  return false;
335 
336  SCR_AIGroup group = groupsManager.GetPlayerGroup(SCR_PlayerController.GetLocalPlayerId());
337  if (!group)
338  {
339  m_bNoGroupJoined = true;
340  return false;
341  }
342 
343  m_bNoGroupJoined = false;
344  return group.GetDeployedRadioCount() >= m_iMaxSpawnPointsPerGroup;
345  }
346 
347  //------------------------------------------------------------------------------------------------
349  override void Deploy(IEntity userEntity)
350  {
351  if (!m_RplComponent || m_RplComponent.IsProxy())
352  return;
353 
354  int userID = GetGame().GetPlayerManager().GetPlayerIdFromControlledEntity(userEntity);
355 
356  SCR_PlayerControllerGroupComponent playerControllerGroupComp = SCR_PlayerControllerGroupComponent.GetPlayerControllerComponent(userID);
357  if (!playerControllerGroupComp)
358  return;
359 
360  m_iGroupID = playerControllerGroupComp.GetGroupID();
361  Replication.BumpMe();
362 
363  SCR_GroupsManagerComponent groupsManager = SCR_GroupsManagerComponent.GetInstance();
364  if (!groupsManager)
365  return;
366 
367  SCR_AIGroup playerGroup = groupsManager.FindGroup(m_iGroupID);
368  if (!playerGroup)
369  return;
370 
371  playerGroup.IncreaseDeployedRadioCount();
372 
373  super.Deploy(userEntity);
374 
375  if (!m_SpawnPoint)
376  return;
377 
379  if (!restrictedSpawnPoint)
380  return;
381 
382  restrictedSpawnPoint.SetRespawnCount(m_iRespawnCount);
383  restrictedSpawnPoint.SetMaxRespawns(m_iMaxRespawns);
384 
385  restrictedSpawnPoint.SetAllowAllGroupsToSpawn(m_bAllowAllGroupsToSpawn);
386  restrictedSpawnPoint.SetGroupID(m_iGroupID);
387  }
388 
389  //------------------------------------------------------------------------------------------------
391  override void Dismantle(IEntity userEntity = null)
392  {
393  if (!m_RplComponent || m_RplComponent.IsProxy())
394  return;
395 
397  if (!restrictedSpawnPoint)
398  return;
399 
400  m_iRespawnCount = restrictedSpawnPoint.GetRespawnCount();
401 
402  SCR_GroupsManagerComponent groupsManager = SCR_GroupsManagerComponent.GetInstance();
403  if (!groupsManager)
404  return;
405 
406  SCR_AIGroup playerGroup = groupsManager.FindGroup(m_iGroupID);
407  if (!playerGroup)
408  return;
409 
410  playerGroup.DecreaseDeployedRadioCount();
411 
412  m_iGroupID = -1; // reset groupID
413  Replication.BumpMe();
414 
415  super.Dismantle(userEntity);
416  }
417 
418  //------------------------------------------------------------------------------------------------
420  void ShowInfo(notnull IEntity userEntity)
421  {
422  SCR_PossessingManagerComponent possessingManagerComp = SCR_PossessingManagerComponent.GetInstance();
423  if (!possessingManagerComp)
424  return;
425 
426  int userID = possessingManagerComp.GetIdFromControlledEntity(userEntity);
427  int respawnsLeft = m_iMaxRespawns - m_iRespawnCount;
428 
429  if (!m_bIsDeployed || m_bAllowAllGroupsToSpawn)
430  {
431  SCR_NotificationsComponent.SendToPlayer(userID, ENotification.DEPLOYABLE_SPAWNPOINTS_DISPLAY_RESPAWN_COUNT, respawnsLeft, m_iMaxRespawns);
432  return;
433  }
434 
435  SCR_PlayerControllerGroupComponent playerControllerGroupComp = SCR_PlayerControllerGroupComponent.GetPlayerControllerComponent(userID);
436  if (!playerControllerGroupComp)
437  return;
438 
439  int userGroupID = playerControllerGroupComp.GetGroupID();
440 
441  if (userGroupID != m_iGroupID)
442  {
443  SCR_NotificationsComponent.SendToPlayer(userID, ENotification.DEPLOYABLE_SPAWNPOINTS_DISPLAY_GROUP, m_iGroupID);
444  return;
445  }
446 
447  SCR_NotificationsComponent.SendToPlayer(userID, ENotification.DEPLOYABLE_SPAWNPOINTS_DISPLAY_RESPAWN_COUNT, respawnsLeft, m_iMaxRespawns);
448  }
449 
450  //------------------------------------------------------------------------------------------------
453  bool CanDeployBePerformed(out string reason)
454  {
455  if (m_bNoGroupJoined)
456  reason = m_sNoGroupJoinedMessage;
457  else if (m_bIsGroupLimitReached)
458  reason = m_sDeployLimitReachedMessage;
459  else if (!m_bIsOutsideExclusionZone)
460  reason = m_sOutsideDeployAreaMessage;
461 
462  return m_bIsOutsideExclusionZone && !m_bIsGroupLimitReached && !m_bNoGroupJoined;
463  }
464 
465  //------------------------------------------------------------------------------------------------
466  override bool CanDeployBeShown(notnull IEntity userEntity)
467  {
468  if (!CanActionBeShown(userEntity, true, checkGroupID : false))
469  return false;
470 
471  return !m_bIsDeployed;
472  }
473 
474  //------------------------------------------------------------------------------------------------
475  override bool CanDismantleBeShown(notnull IEntity userEntity)
476  {
477  if (!CanActionBeShown(userEntity, false, checkFaction : false))
478  return false;
479 
480  return m_bIsDeployed;
481  }
482 
483  //------------------------------------------------------------------------------------------------
486  bool CanInfoBeShown(notnull IEntity userEntity)
487  {
488  return CanActionBeShown(userEntity, !m_bIsDeployed, checkGroupID : false);
489  }
490 
491  //------------------------------------------------------------------------------------------------
494  {
495  return m_bAllowAllGroupsToSpawn;
496  }
497 
498  //------------------------------------------------------------------------------------------------
501  {
502  return m_bIgnoreEnemyCharacters;
503  }
504 
505  //------------------------------------------------------------------------------------------------
508  {
509  return m_iGroupID;
510  }
511 
512  //------------------------------------------------------------------------------------------------
515  {
516  return m_fQueryRadiusCharacters;
517  }
518 
519  //------------------------------------------------------------------------------------------------
521  void SetRespawnCount(int respawnCount)
522  {
523  m_iRespawnCount = respawnCount;
524  }
525 
526  //------------------------------------------------------------------------------------------------
527  protected void OnGroupRemoved(SCR_AIGroup group)
528  {
529  SCR_GroupsManagerComponent groupsManager = SCR_GroupsManagerComponent.GetInstance();
530  if (!groupsManager)
531  return;
532 
533  SCR_AIGroup itemGroup = groupsManager.FindGroup(m_iGroupID);
534 
535  if (group == itemGroup)
536  Dismantle(); // Dismantle item if removed group is the same as the item group; otherwise deployed item would be unusable
537  }
538 
539  //------------------------------------------------------------------------------------------------
540  override void Update(float timeSlice)
541  {
542  super.Update(owner, timeSlice);
543 
544  if (m_fTimeSinceUpdate < m_fUpdateRate)
545  {
546  m_fTimeSinceUpdate += timeSlice;
547  return;
548  }
549 
550  m_fTimeSinceUpdate = 0;
551 
552  //timed execution
553 
554 #ifdef ENABLE_DIAG
555  if (m_bIsWornByPlayer)
556  s_aDebugShapes.Clear();
557 #endif
558 
559  if (!s_bDeployableSpawnPointsEnabled)
560  return;
561 
562  m_bIsGroupLimitReached = IsDeployLimitReachedLocal();
563 
564  if (!m_RplComponent || m_RplComponent.IsProxy())
565  return;
566 
567  //server code
568 
570  if (!item)
571  return;
572 
573  InventoryStorageSlot parentSlot = item.GetParentSlot();
574  if (!parentSlot)
575  {
576  m_bIsWornByPlayer = false;
577  return;
578  }
579 
580  IEntity parentEntity;
581  while (parentSlot)
582  {
583  parentEntity = parentSlot.GetStorage().GetOwner();
584  parentSlot = parentSlot.GetStorage().GetParentSlot();
585  }
586 
587  if (!parentEntity || !SCR_ChimeraCharacter.Cast(parentEntity))
588  {
589  m_bIsWornByPlayer = false;
590  return;
591  }
592 
593  int userID = GetGame().GetPlayerManager().GetPlayerIdFromControlledEntity(parentEntity);
594  if (userID <= 0)
595  {
596  m_bIsWornByPlayer = false;
597  return;
598  }
599 
600  FactionAffiliationComponent factionAffiliation = FactionAffiliationComponent.Cast(parentEntity.FindComponent(FactionAffiliationComponent));
601  if (!factionAffiliation)
602  return;
603 
604  Faction affiliatedFaction = factionAffiliation.GetAffiliatedFaction();
605  if (!affiliatedFaction)
606  return;
607 
608  FactionKey userFactionKey = affiliatedFaction.GetFactionKey();
609  if (!userFactionKey)
610  return;
611 
612  if (userFactionKey != m_FactionKey)
613  {
614  m_bIsWornByPlayer = false;
615  return;
616  }
617 
618  m_bIsWornByPlayer = true;
619 
620  int notification;
621  bool canBeDeployedAtPos = CanBeDeployedAtPosition(GetOwner().GetOrigin(), parentEntity, notification);
622 
623  if (m_bIsOutsideExclusionZone == canBeDeployedAtPos)
624  return;
625 
626  m_bIsOutsideExclusionZone = canBeDeployedAtPos;
627  Replication.BumpMe();
628 
629  if (m_bShowNotificationOnZoneEntered && notification > -1)
630  SCR_NotificationsComponent.SendToPlayer(userID, notification);
631 
632  if (m_bEnableSounds && m_bPlaySoundOnZoneEntered)
633  {
634  RPC_PlaySoundOnZoneEnteredBroadcast(canBeDeployedAtPos);
635  Rpc(RPC_PlaySoundOnZoneEnteredBroadcast, canBeDeployedAtPos);
636  }
637  }
638 
639  //------------------------------------------------------------------------------------------------
640  override void EOnInit(IEntity owner)
641  {
642  super.EOnInit(owner);
643 
645 
646  if (!m_RplComponent || m_RplComponent.IsProxy())
647  return;
648 
649  SCR_GroupsManagerComponent groupsManager = SCR_GroupsManagerComponent.GetInstance();
650  if (!groupsManager)
651  return;
652 
653  //first position check for items that are pre-placed in editor
654  int dummyNotification;
655  m_bIsOutsideExclusionZone = CanBeDeployedAtPosition(GetOwner().GetOrigin(), null, dummyNotification);
656  Replication.BumpMe();
657 
658  groupsManager.GetOnPlayableGroupRemoved().Insert(OnGroupRemoved);
659  }
660 
661  //------------------------------------------------------------------------------------------------
662  override void OnDelete(IEntity owner)
663  {
665 
666  SCR_GroupsManagerComponent groupsManager = SCR_GroupsManagerComponent.GetInstance();
667  if (!groupsManager)
668  return;
669 
670  groupsManager.GetOnPlayableGroupRemoved().Remove(OnGroupRemoved);
671 
672  if (m_bIsDeployed && Replication.IsServer())
673  {
674  SCR_AIGroup playerGroup = groupsManager.FindGroup(m_iGroupID);
675  if (!playerGroup)
676  return;
677 
678  playerGroup.DecreaseDeployedRadioCount();
679  }
680 
681 #ifdef ENABLE_DIAG
682  if (m_bIsWornByPlayer)
683  s_aDebugShapes.Clear();
684 #endif
685 
686  super.OnDelete(owner);
687  }
688 }
CanDismantleBeShown
override bool CanDismantleBeShown(notnull IEntity userEntity)
Definition: SCR_RestrictedDeployableSpawnPointComponent.c:475
ShowInfo
void ShowInfo(notnull IEntity userEntity)
Display amount of respawns left - called from SCR_ShowItemInfo.PerformAction.
Definition: SCR_RestrictedDeployableSpawnPointComponent.c:420
SCR_BaseDeployableSpawnPointComponentClass
Definition: SCR_BaseDeployableSpawnPointComponent.c:2
SCR_PlayerController
Definition: SCR_PlayerController.c:31
m_bEnableSounds
protected bool m_bEnableSounds
Definition: SCR_BaseDeployableSpawnPointComponent.c:23
EntityEditorProps
enum EQueryType EntityEditorProps(category:"GameScripted/Sound", description:"THIS IS THE SCRIPT DESCRIPTION.", color:"0 0 255 255")
Definition: SCR_AmbientSoundsComponent.c:12
m_bIsDeployed
protected bool m_bIsDeployed
Definition: SCR_CampaignMobileAssemblyComponent.c:39
m_fTimeSinceUpdate
protected float m_fTimeSinceUpdate
Definition: SCR_RestrictedDeployableSpawnPointComponent.c:89
RPC_RemoveSpawnPointGroupBroadcast
protected void RPC_RemoveSpawnPointGroupBroadcast(int groupID)
Definition: SCR_RestrictedDeployableSpawnPointComponent.c:104
InventoryStorageSlot
Definition: InventoryStorageSlot.c:12
Deploy
override void Deploy(IEntity userEntity)
Check if deploy is possible, then call super.Deploy()
Definition: SCR_RestrictedDeployableSpawnPointComponent.c:349
CanBeDeployedAtPosition
protected bool CanBeDeployedAtPosition(vector position, IEntity userEntity, out int notification=-1)
Definition: SCR_RestrictedDeployableSpawnPointComponent.c:238
RplProp
SCR_RplTestEntityClass RplProp
Used for handling entity spawning requests for SCR_CatalogEntitySpawnerComponent and inherited classe...
GetIgnoreEnemyCharacters
bool GetIgnoreEnemyCharacters()
Definition: SCR_RestrictedDeployableSpawnPointComponent.c:500
GetGame
ArmaReforgerScripted GetGame()
Definition: game.c:1424
CanActionBeShown
protected bool CanActionBeShown(notnull IEntity userEntity, bool checkCanDeploy, bool checkFaction=true, bool checkGroupID=true)
Definition: SCR_RestrictedDeployableSpawnPointComponent.c:199
SCR_SoundEvent
Definition: SCR_SoundEvent.c:1
OnDelete
override void OnDelete(IEntity owner)
Definition: SCR_RestrictedDeployableSpawnPointComponent.c:662
IsDeployLimitReachedLocal
protected bool IsDeployLimitReachedLocal()
Definition: SCR_RestrictedDeployableSpawnPointComponent.c:330
SCR_MilitaryBaseSystem
Definition: SCR_MilitaryBaseSystem.c:11
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition: SCR_RespawnBriefingComponent.c:17
SetRespawnCount
void SetRespawnCount(int respawnCount)
Definition: SCR_RestrictedDeployableSpawnPointComponent.c:521
RplRpc
SCR_AchievementsHandlerClass ScriptComponentClass RplRpc(RplChannel.Reliable, RplRcver.Owner)] void UnlockOnClient(AchievementId achievement)
Definition: SCR_AchievementsHandler.c:11
SCR_SpawnPoint
Spawn point entity defines positions on which players can possibly spawn.
Definition: SCR_SpawnPoint.c:27
SCR_RestrictedDeployableSpawnPointComponentClass
Definition: SCR_RestrictedDeployableSpawnPointComponent.c:2
GetGroupID
int GetGroupID()
Definition: SCR_RestrictedDeployableSpawnPointComponent.c:507
Dismantle
override void Dismantle(IEntity userEntity=null)
Cache respawn count; then call super.Dismantle()
Definition: SCR_RestrictedDeployableSpawnPointComponent.c:391
CanInfoBeShown
bool CanInfoBeShown(notnull IEntity userEntity)
Definition: SCR_RestrictedDeployableSpawnPointComponent.c:486
RPC_PlaySoundOnZoneEnteredBroadcast
protected void RPC_PlaySoundOnZoneEnteredBroadcast(bool entered)
Definition: SCR_RestrictedDeployableSpawnPointComponent.c:111
m_bSpawnLimitReached
protected bool m_bSpawnLimitReached
Definition: SCR_RestrictedDeployableSpawnPointComponent.c:86
ENotification
ENotification
Definition: ENotification.c:4
CanDeployBePerformed
bool CanDeployBePerformed(out string reason)
Definition: SCR_RestrictedDeployableSpawnPointComponent.c:453
GetOrigin
vector GetOrigin()
Definition: SCR_AIUtilityComponent.c:279
SCR_CharacterRegistrationComponent
void SCR_CharacterRegistrationComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
Definition: SCR_CharacterRegistrationComponent.c:48
SCR_RestrictedDeployableSpawnPoint
Basically SCR_SpawnPoint with the ability to limit respawn amount.
Definition: SCR_RestrictedDeployableSpawnPoint.c:8
ConnectToDeployableSpawnPointSystem
protected void ConnectToDeployableSpawnPointSystem()
Definition: SCR_BaseDeployableSpawnPointComponent.c:261
DisconnectFromDeployableSpawnPointSystem
protected void DisconnectFromDeployableSpawnPointSystem()
Definition: SCR_BaseDeployableSpawnPointComponent.c:272
m_SpawnPoint
protected SCR_SpawnPoint m_SpawnPoint
Definition: SCR_CampaignMobileAssemblyComponent.c:28
GetOwner
IEntity GetOwner()
Owner entity of the fuel tank.
Definition: SCR_FuelNode.c:128
m_iRespawnCount
protected int m_iRespawnCount
Definition: SCR_RestrictedDeployableSpawnPointComponent.c:82
m_iGroupID
SCR_PlayerControllerGroupComponentClass m_iGroupID
EOnInit
override void EOnInit(IEntity owner)
Definition: SCR_RestrictedDeployableSpawnPointComponent.c:640
InventoryItemComponent
Definition: InventoryItemComponent.c:12
Faction
Definition: Faction.c:12
SCR_GroupsManagerComponent
void SCR_GroupsManagerComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
Definition: SCR_GroupsManagerComponent.c:1320
EntityQuery
protected bool EntityQuery(notnull array< IEntity > entities, notnull Faction spawnPointFaction, vector spawnPointOrigin)
Returns true when there are no entities in the specified area that could prevent deploying.
Definition: SCR_RestrictedDeployableSpawnPointComponent.c:125
m_RplComponent
protected RplComponent m_RplComponent
Definition: SCR_CampaignBuildingManagerComponent.c:42
Attribute
SCR_RestrictedDeployableSpawnPointComponentClass SCR_BaseDeployableSpawnPointComponentClass Attribute(defvalue:"1")
Deployable spawn point with configurable conditions.
Definition: SCR_RestrictedDeployableSpawnPointComponent.c:10
SCR_AIGroup
Definition: SCR_AIGroup.c:68
m_FactionKey
protected FactionKey m_FactionKey
Definition: SCR_BaseDeployableSpawnPointComponent.c:20
m_bIsWornByPlayer
protected bool m_bIsWornByPlayer
Definition: SCR_RestrictedDeployableSpawnPointComponent.c:87
Update
override void Update(float timeSlice)
Definition: SCR_RestrictedDeployableSpawnPointComponent.c:540
GetAllowAllGroupsToSpawn
bool GetAllowAllGroupsToSpawn()
Definition: SCR_RestrictedDeployableSpawnPointComponent.c:493
SCR_DebugMenuID
SCR_DebugMenuID
This enum contains all IDs for DiagMenu entries added in script.
Definition: DebugMenuID.c:3
position
vector position
Definition: SCR_DestructibleTreeV2.c:30
RPC_AddSpawnPointGroupBroadcast
protected void RPC_AddSpawnPointGroupBroadcast(int groupID)
Definition: SCR_RestrictedDeployableSpawnPointComponent.c:97
SCR_Faction
Definition: SCR_Faction.c:6
OnGroupRemoved
protected void OnGroupRemoved(SCR_AIGroup group)
Definition: SCR_RestrictedDeployableSpawnPointComponent.c:527
CanDeployBeShown
override bool CanDeployBeShown(notnull IEntity userEntity)
Definition: SCR_RestrictedDeployableSpawnPointComponent.c:466
GetQueryRadiusCharacters
float GetQueryRadiusCharacters()
Definition: SCR_RestrictedDeployableSpawnPointComponent.c:514
SCR_CampaignMilitaryBaseComponent
Definition: SCR_CampaignMilitaryBaseComponent.c:38
category
params category
Definition: SCR_VehicleDamageManagerComponent.c:180