Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_CampaignBuildingPlacingObstructionEditorComponent.c
Go to the documentation of this file.
1[ComponentEditorProps(category: "GameScripted/Editor", description: "Placing obstruction. Disallow placing of the composition in define cases.", icon: "WBData/ComponentEditorProps/componentEditor.png")]
6
9
13class SCR_CampaignBuildingPlacingObstructionEditorComponent : SCR_BaseEditorComponent
14{
15 [Attribute(defvalue: "20", desc: "Entity tilt greater then this value in angles will trigger a warning.")]
16 protected float m_fEntityTiltWarning;
17
18 [Attribute(defvalue: "25", desc: "A difference between max and min tilt of two entities in composition to trigger a warning")]
19 protected float m_fTiltDifferenceWarning;
20
21 protected ResourceName m_sCompositionResourceName;
22
23 protected bool m_bCanBeCreated = true;
24 protected bool m_bSuperiorCanBeCreated = false;
25 protected bool m_bTraceEntityPosition;
26 protected SCR_CampaignBuildingEditorComponent m_CampaignBuildingComponent;
27 protected ScriptedGameTriggerEntity m_AreaTrigger;
30 protected ref array<ref Tuple3<IEntity, float, vector>> m_aCompositionEntities = {};
31
32 //Adding this value to a sea level as the composition preview, even above sea doesn't have it's Y value exactly a zero.
33 protected const float SEA_LEVEL_OFFSET = 0.01;
34
35 // With the preview we don't need to be that strict as it is sometimes even wanted to have an entities tide together for an example row of sandbag walls.
36 protected const float PREVIEW_CHECK_FACTOR = 0.1;
37
38 // The heigh above the ground where the trace stops means it will ignore an entities that are close to surface like sidewalks so they don't block the placement.
39 protected const float HEIGHT_ABOVE_GROUND_BUFFER = 0.3;
40 protected const float HEIGHT_ABOVE_GROUND_VEHICLE_BUFFER = 0.5;
41
42 protected const float BOUNDING_BOX_FACTOR = 0.5;
43 protected const float BOUNDING_BOX_VEHICLE_FACTOR = 0.8;
44 protected const float MINIMAL_PROTECTION_RADIUS_TO_EVALUATE = 0.2;
46 protected const float Y_BUFFER = 0.3;
48 protected float m_fSafeZoneRadius = 0;
49 protected float m_fCylinderHeight = 0.5;
50 protected float m_fRollMin;
51 protected float m_fRollMax;
52 protected float m_fPitchMin;
53 protected float m_fPitchMax;
54 protected bool m_bIsVehicle;
55
56 protected vector m_vTraceOffset = Vector(0, 10, 0);
58
59 //------------------------------------------------------------------------------------------------
60 override protected void EOnEditorActivate()
61 {
62 InitVariables();
63 }
64
65 //------------------------------------------------------------------------------------------------
66 override protected void EOnEditorActivateServer()
67 {
68 InitVariables();
69 }
70
71 //------------------------------------------------------------------------------------------------
72 override protected void EOnEditorOpen()
73 {
74 InitVariables();
75
76 SCR_CampaignBuildingEditorComponent CampaignBuildingEditorComponent = SCR_CampaignBuildingEditorComponent.Cast(SCR_CampaignBuildingEditorComponent.GetInstance(SCR_CampaignBuildingEditorComponent));
77 if (!CampaignBuildingEditorComponent)
78 return;
79
80 CampaignBuildingEditorComponent.GetOnObstructionEventTriggered().Insert(SetSuperiorCanBeCreated);
81 }
82
83 //------------------------------------------------------------------------------------------------
84 override protected void EOnEditorClose()
85 {
86 SCR_CampaignBuildingEditorComponent CampaignBuildingEditorComponent = SCR_CampaignBuildingEditorComponent.Cast(SCR_CampaignBuildingEditorComponent.GetInstance(SCR_CampaignBuildingEditorComponent));
87 if (!CampaignBuildingEditorComponent)
88 return;
89
90 CampaignBuildingEditorComponent.GetOnObstructionEventTriggered().Remove(SetSuperiorCanBeCreated);
91 }
92
93 //------------------------------------------------------------------------------------------------
94 override protected void EOnEditorOpenServer()
95 {
96 InitVariables();
97 }
98
99 //------------------------------------------------------------------------------------------------
102 {
104 if (PreviewEntityComponent)
105 PreviewEntityComponent.SetLastPreviewState(SCR_EPreviewState.NONE);
106
107 m_PreviewEnt = previewEnt;
108 SetInitialCanBeCreatedState(previewEnt);
109 GetAllEntitiesToEvaluate(previewEnt);
110
111 SCR_CampaignBuildingPlacingEditorComponent placingComponent = SCR_CampaignBuildingPlacingEditorComponent.Cast(FindEditorComponent(SCR_CampaignBuildingPlacingEditorComponent, true, true));
112 if (!placingComponent)
113 return;
114
115 m_sCompositionResourceName = placingComponent.GetSelectedPrefab();
116 }
117
118 //------------------------------------------------------------------------------------------------
121 {
122 return m_bCanBeCreated;
123 }
124
125 //------------------------------------------------------------------------------------------------
128 {
129 m_bSuperiorCanBeCreated = val;
130 }
131
132 //------------------------------------------------------------------------------------------------
135 {
136 if (!previewEnt)
137 return;
138
139 float distance = vector.DistanceSq(m_AreaTrigger.GetOrigin(), previewEnt.GetOrigin());
140 if (distance < m_AreaTrigger.GetSphereRadius() * m_AreaTrigger.GetSphereRadius())
141 m_bCanBeCreated = true;
142
143 m_bCanBeCreated = false;
145 return;
146 }
147
148 //------------------------------------------------------------------------------------------------
149 private void InitVariables()
150 {
151 m_CampaignBuildingComponent = SCR_CampaignBuildingEditorComponent.Cast(FindEditorComponent(SCR_CampaignBuildingEditorComponent, true, true));
153 return;
154
156 }
157
158 //------------------------------------------------------------------------------------------------
159 // Check if the preview is outisde of the building radius. if preview doesn't exist return false - preview doesn't exist on server and the same CanCreateEntity is used on server too.
160 bool IsPreviewOutOfRange(SCR_EditorPreviewParams instantPlacingParam, out ENotification outNotification = -1)
161 {
162 // In case of WP placed with controller, the preview of the WP doesn't exist and we need to use placing params.
163 if (instantPlacingParam)
164 {
165 vector outTransform[4];
166 instantPlacingParam.GetWorldTransform(outTransform);
167
168 if ((vector.DistanceSqXZ(m_AreaTrigger.GetOrigin(), outTransform[3]) >= m_AreaTrigger.GetSphereRadius() * m_AreaTrigger.GetSphereRadius()))
169 {
170 outNotification = ENotification.EDITOR_PLACING_OUT_OF_CAMPAIGN_BUILDING_ZONE;
171 return true;
172 }
173 }
174
176 return false;
177
178 if ((vector.DistanceSqXZ(m_AreaTrigger.GetOrigin(), m_PreviewEnt.GetOrigin()) >= m_AreaTrigger.GetSphereRadius() * m_AreaTrigger.GetSphereRadius()))
179 {
180 outNotification = ENotification.EDITOR_PLACING_OUT_OF_CAMPAIGN_BUILDING_ZONE;
181 return true;
182 }
183
184 return false;
185 }
186
187 //------------------------------------------------------------------------------------------------
188 // Make an array of all entities to evaluate
190 {
191 m_aCompositionEntities.Clear();
192 array<IEntity> compositionEntities = {};
193 vector entityOrigin[4];
194
195 SCR_EntityHelper.GetHierarchyEntityList(rootEnt, compositionEntities);
196 float protectionRadius;
197
198 World world = GetGame().GetWorld();
199 if (!world)
200 return;
201
202 foreach (IEntity ent : compositionEntities)
203 {
204 if (IsPreviewVehicle(ent))
205 m_bIsVehicle = true;
206
207 // Center of the entity is burrided under the ground (fondations) check if it has set additinal obstruction radius to evaluta (heliport)
208 vector entityCenter;
209 entityCenter = SCR_EntityHelper.GetEntityCenterWorld(ent);
210
211 float surfaceY = world.GetSurfaceY(entityCenter[0], entityCenter[2]);
212
213 // When a preview is created from prefab, it's created at 0,0,0 so y < 0 test is enough. When it's created from placed composition, we have to check a real world y at given place
214 if ((entityCenter[1] < 0) || entityCenter[1] < (surfaceY - Y_BUFFER))
215 {
216 SCR_CampaignBuildingPlacingEditorComponent placingComponent = SCR_CampaignBuildingPlacingEditorComponent.Cast(FindEditorComponent(SCR_CampaignBuildingPlacingEditorComponent, true, true));
217 if (!placingComponent)
218 continue;
219
220 ResourceName resName = placingComponent.GetSelectedPrefab();
221 if (resName.IsEmpty())
222 {
223 SCR_CampaignBuildingTransformingEditorComponent transformingComponent = SCR_CampaignBuildingTransformingEditorComponent.Cast(FindEditorComponent(SCR_CampaignBuildingTransformingEditorComponent, true, true));
224 if (!transformingComponent)
225 continue;
226
227 SCR_EditableEntityComponent editablePivot = transformingComponent.GetEditedPivot();
228 if (!editablePivot)
229 continue;
230
231 IEntity pivotEnt = editablePivot.GetOwner();
232 if (!pivotEnt)
233 continue;
234
235 resName = pivotEnt.GetPrefabData().GetPrefabName();
236 }
237
238 if (resName.IsEmpty())
239 continue;
240
241 protectionRadius = GetPredefineProtectionRadius(resName);
242 }
243 else
244 {
245 protectionRadius = GetEntityProtectionRadius(ent);
246 }
247
248 if (protectionRadius > 0)
249 {
250
251 ent.GetLocalTransform(entityOrigin);
252 // If the entity is too small or in the air (props on tables etc) ignore it in test
253 if (protectionRadius < MINIMAL_PROTECTION_RADIUS_TO_EVALUATE || entityOrigin[3][1] > MAXIMAL_HEIGHT_ABOVE_TERRAIN_TO_EVALUATE)
254 continue;
255
256 vector entityLocalTransform[4];
257 ent.GetLocalTransform(entityLocalTransform);
258 vector transformAngles = Math3D.MatrixToAngles(entityLocalTransform);
259
260 m_aCompositionEntities.Insert(new Tuple3<IEntity, float, vector>(ent, protectionRadius, transformAngles));
261 }
262 }
263 }
264
265
266 //------------------------------------------------------------------------------------------------
268 {
269 Resource entityPrefab = Resource.Load(resName);
270 if (!entityPrefab.IsValid())
271 return 0;
272
273 IEntitySource entitySource = SCR_BaseContainerTools.FindEntitySource(entityPrefab);
274 if (!entitySource)
275 return 0;
276
277 IEntityComponentSource entityComponentSource;
279 if (!entityComponentSource)
280 return 0;
281
283 }
284
285 //------------------------------------------------------------------------------------------------
288 {
289 SCR_EditablePreviewComponent previewEditableEntity = SCR_EditablePreviewComponent.Cast(ent.FindComponent(SCR_EditablePreviewComponent));
290 if (!previewEditableEntity)
291 return false;
292
293 SCR_EditableEntityUIInfo editableUiInfo = SCR_EditableEntityUIInfo.Cast(previewEditableEntity.GetInfo());
294
295 return editableUiInfo && editableUiInfo.HasEntityLabel(EEditableEntityType.VEHICLE) && !editableUiInfo.HasEntityLabel(EEditableEntityLabel.VEHICLE_HELICOPTER);
296 }
297
298 //------------------------------------------------------------------------------------------------
300 bool CanCreate(out ENotification outNotification = -1, out SCR_EPreviewState previewStateToShow = SCR_EPreviewState.PLACEABLE)
301 {
302 // superior can be created was set to false which means some external condition block placing the composition. No need to continue with any evaluation.
303 if (m_bSuperiorCanBeCreated)
304 {
305 outNotification = ENotification.EDITOR_PLACING_BLOCKED;
306 previewStateToShow = SCR_EPreviewState.BLOCKED;
307 return false;
308 }
309
310 m_bCanBeCreated = true;
311 m_fRollMin = 0;
312 m_fRollMax = 0;
313 m_fPitchMin = 0;
314 m_fPitchMax = 0;
315
316 if (m_bIsVehicle)
317 {
319 {
320 m_bCanBeCreated = false;
321 outNotification = ENotification.EDITOR_PLACING_BLOCKED;
322 previewStateToShow = SCR_EPreviewState.BLOCKED;
323 }
324
325 return m_bCanBeCreated;
326 }
327
328 foreach (Tuple3<IEntity, float, vector> compositionEntity : m_aCompositionEntities)
329 {
330 if (!compositionEntity.param1)
331 continue;
332
333 if (!CheckEntityPosition(compositionEntity.param1.GetOrigin(), compositionEntity.param2))
334 {
335 m_bCanBeCreated = false;
336 outNotification = ENotification.EDITOR_PLACING_BLOCKED;
337 previewStateToShow = SCR_EPreviewState.BLOCKED;
338 break;
339 }
340
341 if (compositionEntity.param2 < MINIMAL_ENTITY_RADIUS_TO_EVALUATE_TILT)
342 continue;
343
344 // Evaluation here needs to continue as the check can later run to an entity that will block placement completely.
345 IsCompositionTilted(compositionEntity.param1, compositionEntity.param2, compositionEntity.param3, previewStateToShow);
346 }
347
348 if (m_bCanBeCreated && (Math.AbsFloat(m_fRollMax - m_fRollMin) > m_fTiltDifferenceWarning || Math.AbsFloat(m_fPitchMax - m_fPitchMin) > m_fTiltDifferenceWarning))
349 previewStateToShow = SCR_EPreviewState.WARNING;
350
351 return m_bCanBeCreated;
352 }
353
354 //------------------------------------------------------------------------------------------------
356 protected float GetEntityProtectionRadius(notnull IEntity ent)
357 {
358 vector vectorMin, vectorMax;
359 ent.GetBounds(vectorMin, vectorMax);
360 return vector.DistanceXZ(vectorMin, vectorMax) * BOUNDING_BOX_FACTOR;
361 }
362
363 //------------------------------------------------------------------------------------------------
365 protected bool IsCompositionTilted(notnull IEntity ent, float entityRadius, vector originalTransformAngles, out SCR_EPreviewState previewStateToShow = SCR_EPreviewState.PLACEABLE)
366 {
367 vector transformMat[4];
368 ent.GetWorldTransform(transformMat);
369
370 vector transformAngles = Math3D.MatrixToAngles(transformMat);
371 vector transformAnglesToTest = originalTransformAngles - transformAngles;
372
373 if (transformAnglesToTest[1] < -m_fEntityTiltWarning || transformAnglesToTest[1] > m_fEntityTiltWarning)
374 {
375 previewStateToShow = SCR_EPreviewState.WARNING;
376 return true;
377 }
378
379 if (transformAnglesToTest[2] < -m_fEntityTiltWarning || transformAnglesToTest[2] > m_fEntityTiltWarning)
380 {
381 previewStateToShow = SCR_EPreviewState.WARNING;
382 return true;
383 }
384
385 // The tilt of the entity itself is withing the range. But save it's value to compare min and max of whole composition later to see if the maximum difference isn't triggered.
386 if (transformAnglesToTest[1] < m_fRollMin)
387 m_fRollMin = transformAnglesToTest[1];
388
389 if (transformAnglesToTest[1] > m_fRollMax)
390 m_fRollMax = transformAnglesToTest[1];
391
392 if (transformAnglesToTest[2] < m_fPitchMin)
393 m_fPitchMin = transformAnglesToTest[2];
394
395 if (transformAnglesToTest[2] > m_fPitchMax)
396 m_fPitchMax = transformAnglesToTest[2];
397
398 return false;
399 }
400
401 //------------------------------------------------------------------------------------------------
403 protected bool CheckEntityPosition(vector pos, float safeZoneRadius)
404 {
405 m_bTraceEntityPosition = true;
406
407 BaseWorld world = GetGame().GetWorld();
408 if (!world)
409 return false;
410
411 // Check if the entity to be placed is in the building range (WP on gamepad don't have a preview so previous filtration doesn't apply to them).
412 if ((vector.DistanceSqXZ(m_AreaTrigger.GetOrigin(), pos) >= m_AreaTrigger.GetSphereRadius() * m_AreaTrigger.GetSphereRadius()))
413 return false;
414
415 m_fSafeZoneRadius = safeZoneRadius;
416
417 // First do the sea level check as it is cheap and don't need to continue with trace if the composition is in the sea.
418 float val = world.GetOceanBaseHeight();
419 if (pos[1] < world.GetOceanBaseHeight() + SEA_LEVEL_OFFSET)
420 return false;
421
422 // No check for the nearby previews as we don't want to allow player to build a cliping compositions
423 if (!world.QueryEntitiesBySphere(pos, safeZoneRadius * PREVIEW_CHECK_FACTOR, EvaluateBlockingEntity))
424 return false;
425
426 // Check for solid obstacles such as houses, vehciles, other palyers etc.
427 if (m_bTraceEntityPosition && TraceEntityOnPosition(pos, world, safeZoneRadius))
428 return false;
429
430 // Check if the placing isn't blocked because the origin of the preview is in water.
431 return !ChimeraWorldUtils.TryGetWaterSurfaceSimple(world, pos);
432 }
433
434 //------------------------------------------------------------------------------------------------
436 protected bool CheckVehiclePosition()
437 {
438 if (!m_PreviewEnt)
439 return false;
440
441 BaseWorld world = GetGame().GetWorld();
442 if (!world)
443 return false;
444
445 vector transform[4];
446 m_PreviewEnt.GetTransform(transform);
447
448 vector outBoundMin, outBoundMax;
449 m_PreviewEnt.GetPreviewBounds(outBoundMin, outBoundMax);
450 outBoundMin[1] = HEIGHT_ABOVE_GROUND_VEHICLE_BUFFER;
451 outBoundMin[0] = outBoundMin[0] * BOUNDING_BOX_VEHICLE_FACTOR;
452 outBoundMin[2] = outBoundMin[2] * BOUNDING_BOX_VEHICLE_FACTOR;
453
454 TraceOBB paramOBB = new TraceOBB();
455 Math3D.MatrixIdentity3(paramOBB.Mat);
456 paramOBB.Mat[0] = transform[0];
457 paramOBB.Mat[1] = transform[1];
458 paramOBB.Mat[2] = transform[2];
459 paramOBB.Start = transform[3] + 0.05 * paramOBB.Mat[1];
460 paramOBB.Flags = TraceFlags.ENTS | TraceFlags.OCEAN | TraceFlags.WORLD;
461 paramOBB.Mins = outBoundMin;
462 paramOBB.Maxs = outBoundMax;
463
464 // First do the sea level check as it is cheap and don't need to continue with trace if the composition is in the sea.
465 float val = world.GetOceanBaseHeight();
466 if (m_PreviewEnt.GetOrigin()[1] < world.GetOceanBaseHeight() + SEA_LEVEL_OFFSET)
467 return false;
468
469 // No check for the nearby previews as we don't want to allow player to build a cliping compositions
470 if (!world.QueryEntitiesByOBB(outBoundMin, outBoundMax, transform, EvaluateBlockingEntity))
471 return false;
472
473 // Check if the placing isn't blocked because the origin of the preview is in water.
474 if (ChimeraWorldUtils.TryGetWaterSurfaceSimple(world, m_PreviewEnt.GetOrigin()))
475 return false;
476
477 return world.TracePosition(paramOBB, EvaluateBlockingEntity) > 0;
478 }
479
480 //------------------------------------------------------------------------------------------------
484 {
485 if (!ent)
486 return true;
487
489 return true;
490
492 if (!rootEnt)
493 return true;
494
495 SCR_BasePreviewEntity previewEnt = SCR_BasePreviewEntity.Cast(ent);
496 if (!previewEnt)
497 return true;
498
500
501 return ePrevEnt && m_PreviewEnt == ePrevEnt;
502 }
503
504 //------------------------------------------------------------------------------------------------
507 {
508 SCR_CampaignBuildingObstructionExceptionComponent obstructionException = SCR_CampaignBuildingObstructionExceptionComponent.Cast(ent.FindComponent(SCR_CampaignBuildingObstructionExceptionComponent));
509 if (!obstructionException)
510 return false;
511
512 // the whitelist is empty means any prefab can colide with this entity. If set check if this entity is on the list of those that can colide.
513 if (obstructionException.IsWhitelistEmpty() || obstructionException.IsOnWhitelist(m_sCompositionResourceName))
514 {
515 m_bTraceEntityPosition = false;
516 return true;
517 }
518
519 return false;
520 }
521
522 //------------------------------------------------------------------------------------------------
524 protected bool TraceEntityOnPosition(vector position, notnull BaseWorld world, float safeZoneRadius)
525 {
526 TraceParam trace = new TraceParam();
527 trace.Start = position;
528 trace.End = position - m_vTraceOffset;
529 trace.Flags = TraceFlags.ENTS | TraceFlags.OCEAN | TraceFlags.WORLD;
530 float traceCoef = world.TraceMove(trace, null);
531 position[1] = Math.Max(trace.Start[1] - traceCoef * m_vTraceOffset[1] + 0.01, world.GetSurfaceY(position[0], position[2]) + HEIGHT_ABOVE_GROUND_BUFFER);
532
534 return false;
535
537 return true;
538 }
539
540 //------------------------------------------------------------------------------------------------
551 bool TraceCylinder(vector pos, float radius = 0.5, float height = 2, TraceFlags flags = TraceFlags.ENTS | TraceFlags.OCEAN, BaseWorld world = null)
552 {
553 if (!world)
554 world = GetGame().GetWorld();
555
556 float heightHalf = height * 0.5;
557
558 TraceParam trace = new TraceParam();
559 trace.Flags = flags;
560
561 vector dir = {radius, heightHalf, 0};
562 trace.Start = pos + dir;
563 trace.End = pos - dir;
564 if (world.TraceMove(trace, null) < 1)
565 return false;
566
567 dir = {-radius, heightHalf, 0};
568 trace.Start = pos + dir;
569 trace.End = pos - dir;
570 if (world.TraceMove(trace, null) < 1)
571 return false;
572
573 dir = {0, heightHalf, radius};
574 trace.Start = pos + dir;
575 trace.End = pos - dir;
576 if (world.TraceMove(trace, null) < 1)
577 return false;
578
579 dir = {0, heightHalf, -radius};
580 trace.Start = pos + dir;
581 trace.End = pos - dir;
582 if (world.TraceMove(trace, null) < 1)
583 return false;
584
585 return true;
586 }
587}
SCR_EAIThreatSectorFlags flags
EEditableEntityLabel
ENotification
ArmaReforgerScripted GetGame()
Definition game.c:1398
enum EAIGroupCombatMode ComponentEditorProps(category:"GameScripted/AI", description:"Component for utility AI system for groups")
SCR_CampaignBuildingEditorComponent m_CampaignBuildingComponent
void OnPreviewCreated(SCR_EditablePreviewEntity previewEnt)
Method called when the preview of prefab to build is created.
ECantBuildNotificationType m_eBlockingReason
void SetInitialCanBeCreatedState(notnull SCR_EditablePreviewEntity previewEnt)
Set the initial state of the preview can / can't be created (based on the place where player place th...
SCR_EditablePreviewEntity m_PreviewEnt
ScriptedGameTriggerEntity m_AreaTrigger
bool CanCreate(out ENotification outNotification=-1, out SCR_EPreviewState previewStateToShow=SCR_EPreviewState.PLACEABLE)
Check the preview position. Is suitable to build the composition here?
bool IsCompositionTilted(notnull IEntity ent, float entityRadius, vector originalTransformAngles, out SCR_EPreviewState previewStateToShow=SCR_EPreviewState.PLACEABLE)
Check the tilt of the entities in compositions. If it goes over the set limits, the colour of preview...
void SetSuperiorCanBeCreated(bool val)
Set if the entity can be created, outside of the obstruction system. This is superior to internal m_b...
float GetEntityProtectionRadius(notnull IEntity ent)
Calculate a sphere radius about the entity which will be tested for obstruction.
bool HasObstructionException(notnull IEntity ent)
Check if detected entity has set any obstruction exception rulles.
void GetAllEntitiesToEvaluate(notnull SCR_EditablePreviewEntity rootEnt)
float GetPredefineProtectionRadius(ResourceName resName)
bool TraceEntityOnPosition(vector position, notnull BaseWorld world, float safeZoneRadius)
Trace at the position of the preview to find any possibly cliping entities.
bool IsPreviewVehicle(IEntity ent)
Check the given preview is vehicle.
bool CanBeCreated()
Return current canbeCreated value.
bool TraceCylinder(vector pos, float radius=0.5, float height=2, TraceFlags flags=TraceFlags.ENTS|TraceFlags.OCEAN, BaseWorld world=null)
bool CheckEntityPosition(vector pos, float safeZoneRadius)
Check entity position in given radius.
bool CheckVehiclePosition()
Check entity position in given bounding box.
float distance
vector position
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
proto external Managed FindComponent(typename typeName)
proto external EntityPrefabData GetPrefabData()
Definition Math.c:13
Object holding reference to resource. In destructor release the resource.
Definition Resource.c:25
void EOnEditorOpen()
When the editor is opened.
void EOnEditorOpenServer()
When the editor is opened (called on server).
void EOnEditorClose()
When the editor is closed.
SCR_BaseEditorComponent FindEditorComponent(typename type, bool showError=false, bool modeFirst=false)
static IEntityComponentSource GetCampaignBuildingCompositionSource(notnull IEntitySource entitySource)
static float GetProtectionRadius(notnull IEntityComponentSource componentSource)
bool HasEntityLabel(EEditableEntityLabel label)
void GetWorldTransform(out vector outTransform[4])
static IEntity GetMainParent(IEntity entity, bool self=false)
Definition World.c:16
EEditableEntityType
Defines type of SCR_EditableEntityComponent. Assigned automatically based on IEntity inheritance.
SCR_FieldOfViewSettings Attribute
void Tuple3(T1 p1, T2 p2, T3 p3)
Definition tuple.c:95
proto native vector Vector(float x, float y, float z)
TraceFlags
Definition TraceFlags.c:13