Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_ScenarioFrameworkActionSetEntityPosition.c
Go to the documentation of this file.
3{
4 [Attribute(desc: "Entity to be teleported (Optional if action is attached on Slot that spawns target entity)")]
5 ref SCR_ScenarioFrameworkGet m_EntityGetter;
6
7 [Attribute(defvalue: "0 0 0", desc: "Position that the entity will be teleported to")]
8 vector m_vDestination;
9
10 [Attribute(desc: "Name of the entity that above selected entity will be teleported to (Optional)")]
11 ref SCR_ScenarioFrameworkGet m_DestinationEntityGetter;
12
13 [Attribute(defvalue: "0 0 0", desc: "Position that will be used in relation to the entity for the position to teleport to (Optional)")]
14 vector m_vDestinationEntityRelativePosition;
15
16 //------------------------------------------------------------------------------------------------
17 override void OnActivate(IEntity object)
18 {
19 if (!CanActivate())
20 return;
21
22 IEntity entity;
23 if (!ValidateInputEntity(object, m_EntityGetter, entity))
24 return;
25
26 if (!m_DestinationEntityGetter)
27 {
28 entity.SetOrigin(m_vDestination);
29 entity.Update();
30 return;
31 }
32
33 SCR_ScenarioFrameworkParam<IEntity> destinationEntityWrapper = SCR_ScenarioFrameworkParam<IEntity>.Cast(m_DestinationEntityGetter.Get());
34 if (!destinationEntityWrapper)
35 {
36 Print(string.Format("ScenarioFramework Action: Destination Entity Getter has issues for action %1. Action won't do anything.", this), LogLevel.ERROR);
37 return;
38 }
39
40 IEntity destinationEntity = destinationEntityWrapper.GetValue();
41 if (!destinationEntity)
42 {
43 Print(string.Format("ScenarioFramework Action: Destination Entity could not be found for action %1. Action won't do anything.", this), LogLevel.ERROR);
44 return;
45 }
46
47 entity.SetOrigin(destinationEntity.GetOrigin() + m_vDestinationEntityRelativePosition);
48 entity.Update();
49 }
50}
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
override void OnActivate()
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
proto external void SetOrigin(vector orig)
proto external vector GetOrigin()
proto external int Update()
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