Arma Reforger Explorer
1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Toggle main menu visibility
Loading...
Searching...
No Matches
ScriptModel.c
Go to the documentation of this file.
1
[
EntityEditorProps
(
category
:
"GameLib/Scripted"
, description:
"Script model"
, dynamicBox:
true
)]
2
class
ScriptModelClass
: GenericEntityClass
3
{
4
5
};
6
7
class
ScriptModel:
GenericEntity
8
{
9
[
Attribute
(
""
,
UIWidgets
.ResourceNamePicker,
"Model"
,
"xob"
)]
10
ResourceName
Model;
11
[
Attribute
(
"1"
,
UIWidgets
.ComboBox,
"Physics"
,
""
, { ParamEnum(
"None"
,
"2"
), ParamEnum(
"Static"
,
"1"
), ParamEnum(
"Dynamic"
,
"0"
) } )]
12
int
Type;
13
14
void
ScriptModel(
IEntitySource
src,
IEntity
parent)
15
{
16
if
(Model==
""
)
17
return
;
18
19
SetFlags
(
EntityFlags
.ACTIVE |
EntityFlags
.TRACEABLE |
EntityFlags
.VISIBLE,
false
);
20
21
Resource
resource =
Resource
.Load(Model);
22
VObject
vobj = resource.GetResource().ToVObject();
23
SetObject(vobj,
""
);
24
25
if
(Type == 1)
26
{
27
Physics
.CreateStatic(
this
, 0xffffffff);
// todo - defines for layer mask
28
}
29
else
if
(Type == 0)
30
{
31
if
(!
Physics
.CreateDynamic(
this
, 1.0, 0xffffffff))
32
{
33
//create implicit box
34
vector
mins, maxs;
35
GetBounds
(mins, maxs);
36
vector
center = (mins + maxs) * 0.5;
37
vector
size
= maxs - mins;
38
39
ref
PhysicsGeomDef
geoms[] = {
PhysicsGeomDef
(
""
,
PhysicsGeom
.CreateBox(
size
),
"material/default"
, 0xffffffff)};
40
Physics
.CreateDynamicEx(
this
, center, 1, geoms);
41
}
42
if
(
GetPhysics
())
43
{
44
GetPhysics
().SetMass(1.0);
45
GetPhysics
().SetActive(
ActiveState
.ACTIVE);
46
}
47
}
48
}
49
50
void
~ScriptModel()
51
{
52
if
(
GetPhysics
())
53
GetPhysics
().Destroy();
54
}
55
};
size
int size
Definition
PrefabImporter.c:35
EntityEditorProps
enum SCR_ECompassType EntityEditorProps(category:"GameScripted/Gadgets", description:"Compass", color:"0 0 255 255")
Prefab data class for compass component.
Definition
SCR_CompassComponent.c:10
category
params category
Definition
SCR_VehicleDamageManagerComponent.c:302
GenericEntity
Definition
GenericEntity.c:16
IEntity::IEntity
void IEntity(IEntitySource src, IEntity parent)
protected script Constructor
IEntity::GetPhysics
proto external Physics GetPhysics()
IEntity::GetBounds
proto external void GetBounds(out vector mins, out vector maxs)
IEntity::SetFlags
proto external EntityFlags SetFlags(EntityFlags flags, bool recursively=false)
IEntitySource
Definition
IEntitySource.c:13
PhysicsGeomDef
Definition
PhysicsGeomDef.c:16
PhysicsGeom
Definition
PhysicsGeom.c:16
Physics
Definition
Physics.c:22
Resource
Object holding reference to resource. In destructor release the resource.
Definition
Resource.c:25
ResourceName
Definition
ResourceName.c:13
ScriptModelClass
Definition
ScriptModel.c:3
UIWidgets
Definition
attributes.c:40
VObject
Visual object.
Definition
VObject.c:14
vector
Definition
vector.c:13
Attribute
SCR_FieldOfViewSettings Attribute
Definition
SendGoalMessage.c:170
EntityFlags
EntityFlags
Various entity flags.
Definition
EntityFlags.c:14
ActiveState
ActiveState
Definition
ActiveState.c:16
scripts
Game
Entities
ScriptModel.c
Generated by
1.17.0