Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_PrefabDeleter.c
Go to the documentation of this file.
1 [EntityEditorProps(category: "GameScripted/ScriptWizard", description: "Deletes entity in certain radius.")]
2 class SCR_PrefabDeleterEntityClass : GenericEntityClass
3 {
4 }
5 
6 //------------------------------------------------------------------------------------------------
8 {
9  [Attribute(defvalue: "10", uiwidget: UIWidgets.Slider, desc: "Radius in which entities are deleted", "0 1000 1")]
10  protected float m_fRadius;
11 
12  //------------------------------------------------------------------------------------------------
13  private bool QueryEntities(IEntity e)
14  {
15  SCR_EntityHelper.DeleteEntityAndChildren(e);
16  return true;
17  }
18 
19  //------------------------------------------------------------------------------------------------
20  override void EOnInit(IEntity owner)
21  {
22  // server only
23  RplComponent rplComponent = RplComponent.Cast(owner.FindComponent(RplComponent));
24  if (rplComponent && !rplComponent.IsMaster())
25  return;
26 
27  BaseWorld world = GetWorld();
28  world.QueryEntitiesBySphere(owner.GetOrigin(), m_fRadius, QueryEntities);
29 
30  // destroy self
31  delete owner;
32  }
33 
34  //------------------------------------------------------------------------------------------------
35  // constructor
38  void SCR_PrefabDeleterEntity(IEntitySource src, IEntity parent)
39  {
40  if (!GetGame().InPlayMode())
41  return;
42 
43  SetEventMask(EntityEvent.INIT);
44  }
45 
46 #ifdef WORKBENCH
47 
48  //------------------------------------------------------------------------------------------------
49  override void _WB_AfterWorldUpdate(float timeSlice)
50  {
51 
52  auto origin = GetOrigin();
53  auto radiusShape = Shape.CreateSphere(COLOR_YELLOW, ShapeFlags.WIREFRAME | ShapeFlags.ONCE, origin, m_fRadius);
54 
55  super._WB_AfterWorldUpdate(timeSlice);
56  }
57 
58 #endif
59 
60 }
SCR_EntityHelper
Definition: SCR_EntityHelper.c:1
EntityEditorProps
enum EQueryType EntityEditorProps(category:"GameScripted/Sound", description:"THIS IS THE SCRIPT DESCRIPTION.", color:"0 0 255 255")
Definition: SCR_AmbientSoundsComponent.c:12
GetGame
ArmaReforgerScripted GetGame()
Definition: game.c:1424
Attribute
SCR_PrefabDeleterEntityClass GenericEntityClass Attribute(defvalue:"10", uiwidget:UIWidgets.Slider, desc:"Radius in which entities are deleted", "0 1000 1")] protected float m_fRadius
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition: SCR_RespawnBriefingComponent.c:17
GenericEntity
SCR_GenericBoxEntityClass GenericEntity
GetOrigin
vector GetOrigin()
Definition: SCR_AIUtilityComponent.c:279
m_fRadius
float m_fRadius
Definition: SCR_AITargetClusterState.c:30
QueryEntities
private bool QueryEntities(IEntity e)
Definition: SCR_PrefabDeleter.c:13
SCR_PrefabDeleterEntityClass
Definition: SCR_PrefabDeleter.c:2
EOnInit
override void EOnInit(IEntity owner)
Definition: SCR_PrefabDeleter.c:20
SCR_PrefabDeleterEntity
void SCR_PrefabDeleterEntity(IEntitySource src, IEntity parent)
Definition: SCR_PrefabDeleter.c:38
category
params category
Definition: SCR_VehicleDamageManagerComponent.c:180