Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_ScenarioFrameworkActionSetEntityTransformation.c
Go to the documentation of this file.
3{
4 [Attribute(desc: "Entity to change (Optional if action is attached on Slot that spawns target entity)")]
5 ref SCR_ScenarioFrameworkGet m_EntityGetter;
6
7 [Attribute(desc: "Name of the entity, which transformation will be used)")]
8 ref SCR_ScenarioFrameworkGet m_TransformationEntityGetter;
9
10 [Attribute(desc: "X rotation (Optional)")]
11 vector m_vRotationX;
12
13 [Attribute(desc: "Y rotation (Optional)")]
14 vector m_vRotationY;
15
16 [Attribute(desc: "Y rotation (Optional)")]
17 vector m_vRotationZ;
18
19 [Attribute(desc: "Translation (Optional)")]
20 vector m_vTranslation;
21
22 //------------------------------------------------------------------------------------------------
23 override void OnActivate(IEntity object)
24 {
25 if (!CanActivate())
26 return;
27
28 IEntity entity;
29 if (!ValidateInputEntity(object, m_EntityGetter, entity))
30 return;
31
32 vector transformation[4];
33
34 if (m_TransformationEntityGetter)
35 {
36 SCR_ScenarioFrameworkParam<IEntity> transformationEntityWrapper = SCR_ScenarioFrameworkParam<IEntity>.Cast(m_TransformationEntityGetter.Get());
37 if (!transformationEntityWrapper)
38 {
39 Print(string.Format("ScenarioFramework Action: Transformation Entity Getter has issues for action %1. Action won't do anything.", this), LogLevel.ERROR);
40 return;
41 }
42
43 IEntity transformationEntity = transformationEntityWrapper.GetValue();
44 if (!transformationEntity)
45 {
46 Print(string.Format("ScenarioFramework Action: Transformation Entity could not be found for action %1. Action won't do anything.", this), LogLevel.ERROR);
47 return;
48 }
49
50 transformationEntity.GetTransform(transformation);
51 }
52 else
53 {
54 transformation[0] = m_vRotationX;
55 transformation[1] = m_vRotationY;
56 transformation[2] = m_vRotationZ;
57 transformation[3] = m_vTranslation;
58 }
59
60 entity.SetTransform(transformation);
61 entity.Update();
62 }
63}
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
override void OnActivate()
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
proto external int Update()
proto external bool SetTransform(vector mat[4])
proto external void GetTransform(out vector mat[])
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