Arma Reforger Explorer
1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Toggle main menu visibility
Loading...
Searching...
No Matches
SCR_AISkillEditorAttribute.c
Go to the documentation of this file.
1
[
BaseContainerProps
(),
SCR_BaseEditorAttributeCustomTitle
()]
2
class
SCR_AiSkillEditorAttribute
:
SCR_BaseFloatValueHolderEditorAttribute
3
{
4
//---- REFACTOR NOTE START: Not up to date with internal scripting style ----
5
// Probably not implemeneted
6
7
override
SCR_BaseEditorAttributeVar
ReadVariable(Managed item, SCR_AttributesManagerEditorComponent manager)
8
{
9
SCR_EditableEntityComponent
editableEntity =
SCR_EditableEntityComponent
.Cast(item);
10
if
(!editableEntity || (editableEntity.
GetEntityType
() !=
EEditableEntityType
.CHARACTER && editableEntity.
GetEntityType
() !=
EEditableEntityType
.GROUP))
return
null;
11
if
(editableEntity.
HasEntityState
(
EEditableEntityState
.PLAYER))
return
null;
12
13
//WIP
14
#ifndef WORKBENCH
15
return
null;
16
#endif
17
18
int
rank;
19
20
//If character
21
if
(editableEntity.
GetEntityType
() ==
EEditableEntityType
.CHARACTER)
22
{
23
rank =
SCR_CharacterRankComponent
.GetCharacterRank(editableEntity.GetOwner());
24
}
25
//If group
26
else
27
{
28
SCR_AIGroup
aiGroup =
SCR_AIGroup
.Cast(editableEntity.GetOwner());
29
if
(!aiGroup)
return
null;
30
rank =
SCR_CharacterRankComponent
.GetCharacterRank(aiGroup.GetLeaderEntity());
31
}
32
33
return
SCR_BaseEditorAttributeVar
.
CreateInt
(rank);
34
}
35
36
override
void
WriteVariable(Managed item,
SCR_BaseEditorAttributeVar
var, SCR_AttributesManagerEditorComponent manager,
int
playerID)
37
{
38
if
(!var)
return
;
39
SCR_EditableEntityComponent
editableEntity =
SCR_EditableEntityComponent
.Cast(item);
40
41
if
(editableEntity.
GetEntityType
() ==
EEditableEntityType
.CHARACTER)
42
{
43
Print
(
"Set Character skill to: "
+
m_aValues
[var.
GetInt
()].GetName());
44
}
45
else
if
(editableEntity.
GetEntityType
() ==
EEditableEntityType
.GROUP)
46
{
47
Print
(
"Set Group skill to: "
+
m_aValues
[var.
GetInt
()].GetName());
48
}
49
50
//AI rank not in game
51
52
/*
53
SCR_EditableEntityComponent editableEntity = SCR_EditableEntityComponent.Cast(item);
54
if (!editableEntity.GetEntityType() == EEditableEntityType.CHARACTER && !editableEntity.GetEntityType() == EEditableEntityType.GROUP) return;
55
if (editableEntity.HasEntityState(EEditableEntityState.PLAYER)) return;
56
57
int rank = var.GetInt();
58
59
//If character
60
if (editableEntity.GetEntityType() == EEditableEntityType.CHARACTER)
61
{
62
SCR_CharacterRankComponent rankComponent = SCR_CharacterRankComponent.Cast(editableEntity.FindComponent(SCR_CharacterRankComponent));
63
if (!rankComponent) return;
64
65
rankComponent.SetCharacterRank(rank);
66
67
rank = SCR_CharacterRankComponent.GetCharacterRank(editableEntity.GetOwner());
68
}
69
//If group
70
else
71
{
72
Print("Set ranks of group members");
73
74
//Set group rank
75
AIGroup group = SCR_EditableGroupComponent.Cast(editableEntity).GetGroup();
76
77
array<AIAgent> agents;
78
group.GetAgents(agents);
79
int count = agents.Count();
80
81
for (int i = 0; i < count; ++i)
82
{
83
84
}
85
}*/
86
}
87
//---- REFACTOR NOTE END ----
88
};
BaseContainerProps
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
Definition
SCR_AIAnimationWaypoint.c:14
SCR_CharacterRankComponent
void SCR_CharacterRankComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
Definition
SCR_CharacterRankComponent.c:306
SCR_AIGroup
Definition
SCR_AIGroup.c:75
SCR_AiSkillEditorAttribute
Definition
SCR_AISkillEditorAttribute.c:3
SCR_BaseEditorAttributeCustomTitle
Definition
SCR_BaseEditorAttribute.c:876
SCR_BaseEditorAttributeVar
Definition
SCR_BaseEditorAttributeVar.c:2
SCR_BaseEditorAttributeVar::CreateInt
static SCR_BaseEditorAttributeVar CreateInt(int value)
Definition
SCR_BaseEditorAttributeVar.c:107
SCR_BaseEditorAttributeVar::GetInt
int GetInt()
Definition
SCR_BaseEditorAttributeVar.c:20
SCR_BaseFloatValueHolderEditorAttribute
Attribute base for Name, icon and float value for other attributes to inherent from.
Definition
SCR_BaseFloatValueHolderEditorAttribute.c:4
SCR_BaseFloatValueHolderEditorAttribute::m_aValues
ref array< ref SCR_EditorAttributeFloatStringValueHolder > m_aValues
Definition
SCR_BaseFloatValueHolderEditorAttribute.c:6
SCR_EditableEntityComponent
Definition
SCR_EditableEntityComponent.c:14
SCR_EditableEntityComponent::HasEntityState
bool HasEntityState(EEditableEntityState state)
Definition
SCR_EditableEntityComponent.c:1590
SCR_EditableEntityComponent::GetEntityType
EEditableEntityType GetEntityType(IEntity owner=null)
Definition
SCR_EditableEntityComponent.c:127
Print
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
EEditableEntityType
EEditableEntityType
Defines type of SCR_EditableEntityComponent. Assigned automatically based on IEntity inheritance.
Definition
EEditableEntityType.c:6
EEditableEntityState
EEditableEntityState
Definition
EEditableEntityState.c:38
scripts
Game
Editor
Containers
Attributes
SCR_AISkillEditorAttribute.c
Generated by
1.17.0