Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
GeneralCinematicTrack.c
Go to the documentation of this file.
1[CinematicTrackAttribute(name:"General Track", description:"Track used for animating general parameters of entities")]
3{
4
5 [Attribute("1.0", params:"0.01 1000.0")]
6 float m_bScale;
7
8 [Attribute("0 0 0")]
9 vector m_YawPitchRoll;
10
11 [Attribute("0 0 0")]
12 vector m_Position;
13
14 private GenericEntity m_GeneralEntity;
15 private World globalWorld;
16
17 override void OnInit(World world)
18 {
19 // Find particle entity by using name of track
20 findEntity(world);
21 globalWorld = world;
22 }
23
24 void findEntity(World world)
25 {
26 // Find particle entity by using name of track
27 TStringArray strs = new TStringArray;
28 GetTrackName().Split("_", strs, true);
29
30 if (strs.Get(0) == "player")
31 {
33 return;
34
35 m_GeneralEntity = SCR_ChimeraCharacter.Cast(GetGame().GetPlayerController().GetControlledEntity());
36
37 return;
38 }
39
40 m_GeneralEntity = GenericEntity.Cast(world.FindEntityByName(strs.Get(0)));
41 }
42
43 override void OnApply(float time)
44 {
45
46 if (globalWorld)
47 {
48 //Finding effect entity each frame for keep working in edit time
49 findEntity(globalWorld);
50 }
51
52 if (m_GeneralEntity)
53 {
54
55 //Set Scale
56 m_GeneralEntity.SetScale(m_bScale);
57
58 //Set rotation
59 m_GeneralEntity.SetYawPitchRoll(m_YawPitchRoll);
60
61 vector mat[4];
62 m_GeneralEntity.GetTransform(mat);
63 mat[3] = m_Position;
64 m_GeneralEntity.SetTransform(mat);
65
66 m_GeneralEntity.Update();
67 }
68 }
69}
ArmaReforgerScripted GetGame()
Definition game.c:1398
Definition World.c:16
SCR_EditableEntityComponent GetControlledEntity()
SCR_FieldOfViewSettings Attribute
proto external PlayerController GetPlayerController()
array< string > TStringArray
Definition Types.c:385