Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_DeployableVariantContainer.c
Go to the documentation of this file.
2{
3 [Attribute(defvalue: "0", desc: "Variant id which must be unique", params: "-1 inf")]
4 protected int m_iVariantId;
5
6 [Attribute(defvalue: "", desc: "Prefab which will be spawned when this variant is deployed", uiwidget: UIWidgets.ResourcePickerThumbnail, params: "et")]
8
9 [Attribute(uiwidget: UIWidgets.ResourcePickerThumbnail, desc: "Model or prefab that will be shown as a preview", params: "xob et", category: "Setup")]
11
12 [Attribute(desc: "List of prefabs that must be met in order to deploy this entity", category: "Setup")]
13 protected ref array<ref SCR_RequiredDeployablePart> m_aRequiredElements;
14
15 [Attribute(desc: "List of additionall prefabs that should be spawned when item is deployed", params: "et", category: "Setup")]
16 protected ref array<ref SCR_AdditionalDeployablePart> m_aAdditionalPrefabs;
17
18 [Attribute(desc: "Coordinate describing the bounding box volume used for obstruction check.\nIf left zero, then game will try to load it from data. This will work only if there is an override of the bouding volume.\nEnsure that individual components of this vector are smaller than their counterparts in 'Replacement Prefab Bounding Box Maxs'", params: "inf inf purpose=coords space=entity anglesVar=Angles", category: "Validation")]
20
21 [Attribute(desc: "Coordinate describing the bounding box volume used for obstruction check.\nIf left zero, then game will try to load it from data of replacement prefab. This will work only if there is an override of the bouding volume", params: "inf inf purpose=coords space=entity anglesVar=Angles", category: "Validation")]
23
24 [Attribute(defvalue: "0", desc: "Use this part rotation and position for the positioning of the replacement entity")]
26
27 [Attribute(desc: "Additional offset to the position at which entity will be spawned", params: "inf inf purpose=coords space=entity anglesVar=Angles", category: "Setup")]
29
30 [Attribute(desc: "Additional rotation that will applied to the spawned entity", params: "inf inf purpose=angles space=entity coordsVar=coordsVariableName", category: "Setup")]
32
33 [Attribute("-1", desc: "Max allowed tilt (in dgrees) from zero value on give axis.\nValue below 0 means that there is no angle restriction", params: "-1 180")]
34 protected float m_fMaxAllowedTilt;
35
36 [Attribute(desc: "Class which is going to check if the surface on which this variant is being deployed is a valid one.\nIf this is left empty then there is no validation of the surface entity.")]
38
39 //------------------------------------------------------------------------------------------------
42 {
43 return m_iVariantId;
44 }
45
46 //------------------------------------------------------------------------------------------------
52
53 //------------------------------------------------------------------------------------------------
57 int GetRequiredElements(out notnull array<ref SCR_RequiredDeployablePart> output)
58 {
60 return 0;
61
63 {
64 output.Insert(partReq.DeepClone());
65 }
66
67 return output.Count();
68 }
69
70 //------------------------------------------------------------------------------------------------
72 array<ref SCR_RequiredDeployablePart> GetRequiredElementsRaw()
73 {
75 }
76
77 //------------------------------------------------------------------------------------------------
79 array<ref SCR_AdditionalDeployablePart> GetAdditionalPrefabList()
80 {
82 return null;
83
84 array<ref SCR_AdditionalDeployablePart> output = {};
86 {
87 output.Insert(SCR_AdditionalDeployablePart.Cast(part.Clone()));
88 }
89
90 return output;
91 }
92
93 //------------------------------------------------------------------------------------------------
98 {
100 {
102 if (!res)
103 return false;
104
105 BaseResourceObject resObject = res.GetResource();
106 if (!resObject)
107 return false;
108
109 IEntitySource entSource = resObject.ToEntitySource();
110 if (!entSource)
111 return false;
112
113 IEntityComponentSource compSource;
114 BaseContainer boundingBox;
115 for (int i, count = entSource.GetComponentCount(); i < count; i++)
116 {
117 compSource = entSource.GetComponent(i);
118 if (!compSource)
119 continue;
120
121 if (compSource.GetClassName().ToType() != MeshObject)
122 continue;
123
124 boundingBox = compSource.GetObject("BoundingBox");
125 if (!boundingBox)
126 return false;
127
128 boundingBox.Get("Mins", m_vReplacementPrefabBoundingBoxMins);
129 boundingBox.Get("Maxs", m_vReplacementPrefabBoundingBoxMaxs);
130 //NOTE: this only works when there is an override of BB, but in other case there is no other way besides spawning it and asking for it :(
131 }
132 }
133
136 return mins != vector.Zero || maxs != vector.Zero;
137 }
138
139 //------------------------------------------------------------------------------------------------
145
146 //------------------------------------------------------------------------------------------------
157 bool IsSurfaceValid(IEntity surfaceEnt, vector worldPosition, vector surfaceNorm, int nodeIndex, int colliderIndex, SurfaceProperties surfaceProps, string surfaceMaterial, string colliderName)
158 {
160 return true;
161
162 return m_SurfaceValidator.IsSurfaceValid(surfaceEnt, worldPosition, surfaceNorm, nodeIndex, colliderIndex, surfaceProps, surfaceMaterial, colliderName);
163 }
164
165 //------------------------------------------------------------------------------------------------
171
172 //------------------------------------------------------------------------------------------------
178
179 //------------------------------------------------------------------------------------------------
182 {
183 return m_fMaxAllowedTilt;
184 }
185
186 //------------------------------------------------------------------------------------------------
192
193 //------------------------------------------------------------------------------------------------
194 // constructor
196 {
198 {
200 Print("[SCR_DeployableVariantContainer] Variant with id = " + m_iVariantId + " 'Replacement Prefab Bounding Box Mins' has larger X component than one in 'Replacement Prefab Bounding Box Maxs'. This is not allowed!", LogLevel.ERROR);
201
203 Print("[SCR_DeployableVariantContainer] Variant with id = " + m_iVariantId + " 'Replacement Prefab Bounding Box Mins' has larger Y component than one in 'Replacement Prefab Bounding Box Maxs'. This is not allowed!", LogLevel.ERROR);
204
206 Print("[SCR_DeployableVariantContainer] Variant with id = " + m_iVariantId + " 'Replacement Prefab Bounding Box Mins' has larger Z component than one in 'Replacement Prefab Bounding Box Maxs'. This is not allowed!", LogLevel.ERROR);
207 }
208 }
209}
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
MeshObject.
Definition MeshObject.c:34
Object holding reference to resource. In destructor release the resource.
Definition Resource.c:25
This is a base variant that does nothing, and thus it must NOT be used.
array< ref SCR_AdditionalDeployablePart > GetAdditionalPrefabList()
bool GetReplacementPrefabBoundingBox(out vector mins, out vector maxs)
ref array< ref SCR_RequiredDeployablePart > m_aRequiredElements
ref array< ref SCR_AdditionalDeployablePart > m_aAdditionalPrefabs
array< ref SCR_RequiredDeployablePart > GetRequiredElementsRaw()
Returns pointer to a shared array of requirements.
bool IsSurfaceValid(IEntity surfaceEnt, vector worldPosition, vector surfaceNorm, int nodeIndex, int colliderIndex, SurfaceProperties surfaceProps, string surfaceMaterial, string colliderName)
ref SCR_DeployableSurfaceValidation m_SurfaceValidator
int GetRequiredElements(out notnull array< ref SCR_RequiredDeployablePart > output)
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