Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_ScenarioFrameworkSlotBase.c
Go to the documentation of this file.
1[EntityEditorProps(category: "GameScripted/ScenarioFramework/Slot", description: "")]
5
7{
8 [Attribute(params: "et", desc: "Resource name of the object to be spawned", category: "Asset")]
9 ResourceName m_sObjectToSpawn;
10
11 [Attribute(desc: "Selects which object to spawn based on the selected Faction Key", category: "Asset")]
12 ref array<ref SCR_ScenarioFrameworkFactionSwitchedObject> m_aFactionSwitchedObjects;
13
14 [Attribute(desc: "Name of the entity used for identification", category: "Asset")]
15 string m_sID;
16
17 [Attribute(desc: "This won't spawn new object, but it will rather use the object already existing in the world", category: "Asset")]
18 bool m_bUseExistingWorldAsset;
19
20 [Attribute(desc: "Overrides display name of the spawned object for task purposes", category: "Asset")]
21 string m_sOverrideObjectDisplayName;
22
23 [Attribute(defvalue: "1", desc: "If the spawned entity can be garbage-collected", category: "Asset")]
24 bool m_bCanBeGarbageCollected;
25
26 [Attribute(desc: "Randomize spawned asset(s) per Faction Attribute which needs to be filled as well. Will override Object To Spawn Attribute.", category: "Randomization")]
27 bool m_bRandomizePerFaction;
28
29 [Attribute("0", UIWidgets.SearchComboBox, "Select Entity Catalog type for random spawn", "", ParamEnumArray.FromEnum(EEntityCatalogType), category: "Randomization")]
30 EEntityCatalogType m_eEntityCatalogType;
31
32 [Attribute("0", UIWidgets.SearchComboBox, "Select Entity Labels which you want to optionally include to random spawn. If you want to spawn everything, you can leave it out empty and also leave Include Only Selected Labels attribute to false.", "", ParamEnumArray.FromEnum(EEditableEntityLabel), category: "Randomization")]
33 ref array<EEditableEntityLabel> m_aIncludedEditableEntityLabels;
34
35 [Attribute("0", UIWidgets.SearchComboBox, "Select Entity Labels which you want to exclude from random spawn", "", ParamEnumArray.FromEnum(EEditableEntityLabel), category: "Randomization")]
36 ref array<EEditableEntityLabel> m_aExcludedEditableEntityLabels;
37
38 [Attribute(desc: "If true, it will spawn only the entities that are from Included Editable Entity Labels and also do not contain Label to be Excluded.", category: "Randomization")]
39 bool m_bIncludeOnlySelectedLabels;
40
41 [Attribute(defvalue: "0", category: "Composition", desc: "When disabled orientation to terrain will be skipped for the next composition")]
42 bool m_bIgnoreOrientChildrenToTerrain;
43
48
49 // A fallback entity with the same prefab name as m_sObjectToSpawn (in case exact prefab matching fails)
50 IEntity m_fallbackEntityByName;
51
52 // A fallback entity whose prefab is the ancestor of m_sObjectToSpawn (in case exact prefab matching fails)
53 IEntity m_fallbackEntityByAncestor;
54
55#ifdef WORKBENCH
56 protected IEntity m_PreviewEntity;
57#endif
58
59 //------------------------------------------------------------------------------------------------
62 protected void QueryObjectsInRange(float fRange = 2.5)
63 {
64 // We're searching by prefab name, so if this is empty, there's no point to continue
65 if (SCR_StringHelper.IsEmptyOrWhiteSpace(m_sObjectToSpawn))
66 return;
67
68 BaseWorld pWorld = GetGame().GetWorld();
69 if (!pWorld)
70 return;
71
72 m_fallbackEntityByName = null;
73 m_fallbackEntityByAncestor = null;
74 pWorld.QueryEntitiesBySphere(GetOwner().GetOrigin(), fRange, GetEntity, null, EQueryEntitiesFlags.ALL);
75
76 // if no exact prefab match was found, use a fallback entity
77 if (!m_Entity)
78 {
79 if (m_fallbackEntityByAncestor)
80 m_Entity = m_fallbackEntityByAncestor;
81 else
82 m_Entity = m_fallbackEntityByName;
83 }
84 }
85
86 //------------------------------------------------------------------------------------------------
89 {
90 if (state != EDamageState.DESTROYED || !m_Entity)
91 return;
92
93 SCR_DamageManagerComponent objectDmgManager = SCR_DamageManagerComponent.GetDamageManager(m_Entity);
94 if (objectDmgManager)
95 objectDmgManager.GetOnDamageStateChanged().Remove(OnObjectDamage);
96
98 SetIsTerminated(true);
99 }
100
101 //------------------------------------------------------------------------------------------------
106 {
108 if (!invComp)
109 return;
110
112 }
113
114 //------------------------------------------------------------------------------------------------
121 void OnCompartmentEntered(IEntity vehicle, BaseCompartmentManagerComponent mgr, IEntity occupant, int managerId, int slotID)
122 {
124 }
125
126 //------------------------------------------------------------------------------------------------
129 {
130 return m_sOverrideObjectDisplayName;
131 }
132
133 //------------------------------------------------------------------------------------------------
136 {
137 m_sOverrideObjectDisplayName = name;
138 }
139
140 //------------------------------------------------------------------------------------------------
143 {
144 if (!m_Entity || !m_sOverrideObjectDisplayName.IsEmpty())
145 return m_sOverrideObjectDisplayName;
146
148 if (!editableEntityComp)
149 return string.Empty;
150
151 return editableEntityComp.GetDisplayName();
152 }
153
154 //------------------------------------------------------------------------------------------------
158 protected bool GetEntity(notnull IEntity entity)
159 {
160 IEntity pParent = SCR_EntityHelper.GetMainParent(entity, true);
161 EntityPrefabData prefabData = pParent.GetPrefabData();
162 if (!prefabData)
163 return true;
164
165 ResourceName resource = SCR_ResourceNameUtils.GetPrefabName(entity);
166
167 if (resource == m_sObjectToSpawn)
168 {
169 m_Entity = entity;
170 return false;
171 }
172
173 // this isn't the exact prefab we want; try fallback (only one fallback entity is enough)
174 if (!m_fallbackEntityByAncestor)
175 {
176 if (SCR_BaseContainerTools.IsKindOf(prefabData.GetPrefab(), m_sObjectToSpawn))
177 {
178 // Use this entity as fallback by ancestor
179 m_fallbackEntityByAncestor = entity;
180 }
181 else if (!m_fallbackEntityByName)
182 {
183 // Check if the prefab names match
184
185 TStringArray strs = new TStringArray();
186 resource.Split("/", strs, true);
187 string resourceName;
188 if(strs.Count() > 0)
189 resourceName = strs[strs.Count() - 1];
190
191 TStringArray strsObject = new TStringArray();
192 m_sObjectToSpawn.Split("/", strsObject, true);
193 string resourceObject;
194 if(strsObject.Count() > 0)
195 resourceObject = strsObject[strsObject.Count() - 1];
196
197 // if names match, use this entity as fallback by name
198 if (resourceName && resourceName == resourceObject)
199 m_fallbackEntityByName = entity;
200 }
201 }
202
203
204 return true;
205 }
206
207 //------------------------------------------------------------------------------------------------
210 {
212 IEntity entity = GetOwner().GetParent();
213 while (entity)
214 {
216 if (area)
217 return area;
218
219 entity = entity.GetParent();
220 }
221
222 return area;
223 }
224
225 //------------------------------------------------------------------------------------------------
228 {
229 return m_sID;
230 }
231
232 //------------------------------------------------------------------------------------------------
235 {
236 return m_sObjectToSpawn;
237 }
238
239 //------------------------------------------------------------------------------------------------
244 {
245 if (!m_aFactionSwitchedObjects.IsEmpty())
246 {
247 // Try get faction switched object
248 foreach (SCR_ScenarioFrameworkFactionSwitchedObject factionObject : m_aFactionSwitchedObjects)
249 {
250 if (factionObject.m_sFactionKey == m_sFactionKey)
251 return factionObject.m_sObjectToSpawn;
252 }
253
254 if (m_sObjectToSpawn.IsEmpty())
255 Print(string.Format("ScenarioFramework [SCR_ScenarioFrameworkSlotBase] No faction switch object for \"%1\" FactionKey and no fallback m_sObjectToSpawn.", m_sFactionKey), LogLevel.WARNING);
256 }
257
258 return m_sObjectToSpawn;
259 }
260
261 //------------------------------------------------------------------------------------------------
267
268 //------------------------------------------------------------------------------------------------
274
275 //------------------------------------------------------------------------------------------------
280 override void RestoreToDefault(bool includeChildren = false, bool reinitAfterRestoration = false, bool affectRandomization = true, bool deleteSpawnedEntities = true)
281 {
282 m_sRandomlySpawnedObject = string.Empty;
283 m_vPosition = vector.Zero;
284
285 super.RestoreToDefault(includeChildren, reinitAfterRestoration, affectRandomization, deleteSpawnedEntities);
286 }
287
288 //------------------------------------------------------------------------------------------------
292 {
294 if (!m_Entity && !SCR_StringHelper.IsEmptyOrWhiteSpace(m_sObjectToSpawn))
295 {
297 return;
298 }
299
301 return;
302
303 if (m_Entity)
304 {
305 m_vPosition = m_Entity.GetOrigin();
307 if (invComp)
308 invComp.m_OnParentSlotChangedInvoker.Remove(OnInventoryParentChanged);
309 }
310
311 m_bInitiated = false;
313 m_aSpawnedEntities.RemoveItem(null);
314 foreach (IEntity entity : m_aSpawnedEntities)
315 {
316 m_vPosition = entity.GetOrigin();
317 SCR_EntityHelper.DeleteEntityAndChildren(entity);
318 }
319
320 m_aSpawnedEntities.Clear();
321 }
322
323 //------------------------------------------------------------------------------------------------
326 override bool InitAlreadyHappened()
327 {
328 // We do not want to check this condition for Slots
329 return false;
330 }
331
332 //------------------------------------------------------------------------------------------------
336 {
337 if (!m_Entity)
338 {
341 return false;
342 }
343
344 return true;
345 }
346
347 //------------------------------------------------------------------------------------------------
350 {
351 m_sObjectToSpawn = GetSelectedObjectToSpawn();
352 }
353
354 //------------------------------------------------------------------------------------------------
358 {
359 // Manually get the faction key from parents because attribute inheritance doesn't run in Workbench.
361 if (m_bRandomizePerFaction)
362 {
363 m_sObjectToSpawn = ""; // Maybe put a preview object here that is a mesh of a word saying "Catalog Result" or something.
364 return;
365 }
367 }
368
369 //------------------------------------------------------------------------------------------------
373 {
374 if (m_Entity && !m_Entity.IsDeleted())
375 return true; // Savegame will have linked the entity to the slot before SF system init
376
377 if (!m_bUseExistingWorldAsset)
378 {
380 }
381 else
382 {
383 if (!m_sID.IsEmpty())
384 {
385 m_Entity = GetGame().GetWorld().FindEntityByName(m_sID);
386 }
387
388 if (!m_Entity)
389 QueryObjectsInRange(); //sets the m_Entity in subsequent callback
390 }
391
393 return false;
394
395 return true;
396 }
397
398 //------------------------------------------------------------------------------------------------
401 override bool InitOtherThings()
402 {
404
405 if (!InitEntitySpawn())
406 return false;
407
408 return true;
409 }
410
411 //------------------------------------------------------------------------------------------------
413 override void FinishInit()
414 {
415 if (!m_sID.IsEmpty() && m_Entity)
416 {
417 IEntity ent = GetGame().GetWorld().FindEntityByName(m_sID);
418 if (ent != m_Entity)
419 {
420 string IDWithSuffix = m_sID;
421 int suffixNumber;
422 while (GetGame().GetWorld().FindEntityByName(IDWithSuffix))
423 {
424 suffixNumber++;
425 Print(string.Format("ScenarioFramework Slot: Entity of name %1 was found. The suffix _%2 will be added.", m_sID, suffixNumber), LogLevel.WARNING);
426 IDWithSuffix = m_sID + "_" + suffixNumber.ToString();
427 }
428
429 m_Entity.SetName(IDWithSuffix);
430 }
431 }
432
433 SCR_DamageManagerComponent objectDmgManager = SCR_DamageManagerComponent.GetDamageManager(m_Entity);
434 if (objectDmgManager)
435 objectDmgManager.GetOnDamageStateChanged().Insert(OnObjectDamage);
436
437 if (Vehicle.Cast(m_Entity))
438 {
439 EventHandlerManagerComponent ehManager = EventHandlerManagerComponent.Cast(m_Entity.FindComponent(EventHandlerManagerComponent));
440 if (ehManager)
441 ehManager.RegisterScriptHandler("OnCompartmentEntered", this, OnCompartmentEntered, true);
442 }
443
445 if (invComp)
446 invComp.m_OnParentSlotChangedInvoker.Insert(OnInventoryParentChanged);
447
448 if (!m_bCanBeGarbageCollected)
449 {
451 if (garbageSystem)
452 garbageSystem.UpdateBlacklist(m_Entity, true);
453 }
454
455 super.FinishInit();
456
458 }
459
460 //------------------------------------------------------------------------------------------------
465 {
468
469 super.Init(area, activation);
470 }
471
472 //------------------------------------------------------------------------------------------------
476 {
477 m_bInitiated = true;
478
479 foreach (SCR_ScenarioFrameworkPlugin plugin : m_aPlugins)
480 {
481 plugin.Init(this);
482 }
483
485
486 if (m_ParentLayer)
487 m_ParentLayer.CheckAllChildrenSpawned(this);
488
490 }
491
492 //------------------------------------------------------------------------------------------------
495 override void SpawnChildren(bool previouslyRandomized = false)
496 {
497 }
498
499 //------------------------------------------------------------------------------------------------
504 {
505 SCR_EntityCatalog entityCatalog;
506
507 SCR_EntityCatalogManagerComponent catalogManager = SCR_EntityCatalogManagerComponent.GetInstance();
508
509 //~ Get data from faction manager
510 if (catalogManager)
511 {
512 //~ Faction set so get catalog from faction
513 if (!m_sFactionKey.IsEmpty())
514 entityCatalog = catalogManager.GetFactionEntityCatalogOfType(m_eEntityCatalogType, m_sFactionKey);
515 //~ No faction set so get factionless list
516 else
517 entityCatalog = catalogManager.GetEntityCatalogOfType(m_eEntityCatalogType);
518 }
519 //~ For some reason catalog manager was not found so get data from faction
520 else
521 {
522 if (m_sFactionKey.IsEmpty())
523 {
524 Print("ScenarioFramework Randomized Spawn: No catalog manager found and faction key is empty!", LogLevel.ERROR);
525 return string.Empty;
526 }
527
528 FactionManager factionManager = GetGame().GetFactionManager();
529 if (!factionManager)
530 {
531 Print("ScenarioFramework Randomized Spawn: Faction manager not found.", LogLevel.ERROR);
532 return string.Empty;
533 }
534
535 SCR_Faction faction = SCR_Faction.Cast(factionManager.GetFactionByKey(m_sFactionKey));
536 if (!faction)
537 {
538 Print(string.Format("ScenarioFramework Randomized Spawn: Selected faction not found for %1.", GetOwner().GetName()), LogLevel.ERROR);
539 return string.Empty;
540 }
541
542 //~ Get entity Catalog from faction
543 entityCatalog = faction.GetFactionEntityCatalogOfType(m_eEntityCatalogType);
544
545 if (!entityCatalog)
546 {
547 Print(string.Format("ScenarioFramework Randomized Spawn: Faction Entity Catalog (type: %1) not found for %2.", typename.EnumToString(EEntityCatalogType, m_eEntityCatalogType), GetOwner().GetName()), LogLevel.ERROR);
548 return string.Empty;
549 }
550 }
551
552 //~ No catalog found
553 if (!entityCatalog)
554 {
555 if (!m_sFactionKey.IsEmpty())
556 Print(string.Format("ScenarioFramework Randomized Spawn: Faction Entity Catalog for faction %1 (type %2) not found for %3.", m_sFactionKey, typename.EnumToString(EEntityCatalogType, m_eEntityCatalogType), GetOwner().GetName()), LogLevel.ERROR);
557 else
558 Print(string.Format("ScenarioFramework Randomized Spawn: Non-Faction Entity Catalog (Type: %1) not found for %2.", typename.EnumToString(EEntityCatalogType, m_eEntityCatalogType), GetOwner().GetName()), LogLevel.ERROR);
559
560 return string.Empty;
561 }
562
563 array<SCR_EntityCatalogEntry> entityEntries = {};
564 entityCatalog.GetFullFilteredEntityListWithLabels(entityEntries, m_aIncludedEditableEntityLabels, m_aExcludedEditableEntityLabels, m_bIncludeOnlySelectedLabels);
565 if (entityEntries.IsEmpty())
566 {
567 Print(string.Format("ScenarioFramework Randomized Spawn: Applied labels resulted in no viable prefabs to be randomly selected for %1.", GetOwner().GetName()), LogLevel.ERROR);
568 return string.Empty;
569 }
570
571 prefab = entityEntries.GetRandomElement().GetPrefab();
573 return prefab;
574 }
575
576 //------------------------------------------------------------------------------------------------
580 {
581 //If Randomization is enabled, it will try to apply settings from Attributes.
582 //If it fails anywhere, original m_sObjectToSpawn will be used.
583 if (m_bRandomizePerFaction)
584 {
586 if (SCR_StringHelper.IsEmptyOrWhiteSpace(randomAsset))
587 GetRandomAsset(randomAsset);
588
589 if (!SCR_StringHelper.IsEmptyOrWhiteSpace(randomAsset))
590 m_sObjectToSpawn = randomAsset;
591 }
592
593 Resource resource = Resource.Load(m_sObjectToSpawn);
594 if (!resource)
595 return null;
596
598 m_SpawnParams.TransformMode = ETransformMode.WORLD;
599 //--- Apply rotation
600 vector angles = Math3D.MatrixToAngles(m_SpawnParams.Transform);
601 Math3D.AnglesToMatrix(angles, m_SpawnParams.Transform);
602
603 //--- Spawn the prefab
604 BaseResourceObject resourceObject = resource.GetResource();
605 if (!resourceObject)
606 return null;
607
608 if (m_bIgnoreOrientChildrenToTerrain)
609 {
610 IEntityComponentSource slotCompositionComponent = SCR_BaseContainerTools.FindComponentSource(resourceObject, SCR_SlotCompositionComponent);
611 if (slotCompositionComponent)
612 {
614 }
615 }
616
617 IEntity entity = GetGame().SpawnEntityPrefab(resource, GetGame().GetWorld(), m_SpawnParams);
618 SCR_AIWorld aiWorld = SCR_AIWorld.Cast(GetGame().GetAIWorld());
619 if (aiWorld)
620 aiWorld.RequestNavmeshRebuildEntity(entity);
621
622 m_aSpawnedEntities.Insert(entity);
623
624 if (m_vPosition != vector.Zero)
625 {
626 entity.SetOrigin(m_vPosition);
627 entity.Update();
628 }
629
630 return entity;
631 }
632
633#ifdef WORKBENCH
634 //------------------------------------------------------------------------------------------------
639 override void _WB_SetTransform(IEntity owner, inout vector mat[4], IEntitySource src)
640 {
641 if (!m_PreviewEntity)
642 return;
643
644 BaseGameEntity baseGameEntity = BaseGameEntity.Cast(m_PreviewEntity);
645 if (baseGameEntity)
646 baseGameEntity.Teleport(mat);
647 else
649 }
650
651 //------------------------------------------------------------------------------------------------
655 void SpawnEntityPreview(IEntity owner, Resource resource)
656 {
657 EntitySpawnParams spawnParams = new EntitySpawnParams();
658 spawnParams.TransformMode = ETransformMode.WORLD;
659 owner.GetWorldTransform(spawnParams.Transform);
660
661 m_PreviewEntity = GetGame().SpawnEntityPrefab(resource, owner.GetWorld(), spawnParams);
662 }
663
664 //------------------------------------------------------------------------------------------------
669 override void _WB_OnInit(IEntity owner, inout vector mat[4], IEntitySource src)
670 {
671 SCR_EntityHelper.DeleteEntityAndChildren(m_PreviewEntity);
672
674 Resource resource = Resource.Load(m_sObjectToSpawn);
675 if (!resource || !resource.IsValid())
676 return;
677
678 SpawnEntityPreview(owner, resource);
679 }
680
681 //------------------------------------------------------------------------------------------------
686 override bool _WB_OnKeyChanged(IEntity owner, BaseContainer src, string key, BaseContainerList ownerContainers, IEntity parent)
687 {
688 if (key == "m_bShowDebugShapesInWorkbench")
690
691 if (key == "coords")
692 {
693 SCR_EntityHelper.DeleteEntityAndChildren(m_PreviewEntity);
694
695 Resource resource = Resource.Load(m_sObjectToSpawn);
696 if (!resource)
697 return false;
698
699 SpawnEntityPreview(owner, resource);
700 return true;
701 }
702 else if (key == "m_sObjectToSpawn" || key == "m_sFactionKey" || key == "m_aFactionSwitchedObjects")
703 {
704 SCR_EntityHelper.DeleteEntityAndChildren(m_PreviewEntity);
705 return false;
706 }
707 return false;
708 }
709
710#endif
711
712 //------------------------------------------------------------------------------------------------
713 // constructor
718 {
719 m_iDebugShapeColor = ARGB(100, 0x99, 0x10, 0xF2);
720 }
721
722 //------------------------------------------------------------------------------------------------
725 {
726#ifdef WORKBENCH
727 SCR_EntityHelper.DeleteEntityAndChildren(m_PreviewEntity);
728#endif
730 return;
731
732 DynamicDespawn(this);
733 }
734}
override void Init()
EEditableEntityLabel
EEntityCatalogType
ArmaReforgerScripted GetGame()
Definition game.c:1398
LayerPresets layer
ref array< string > angles
ResourceName resourceName
Definition SCR_AIGroup.c:66
vector m_vPosition
enum EAITargetInfoCategory m_Entity
vector GetOrigin()
void OnCompartmentEntered(AIAgent agent, IEntity targetEntity, BaseCompartmentManagerComponent manager, int mgrID, int slotID, bool move)
ref array< EEditableEntityLabel > m_aExcludedEditableEntityLabels
ref array< EEditableEntityLabel > m_aIncludedEditableEntityLabels
enum SCR_ECompassType EntityEditorProps(category:"GameScripted/Gadgets", description:"Compass", color:"0 0 255 255")
Prefab data class for compass component.
override void _WB_OnInit(IEntity owner, inout vector mat[4], IEntitySource src)
override bool _WB_OnKeyChanged(IEntity owner, BaseContainer src, string key, BaseContainerList ownerContainers, IEntity parent)
Any property value has been changed. You can use editor API here and do some additional edit actions ...
IEntity m_PreviewEntity
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
bool m_bShowDebugShapesInWorkbench
ref array< IEntity > m_aSpawnedEntities
bool m_bEnableRepeatedSpawn
FactionKey m_sFactionKey
void SetDynamicDespawnExcluded(bool excluded)
void SpawnChildren(bool previouslyRandomized=false)
void InvokeAllChildrenSpawned()
Spawns all children and triggers invoker on completion.
SCR_ScenarioFrameworkLayerBase m_ParentLayer
ScriptInvokerScenarioFrameworkLayer GetOnAllChildrenSpawned()
bool m_bExcludeFromDynamicDespawn
FactionKey GetParentFactionKeyRecursive()
void FinishInit()
Initializes children, retrieves them, and spawns them.
void SetIsTerminated(bool state)
ref ScriptInvokerBase< ScriptInvokerScenarioFrameworkLayerMethod > m_OnAllChildrenSpawned
void InitActivationActions()
void AfterAllChildrenSpawned(SCR_ScenarioFrameworkLayerBase layer)
void SCR_ScenarioFrameworkLayerBase(IEntityComponentSource src, IEntity ent, IEntity parent)
void DrawDebugShape(bool draw)
ref array< ref SCR_ScenarioFrameworkPlugin > m_aPlugins
void DynamicDespawn(SCR_ScenarioFrameworkLayerBase layer)
bool m_bDynamicallyDespawned
bool InitOtherThings()
For situations where some other logic is to be appended in these checks and is to be performed before...
SCR_ScenarioFrameworkLayerTaskDestroyClass m_SpawnParams
void RestoreToDefault()
void InitSelectedObjectToSpawn()
If m_bRandomizePerFaction, then catalog system will ignore m_sObjectToSpawn if it has a catalog match...
ResourceName GetRandomlySpawnedObject()
void InitSelectedObjectToPreview()
ResourceName GetSelectedObjectToSpawn()
void SCR_ScenarioFrameworkSlotBase(IEntityComponentSource src, IEntity ent, IEntity parent)
bool InitEntitySpawnCheck()
void ~SCR_ScenarioFrameworkSlotBase()
Deletes preview entity in workbench mode, returns if in edit mode, otherwise despawns scenario slot b...
string GetOverriddenObjectDisplayName()
ResourceName GetObjectToSpawn()
void SetRandomlySpawnedObject(ResourceName name)
void OnInventoryParentChanged(InventoryStorageSlot oldSlot, InventoryStorageSlot newSlot)
SCR_ScenarioFrameworkArea GetAreaWB()
string GetSpawnedEntityDisplayName()
IEntity SpawnAsset()
void OnObjectDamage(EDamageState state)
string GetSpawnedObjectName()
void SetOverriddenObjectDisplayName(string name)
ResourceName GetRandomAsset(out ResourceName prefab)
SCR_ScenarioFrameworkLayerTaskDefendSave m_sRandomlySpawnedObject
enum EVehicleType IEntity
proto external Managed FindComponent(typename typeName)
proto external void SetOrigin(vector orig)
proto external void GetWorldTransform(out vector mat[])
See IEntity::GetTransform.
proto external int Update()
proto external BaseWorld GetWorld()
proto external bool SetTransform(vector mat[4])
proto external EntityPrefabData GetPrefabData()
proto external IEntity GetParent()
Object holding reference to resource. In destructor release the resource.
Definition Resource.c:25
void RequestNavmeshRebuildEntity(IEntity entity)
Get list of entities that all contain all any the included labels and NONE exclude labels Ignores Disabled Entries as well Sometimes it is quicker to get the if false any needs to be true return List size *int GetFullFilteredEntityListWithLabels(notnull out array< SCR_EntityCatalogEntry > filteredEntityList, array< EEditableEntityLabel > includedLabels=null, array< EEditableEntityLabel > excludedLabels=null, bool needsAllIncluded=true)
static IEntity GetMainParent(IEntity entity, bool self=false)
SCR_EntityCatalog GetFactionEntityCatalogOfType(EEntityCatalogType catalogType, bool printNotFound=true)
Script entry for garbage system modding.
static SCR_GarbageSystem GetByEntityWorld(IEntity entity)
static bool IsEditMode()
Definition Functions.c:1566
Entity composition which is supposed to fit into a slot.
static void IgnoreOrientChildrenToTerrain()
Bool to disable the terrain snapping for next spawned composition.
static bool IsEmptyOrWhiteSpace(string input)
enum EPhysicsLayerPresets Vehicle
Definition gameLib.c:24
void EntitySpawnParams()
Definition gameLib.c:130
IEntity GetOwner()
Owner entity of the fuel tank.
IEntity GetEntity()
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
EDamageState
array< string > TStringArray
Definition Types.c:385
vector m_Size
Only in XY, Z is ignored.
Definition EnWidgets.c:126
EQueryEntitiesFlags
proto int ARGB(int a, int r, int g, int b)