Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_CustomMaterialAnimatorEntity.c
Go to the documentation of this file.
1
46
47[EntityEditorProps(category: "GameScripted/MaterialAnimation", description: "This entity plays .emat animations consistently from the given starting frame to the given end frame. After the animation is done it can: Loop (default), hide the entity, delete the entity or delete the entity and children")]
49{
50};
52{
53 [Attribute("1", params: "1 99999999", category: "Material Animation", desc: "Starting frame (texture in emat Albedo Map) of the animation. If m_bDeleteWhenDone is false then it will also restart on this frame again, Use in combination with m_iEndFrameIndex to play specific sections of the material animation. The first frame is 1 (so it is not an index)")]
54 protected int m_iStartingFrame;
55
56 [Attribute("-1", params: "-1 99999999", category: "Material Animation", desc: "At which frame (texture in the Albedo Map) should the animation stop playing (loop again or destroy entity). This should never be higher then Albedo Map texture count else there might be unintentional consequences.")]
57 protected int m_iEndFrame;
58
59 [Attribute("60", params: "0.001 99999999", category: "Material Animation", desc: "Use this to change the speed of the animation. Higher value means faster animation, if you have 60 frames and this value is 60 then the animation will be done in 1 second")]
60 protected float m_fAnimationSpeed;
61
62 [Attribute(defvalue: "0", category: "Material Animation", uiwidget: UIWidgets.ComboBox, enums: ParamEnumArray.FromEnum(EActionWhenDone), desc: "What will happen when the animation is done? By default it will loop but can also set to: Hide entity (sets visiblity flag), delete entity and delete entity & children")]
64
65 //~ This value is the actual varriable the emat will read. See the top of this script how to set up the emat.
66 protected int m_iMaterialAnimationFrame = 0;
67
68 //~ This value is used to calculate the next m_iMaterialAnimationFrame
70
71
72 override protected void EOnFrame(IEntity owner, float timeSlice)
73 {
74 //~ Increase the frame calculater
76
77 //~ Set frame to converted int of calculator. The m_iMaterialAnimationFrame is the actual value the emat will read
79
80 //End of animation reached
82 {
83 //~ Animation done, Loop again to m_iStartingFrame
85 {
88 }
89 //~ Animation done, remove on Frame and hide the entity
90 else if (m_iActionWhenDone == EActionWhenDone.HIDE)
91 {
93 ClearFlags(EntityFlags.VISIBLE, true);
94 }
95 //~ Animation done delete self
96 else if (m_iActionWhenDone == EActionWhenDone.DELETE_SELF)
97 {
98 delete this;
99 }
100 //~ Animation done delete self and children
101 else if (m_iActionWhenDone == EActionWhenDone.DELETE_SELF_AND_CHILDREN)
102 {
103 SCR_EntityHelper.DeleteEntityAndChildren(this);
104 }
105 }
106 }
107
109 {
110 if (m_iEndFrame < 1)
111 Print("'SCR_CustomMaterialAnimatorEntity': 'm_iEndFrame' is not set correctly! Check the textures in the Albedo Map of the emat to find out what to set the 'm_iEndFrame' value to", LogLevel.WARNING);
112 else if (m_iStartingFrame > m_iEndFrame)
113 Print("'SCR_CustomMaterialAnimatorEntity': 'm_iStartingFrame' is higher then 'm_iEndFrame', make sure 'm_iStartingFrame' is lower then 'm_iEndFrame'!", LogLevel.WARNING);
114
115
116 //~ System works with indexes so while varriables follow the same logic as the albinoMap starting at frame 1 and ending at count. The actual logic starts at index 0 and ends at count -1.
117 m_iStartingFrame -= 1;
118 m_iEndFrame -= 1;
119
122
124 }
125};
126
134
135
136
137
138
139
140
141
142
enum SCR_ECompassType EntityEditorProps(category:"GameScripted/Gadgets", description:"Compass", color:"0 0 255 255")
Prefab data class for compass component.
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
void IEntity(IEntitySource src, IEntity parent)
protected script Constructor
proto external EntityEvent SetEventMask(EntityEvent e)
proto external EntityEvent ClearEventMask(EntityEvent e)
proto external EntityFlags ClearFlags(EntityFlags flags, bool recursively=false)
void EOnFrame(IEntity owner, float timeSlice)
void SCR_CustomMaterialAnimatorEntity(IEntitySource src, IEntity parent)
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
EntityEvent
Various entity events.
Definition EntityEvent.c:14
EntityFlags
Various entity flags.
Definition EntityFlags.c:14