Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_SpawnPoint.c
Go to the documentation of this file.
1[EntityEditorProps(category: "GameScripted/GameMode", description: "Spawn point entity", visible: false)]
3{
4 // [Attribute()]
5 // protected ref SCR_UIInfo m_Info;
6
7 // SCR_UIInfo GetInfo()
8 // {
9 // return m_Info;
10 // }
11}
12
15typedef ScriptInvokerBase<SpawnPointDelegateMethod> SpawnPointInvoker;
16
17void SpawnPointFinalizeSpawnInvoker(SCR_SpawnRequestComponent requestComponent, SCR_SpawnData data, IEntity entity);
19typedef ScriptInvokerBase<SpawnPointFinalizeSpawnInvoker> SCR_SpawnPointFinalizeSpawn_Invoker;
20
21void SpawnPointNameChangedInvoker(RplId id, string name);
23typedef ScriptInvokerBase<SpawnPointNameChangedInvoker> SCR_SpawnPointNameChanged_Invoker;
24
25//------------------------------------------------------------------------------------------------
28{
29 protected RplComponent m_RplComponent;
30 protected float m_fSpawnRadius = 10;
31 protected float m_fPlayerCylinderRadius = 0.5;
32 protected float m_fPlayerCylinderHeight = 2;
33 protected float m_fColliderWidth = m_fPlayerCylinderRadius * 1.73205;
36
37 [Attribute("0", UIWidgets.EditBox, "If bigger than 0, defines radius in which spawn will be randomized")]
39
40 [Attribute("", UIWidgets.EditBox, "Determines which faction can spawn on this spawn point."), RplProp(onRplName: "OnSetFactionKey")]
41 protected string m_sFaction;
42
43 [Attribute("0")]
44 protected bool m_bShowInDeployMapOnly;
45
46 [Attribute("0", desc: "Use custom timer when deploying on this spawn point. Takes the remaining respawn time from SCR_TimedSpawnPointComponent")]
47 protected bool m_bTimedSpawnPoint;
48
49 [RplProp(), SortAttribute(), Attribute("0", desc: "Priority of spawn point to be selected as default in spawn menu")]
50 protected int m_iPriority;
51
54
55 [Attribute()]
56 protected ref SCR_UIInfo m_Info;
57
58 [Attribute("0", desc: "Allow usage of Spawn Positions in range")]
60
61 [Attribute("100", desc: "Spawn position detection radius, in metres")]
63
64 [Attribute("0", desc: "Additional respawn time (in seconds) when spawning on this spawn point"), RplProp()]
65 protected float m_fRespawnTime;
66
67 [Attribute("0", desc: "Spawn directly in the location of the spawnpoint, ignoring any checks")]
68 protected bool m_bForcedPosition;
69
70 [Attribute("0", desc: "Spawn at a random place on the map")]
71 protected bool m_bRandomizedSpawn;
72
73 [Attribute("10", params: "1 inf", desc: "Random position attempt count")]
75
76 // List of all spawn points
77 private static ref array<SCR_SpawnPoint> m_aSpawnPoints = new array<SCR_SpawnPoint>();
78
79 static ref ScriptInvoker Event_OnSpawnPointCountChanged = new ScriptInvoker();
80 static ref ScriptInvoker Event_SpawnPointFactionAssigned = new ScriptInvoker();
81 static ref SpawnPointInvoker Event_SpawnPointAdded = new SpawnPointInvoker();
82 static ref SpawnPointInvoker Event_SpawnPointRemoved = new SpawnPointInvoker();
83 static ref SCR_SpawnPointFinalizeSpawn_Invoker s_OnSpawnPointFinalizeSpawn;
84
85 [RplProp()]
86 protected string m_sSpawnPointName;
87
89
90 // spawn point will work as a spawn point group if it has any SCR_Position as its children
91 protected ref array<SCR_Position> m_aChildren = {};
92
97 protected ref set<int> m_ReservationLocks = new set<int>();
98
100
101 [Attribute("1"), RplProp(onRplName: "OnSetEnabled")]
102 protected bool m_bSpawnPointEnabled;
103
104 //------------------------------------------------------------------------------------------------
106 {
107 return true;
108 }
109
110 //------------------------------------------------------------------------------------------------
112 {
114 }
115
116 //------------------------------------------------------------------------------------------------
117 void SetSpawnPointEnabled_S(bool enabled)
118 {
119 if (enabled == m_bSpawnPointEnabled)
120 return;
121
122 m_bSpawnPointEnabled = enabled;
123 OnSetEnabled();
124 Replication.BumpMe();
125 }
126
127 //------------------------------------------------------------------------------------------------
128 protected void OnSetEnabled()
129 {
132 }
133
134 //------------------------------------------------------------------------------------------------
142
143 //------------------------------------------------------------------------------------------------
145 {
146 if (!s_OnSpawnPointFinalizeSpawn)
147 s_OnSpawnPointFinalizeSpawn = new SCR_SpawnPointFinalizeSpawn_Invoker();
148
149 return s_OnSpawnPointFinalizeSpawn;
150 }
151
152 //------------------------------------------------------------------------------------------------
154 {
155 return m_fRespawnTime;
156 }
157
158 //------------------------------------------------------------------------------------------------
159 void SetRespawnTime(float time)
160 {
161 m_fRespawnTime = time;
162 Replication.BumpMe();
163 }
164
165 //------------------------------------------------------------------------------------------------
167 {
168 return m_iPriority;
169 }
170
171 //------------------------------------------------------------------------------------------------
172 void SetPriority(int priority)
173 {
174 if (priority == m_iPriority)
175 return;
176
177 m_iPriority = priority;
178 Replication.BumpMe();
179 }
180
181 //------------------------------------------------------------------------------------------------
191 bool CanReserveFor_S(int playerId, out SCR_ESpawnResult result = SCR_ESpawnResult.SPAWN_NOT_ALLOWED)
192 {
194 {
195 return true;
196 }
197 else
198 {
199 result = SCR_ESpawnResult.NOT_ALLOWED_SPAWNPOINT_DISABLED;
200 return false;
201 }
202 }
203
204 //------------------------------------------------------------------------------------------------
211 bool IsReservedFor_S(int playerId)
212 {
213 return m_ReservationLocks.Contains(playerId);
214 }
215
216 //------------------------------------------------------------------------------------------------
223 bool ReserveFor_S(int playerId)
224 {
225 #ifdef _ENABLE_RESPAWN_LOGS
226 PrintFormat("%1::ReserveFor_S(playerId: %2, pointId: %3)", Type().ToString(), playerId, GetRplId());
227 #endif
228
229 if (!m_ReservationLocks.Insert(playerId))
230 {
231 Debug.Error(string.Format("SCR_SpawnPoint reservation for playerId: %1 failed!", playerId));
232 return false;
233 }
234
235 return true;
236 }
237
238 //------------------------------------------------------------------------------------------------
244 void ClearReservationFor_S(int playerId)
245 {
246 #ifdef _ENABLE_RESPAWN_LOGS
247 PrintFormat("%1::ClearReservationFor_S(playerId: %2, pointId: %3)", Type().ToString(), playerId, GetRplId());
248 #endif
249
250 int index = m_ReservationLocks.Find(playerId);
251 if (index != -1)
252 {
254 }
255 }
256
257 //------------------------------------------------------------------------------------------------
262 {
263 return m_fSpawnRadius;
264 }
265
266 //------------------------------------------------------------------------------------------------
268 void SetSpawnRadius(float radius)
269 {
270 m_fSpawnRadius = radius;
271 }
272
273 //------------------------------------------------------------------------------------------------
274 static void ShowSpawnPointDescriptors(bool show, Faction faction)
275 {
276 if (!m_aSpawnPoints)
277 return;
278
279 string factionKey = string.Empty;
280 if (faction)
281 factionKey = faction.GetFactionKey();
282
283 foreach (SCR_SpawnPoint spawnPoint : m_aSpawnPoints)
284 {
285 if (!spawnPoint)
286 continue;
287
288 auto mapDescriptor = SCR_MapDescriptorComponent.Cast(spawnPoint.FindComponent(SCR_MapDescriptorComponent));
289 if (!mapDescriptor)
290 continue;
291
292 bool visible = show && !factionKey.IsEmpty() && spawnPoint.GetFactionKey() == factionKey;
293 if (mapDescriptor.Item())
294 mapDescriptor.Item().SetVisible(visible);
295 }
296 }
297
298 //------------------------------------------------------------------------------------------------
303 {
304 if (!m_RplComponent)
305 return RplId.Invalid();
306
307 return m_RplComponent.Id();
308 }
309
310 //------------------------------------------------------------------------------------------------
312 {
313 if (!id.IsValid())
314 return null;
315
316 Managed instance = Replication.FindItem(id);
317 if (!instance)
318 return null;
319
320 RplComponent rplComponent = RplComponent.Cast(instance);
321 if (rplComponent)
322 return SCR_SpawnPoint.Cast(rplComponent.GetEntity());
323
324 return SCR_SpawnPoint.Cast(instance);
325 }
326
327 //------------------------------------------------------------------------------------------------
328 protected bool GetEmptyPositionAndRotationInRange(out vector pos, out vector rot)
329 {
330 SCR_SpawnPositionComponentManager spawnPosManagerComponent = SCR_SpawnPositionComponentManager.GetInstance();
331 if (!spawnPosManagerComponent)
332 return false;
333
334 array<SCR_SpawnPositionComponent> positions = {};
335 int count = spawnPosManagerComponent.GetSpawnPositionsInRange(GetOrigin(), m_fSpawnPositionUsageRange, positions);
336 if (count < 0)
337 return false;
338
339 SCR_SpawnPositionComponent position;
340
341 while (!positions.IsEmpty())
342 {
343 position = positions.GetRandomElement();
344
345 if (position.IsFree())
346 {
347 pos = position.GetOwner().GetOrigin();
348 rot = position.GetOwner().GetAngles();
349 return true;
350 }
351 else
352 {
353 positions.RemoveItem(position);
354 }
355 }
356
357 return false;
358 }
359
360 //------------------------------------------------------------------------------------------------
363 {
365 }
366
367 //------------------------------------------------------------------------------------------------
369 {
370 return m_bRandomizedSpawn;
371 }
372
373 //------------------------------------------------------------------------------------------------
374 void GetPositionAndRotation(out vector pos, out vector rot)
375 {
377 return;
378
380 {
381 pos = GetOrigin();
382 rot = GetAngles();
383 return;
384 }
385
387 {
389 return;
390 }
391
392 vector rand = Vector(0, 0, 0);
393 if (m_fRandomSpawnRadius > 0)
394 rand = Vector(Math.RandomFloat01() * m_fRandomSpawnRadius, 0, Math.RandomFloat01() * m_fRandomSpawnRadius);
395
396 if (m_aChildren.Count() > 1)
397 {
398 int id = m_aChildren.GetRandomIndex();
399 SCR_WorldTools.FindEmptyTerrainPosition(pos, m_aChildren[id].GetOrigin() + rand, GetSpawnRadius());
400 rot = m_aChildren[id].GetAngles();
401 }
402 else
403 {
404 SCR_WorldTools.FindEmptyTerrainPosition(pos, GetOrigin() + rand, GetSpawnRadius());
405 rot = GetAngles();
406 }
407 }
408
409 //------------------------------------------------------------------------------------------------
411 static SCR_SpawnPoint GetSpawnPointByIndex(int spawnPointIndex)
412 {
413 if (spawnPointIndex >= 0 && spawnPointIndex < m_aSpawnPoints.Count())
414 return m_aSpawnPoints[spawnPointIndex];
415
416 return null;
417 }
418
419 //------------------------------------------------------------------------------------------------
421 static int GetSpawnPointIndex(SCR_SpawnPoint spawnPoint)
422 {
423 return m_aSpawnPoints.Find(spawnPoint);
424 }
425
426 //------------------------------------------------------------------------------------------------
428 {
429 return true;
430 }
431
432 //------------------------------------------------------------------------------------------------
436 static int CountSpawnPoints()
437 {
438 return m_aSpawnPoints.Count();
439 }
440
441 //------------------------------------------------------------------------------------------------
443 {
445 }
446
447 //------------------------------------------------------------------------------------------------
448 void SetVisibleInDeployMapOnly(bool visible)
449 {
450 m_bShowInDeployMapOnly = visible;
451 }
452
453 //------------------------------------------------------------------------------------------------
454 protected void ApplyFactionChange(FactionAffiliationComponent owner, Faction previousFaction, Faction newFaction)
455 {
456 SetFaction(newFaction);
457 }
458
459 //------------------------------------------------------------------------------------------------
460 void SetFaction(Faction faction)
461 {
462 if (!faction)
463 SetFactionKey(string.Empty);
464 else
465 SetFactionKey(faction.GetFactionKey());
466 }
467
468 //------------------------------------------------------------------------------------------------
469 void SetFactionKey(string factionKey)
470 {
471 if (factionKey == m_sFaction)
472 return;
473
474 m_sFaction = factionKey;
476 Replication.BumpMe();
477 }
478 protected void OnSetFactionKey()
479 {
480 Event_SpawnPointFactionAssigned.Invoke(this);
481 }
482
483 //------------------------------------------------------------------------------------------------
484 void SetSpawnPositionRange(float range)
485 {
487 }
488
489 //------------------------------------------------------------------------------------------------
491 {
493 }
494
495 //------------------------------------------------------------------------------------------------
496 array<SCR_Position> GetChildSpawnPoints()
497 {
498 return m_aChildren;
499 }
500
501 //------------------------------------------------------------------------------------------------
504 {
505 return m_sFaction;
506 }
507
508 //------------------------------------------------------------------------------------------------
512 private bool GetIsInRange(ChimeraCharacter character, float range)
513 {
514 return character && vector.DistanceSq(character.GetOrigin(), GetOrigin()) < range*range;
515 }
516
517 //------------------------------------------------------------------------------------------------
519 static array<SCR_SpawnPoint> GetSpawnPoints()
520 {
521 return m_aSpawnPoints;
522 }
523
524 //------------------------------------------------------------------------------------------------
526 static SCR_SpawnPoint GetRandomSpawnPointDeathmatch()
527 {
528 if (!m_aSpawnPoints || m_aSpawnPoints.IsEmpty())
529 return null;
530
531 return m_aSpawnPoints.GetRandomElement();
532 }
533
534 //------------------------------------------------------------------------------------------------
536 static SCR_SpawnPoint GetRandomSpawnPoint(SCR_ChimeraCharacter character)
537 {
538 if (!character)
539 return null;
540
541 return GetRandomSpawnPointForFaction(character.GetFactionKey());
542 }
543
544 //------------------------------------------------------------------------------------------------
546 static array<SCR_SpawnPoint> GetSpawnPointsForPlayer(SCR_ChimeraCharacter character)
547 {
548 string factionKey = string.Empty;
549 if (character)
550 factionKey = character.GetFactionKey();
551
552 return GetSpawnPointsForFaction(factionKey);
553 }
554
555 //------------------------------------------------------------------------------------------------
558 static array<SCR_SpawnPoint> GetSpawnPointsForFaction(string factionKey)
559 {
560 array<SCR_SpawnPoint> factionSpawnPoints = new array<SCR_SpawnPoint>();
561 if (factionKey.IsEmpty())
562 return factionSpawnPoints;
563
564 array<SCR_SpawnPoint> spawnPoints = GetSpawnPoints();
565 foreach (SCR_SpawnPoint spawnPoint : spawnPoints)
566 {
567 if (spawnPoint && spawnPoint.GetFactionKey() == factionKey)
568 factionSpawnPoints.Insert(spawnPoint);
569 }
570 return factionSpawnPoints;
571 }
572 //------------------------------------------------------------------------------------------------
576 static int GetSpawnPointCountForFaction(string factionKey)
577 {
578 if (factionKey.IsEmpty())
579 return 0;
580
581 int count = 0;
582 foreach (SCR_SpawnPoint spawnPoint : GetSpawnPoints())
583 {
584 if (!spawnPoint) continue;
585 if (spawnPoint.GetFactionKey() == factionKey)
586 count++;
587 }
588 return count;
589 }
590
591 //------------------------------------------------------------------------------------------------
593 static SCR_SpawnPoint GetRandomSpawnPointForFaction(string factionKey)
594 {
595 array<SCR_SpawnPoint> spawnPoints = GetSpawnPointsForFaction(factionKey);
596 if (!spawnPoints.IsEmpty())
597 return spawnPoints.GetRandomElement();
598
599 return null;
600 }
601
602 //------------------------------------------------------------------------------------------------
603 // todo(koudelkaluk): get back to this
604
605 //------------------------------------------------------------------------------------------------
606 // SCR_UIInfo GetInfo()
607 // {
608 // if (m_LinkedInfo)
609 // return m_LinkedInfo;
610 // else
611 // return GetInfoFromPrefab();
612 // }
613
614 // protected SCR_UIInfo GetInfoFromPrefab()
615 // {
616
617 // SCR_SpawnPointClass prefabData = SCR_SpawnPointClass.Cast(GetPrefabData());
618 // if (!prefabData)
619 // return null;
620
621 // return prefabData.GetInfo();
622 // }
623
624 //------------------------------------------------------------------------------------------------
625 SCR_UIInfo GetInfo()
626 {
627 if (m_LinkedInfo)
628 return m_LinkedInfo;
629 else
630 return m_Info;
631 }
632
633 //------------------------------------------------------------------------------------------------
634 void SetInfo(SCR_UIInfo info)
635 {
636 m_Info = info;
637 }
638
639 //------------------------------------------------------------------------------------------------
640 string GetSpawnPointName()
641 {
642 if (SCR_StringHelper.IsEmptyOrWhiteSpace(m_sSpawnPointName) && GetInfo())
643 return GetInfo().GetName();
644 else
645 return m_sSpawnPointName;
646
647 return string.Empty;
648 }
649
650 //------------------------------------------------------------------------------------------------
651 void SetSpawnPointName(string name)
652 {
653 m_sSpawnPointName = name;
654 Replication.BumpMe();
656 }
657
658 //------------------------------------------------------------------------------------------------
659 bool IsTimed()
660 {
661 return m_bTimedSpawnPoint;
662 }
663
664 //------------------------------------------------------------------------------------------------
665 void SetIsTimed(bool isTimed)
666 {
667 m_bTimedSpawnPoint = isTimed;
668 }
669
670 //------------------------------------------------------------------------------------------------
671 void LinkInfo(SCR_UIInfo info)
672 {
673 m_LinkedInfo = info;
674 }
675
676#ifdef WORKBENCH
677 //------------------------------------------------------------------------------------------------
678 override void SetColorAndText()
679 {
681
682 // Fetch faction data
683 FactionManager factionManager = GetGame().GetFactionManager();
684 if (factionManager)
685 {
686 Faction faction = factionManager.GetFactionByKey(m_sFaction);
687 if (faction)
688 {
689 m_iColor = faction.GetFactionColor().PackToInt();
690 }
691 }
692 }
693#endif
694
695 //------------------------------------------------------------------------------------------------
696 /*
697 Authority:
698 During the spawn process, prior to passing the ownership to the remote project spawned entity
699 can be prepared (e.g. moved to position, seated in vehicle, items spawned in inventory).
700
701 This method is the place to do so, but at this point the spawning process can still fail and
702 terminate if preparation fails (returns false). Player is then informed about spawn.
703
704 Following a successful preparation is CanSpawnFinalize_S, and SpawnFinalize_S after which
705 the process is successfully ended.
706
707 \param requestComponent Player request component
708 \param data Data received for this request
709 \param entity Spawned entity (to prepare)
710
711 \return True if successful (move to finalizing the request), false (to terminate the process).
712 */
713 bool PrepareSpawnedEntity_S(SCR_SpawnRequestComponent requestComponent, SCR_SpawnData data, IEntity entity)
714 {
715 if (!IsSpawnPointEnabled())
716 return false;
717
718 // WS target position, pitch yaw roll angles in degrees
719 vector position, rotation;
721
722 // apply transformation
723 entity.SetOrigin(position);
724 entity.SetAngles(rotation);
725 return true;
726 }
727
728 //------------------------------------------------------------------------------------------------
744 bool CanFinalizeSpawn_S(SCR_SpawnRequestComponent requestComponent, SCR_SpawnData data, IEntity entity)
745 {
746 return IsSpawnPointEnabled();
747 }
748
749 //------------------------------------------------------------------------------------------------
755 void OnFinalizeSpawnDone_S(SCR_SpawnRequestComponent requestComponent, SCR_SpawnData data, IEntity entity)
756 {
757 if (s_OnSpawnPointFinalizeSpawn)
758 s_OnSpawnPointFinalizeSpawn.Invoke(requestComponent, data, entity);
759 }
760
761 //------------------------------------------------------------------------------------------------
762 override void EOnInit(IEntity owner)
763 {
764 super.EOnInit(owner);
765 if (!GetGame().GetWorldEntity())
766 return;
767
768 m_RplComponent = RplComponent.Cast(FindComponent(RplComponent));
769
770 IEntity child = GetChildren();
771 while (child)
772 {
773 if (SCR_Position.Cast(child))
774 m_aChildren.Insert(SCR_Position.Cast(child));
775 child = child.GetSibling();
776 }
777
779
780 // Add to list of all points
781 m_aSpawnPoints.Insert(this);
782 Event_OnSpawnPointCountChanged.Invoke(m_sFaction);
783 Event_SpawnPointAdded.Invoke(this);
784
785 ClearFlags(EntityFlags.ACTIVE);
786 }
787
788 //------------------------------------------------------------------------------------------------
789 protected void InitFactionAffiliation(IEntity owner)
790 {
793 {
794 m_FactionAffiliationComponent.GetOnFactionChanged().Insert(ApplyFactionChange);
795 Faction faction = m_FactionAffiliationComponent.GetAffiliatedFaction();
796 if (faction)
797 m_sFaction = faction.GetFactionKey();
798 }
799 }
800
801 //------------------------------------------------------------------------------------------------
802 override bool RplSave(ScriptBitWriter writer)
803 {
804 writer.WriteString(m_sSpawnPointName);
805
806 return true;
807 }
808
809 //------------------------------------------------------------------------------------------------
810 override protected bool RplLoad(ScriptBitReader reader)
811 {
812 // Raise callback about adding of this point
813 Event_SpawnPointAdded.Invoke(this);
814
815 // Update faction related stats
817 Event_OnSpawnPointCountChanged.Invoke(m_sFaction);
818
819 reader.ReadString(m_sSpawnPointName);
820
821 return true;
822 }
823
824 //------------------------------------------------------------------------------------------------
826 {
827 SetEventMask(EntityEvent.INIT);
828 SetFlags(EntityFlags.STATIC, true);
829 }
830
831 //------------------------------------------------------------------------------------------------
833 {
834 // Remove from list of all points
835 if (m_aSpawnPoints)
836 {
837 m_aSpawnPoints.RemoveItem(this);
838 }
839
840 //~ Raise events
841 Event_OnSpawnPointCountChanged.Invoke(m_sFaction);
842 Event_SpawnPointRemoved.Invoke(this);
843
844 // Remove callbacks
846 {
847 m_FactionAffiliationComponent.GetOnFactionChanged().Remove(ApplyFactionChange);
848 }
849 }
850
851 //------------------------------------------------------------------------------------------------
852 protected bool GetRandomPositionAndRotation(out vector vOutPosition, out vector vOutRotation)
853 {
854 SCR_RandomSpawnManagerComponent randomSpawnManager = SCR_RandomSpawnManagerComponent.Cast(GetGame().GetGameMode().FindComponent(SCR_RandomSpawnManagerComponent));
855
856 if (!randomSpawnManager)
857 {
858 vOutPosition = this.GetOrigin();
859 return false;
860 }
861
862 vector safePosition;
863 BaseWorld world = GetWorld();
864
865 // Attempt a few times in case the pre-calculated points are now occupied by moving objects
866 for (int i; i < m_iRandomSpawnMaxAttempts; i++)
867 {
868 if (!randomSpawnManager.RequestSpawnPosition(m_sFaction, m_aSpawnPoints, safePosition))
869 break;
870
872 {
873 vOutPosition = safePosition;
874 vOutRotation = {Math.RandomFloat(0, 360), 0, 0};
875 return true;
876 }
877 }
878
879 vOutPosition = GetOrigin();
880 return false;
881 }
882}
AddonBuildInfoTool id
ArmaReforgerScripted GetGame()
Definition game.c:1398
vector GetOrigin()
SCR_BaseGameMode GetGameMode()
SCR_CacheNoteComponentClass ScriptComponentClass RplProp()] protected ref array< string > m_aLines
enum SCR_ECompassType EntityEditorProps(category:"GameScripted/Gadgets", description:"Compass", color:"0 0 255 255")
Prefab data class for compass component.
vector position
SCR_DestructionSynchronizationComponentClass ScriptComponentClass int index
SCR_ESpawnResult
override SCR_UIInfo GetInfo()
Get all prefabs that have the spawner data
Get all prefabs that have the spawner the given labels and are valid in the editor mode param catalogType Type to catalog to get prefabs from param editorMode Editor mode to get valid entries from param faction Faction(Optional)
override string GetSpawnPointName()
SCR_PositionClass GenericEntityClass SCR_Position(IEntitySource src, IEntity parent)
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
void GetChildren(out array< SCR_ScenarioFrameworkLayerBase > children)
ScriptInvokerBase< ScriptInvokerBoolMethod > ScriptInvokerBool
func SpawnPointDelegateMethod
ScriptInvokerBase< SpawnPointNameChangedInvoker > SCR_SpawnPointNameChanged_Invoker
func SpawnPointNameChangedInvoker
func SpawnPointFinalizeSpawnInvoker
ScriptInvokerBase< SpawnPointDelegateMethod > SpawnPointInvoker
ScriptInvokerBase< SpawnPointFinalizeSpawnInvoker > SCR_SpawnPointFinalizeSpawn_Invoker
int Type
enum EVehicleType IEntity
Definition Debug.c:13
proto external Managed FindComponent(typename typeName)
proto external void SetAngles(vector angles)
Same as SetYawPitchRoll(), but sets rotation around X, Y and Z axis.
proto external void SetOrigin(vector orig)
proto external IEntity GetSibling()
Definition Math.c:13
Main replication API.
Definition Replication.c:14
Replication item identifier.
Definition RplId.c:14
Spawn point entity defines positions on which players can possibly spawn.
bool ReserveFor_S(int playerId)
string m_sSpawnPointName
static SCR_SpawnPoint GetSpawnPointByIndex(int spawnPointIndex)
Return spawn point or null if out of bounds.
override bool RplSave(ScriptBitWriter writer)
static int GetSpawnPointIndex(SCR_SpawnPoint spawnPoint)
Return spawn point index or -1 if not existent.
bool IsSpawnPointVisibleForPlayer(int pid)
bool GetVisibleInDeployMapOnly()
void SetFactionKey(string factionKey)
void InitFactionAffiliation(IEntity owner)
int m_iRandomSpawnMaxAttempts
ref ScriptInvokerBool m_OnSetSpawnPointEnabled
static SCR_SpawnPointFinalizeSpawn_Invoker GetOnSpawnPointFinalizeSpawn()
static ref SCR_SpawnPointNameChanged_Invoker OnSpawnPointNameChanged
bool m_bUseNearbySpawnPositions
vector m_vCylinderVectorOffset
void ApplyFactionChange(FactionAffiliationComponent owner, Faction previousFaction, Faction newFaction)
array< SCR_Position > GetChildSpawnPoints()
static SCR_SpawnPoint GetSpawnPointByRplId(RplId id)
static void ShowSpawnPointDescriptors(bool show, Faction faction)
bool CanReserveFor_S(int playerId, out SCR_ESpawnResult result=SCR_ESpawnResult.SPAWN_NOT_ALLOWED)
void SCR_SpawnPoint(IEntitySource src, IEntity parent)
void SetPriority(int priority)
float m_fPlayerCylinderHeight
void SetUseNearbySpawnPositions(bool use)
string GetFactionKey()
SCR_FactionAffiliationComponent m_FactionAffiliationComponent
void SetFaction(Faction faction)
void SetSpawnPositionRange(float range)
bool GetRandomPositionAndRotation(out vector vOutPosition, out vector vOutRotation)
ScriptInvokerBool GetOnSpawnPointEnabled()
bool IsSpawnPointEnabled()
SCR_UIInfo m_LinkedInfo
bool RplLoad(ScriptBitReader reader)
bool GetEmptyPositionAndRotationInRange(out vector pos, out vector rot)
bool m_bShowInDeployMapOnly
void SetRespawnTime(float time)
float m_fRandomSpawnRadius
ref SCR_UIInfo m_Info
ref set< int > m_ReservationLocks
void SetSpawnRadius(float radius)
void SetSpawnPointEnabled_S(bool enabled)
static int CountSpawnPoints()
bool IsSpawnPointActive()
float m_fPlayerCylinderRadius
RplComponent m_RplComponent
void ClearReservationFor_S(int playerId)
bool IsReservedFor_S(int playerId)
void SetVisibleInDeployMapOnly(bool visible)
void GetPositionAndRotation(out vector pos, out vector rot)
float GetSpawnPositionRange()
float m_fSpawnPositionUsageRange
ref array< SCR_Position > m_aChildren
bool IsSpawnPointRandom()
proto void PrintFormat(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL, LogLevel level=LogLevel.NORMAL)
SCR_FieldOfViewSettings Attribute
EntityEvent
Various entity events.
Definition EntityEvent.c:14
EntityFlags
Various entity flags.
Definition EntityFlags.c:14
RespawnSystemComponentClass GameComponentClass vector vector rotation
proto external string ToString()
Plain C++ pointer, no weak pointers, no memory management.
proto native vector Vector(float x, float y, float z)
class WidgetType m_iColor
string m_sText
Definition EnWidgets.c:82
TraceFlags
Definition TraceFlags.c:13
ScriptInvokerBase< func > ScriptInvoker
Definition tools.c:134