Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_AISkillEditorAttribute.c
Go to the documentation of this file.
3 {
4  override SCR_BaseEditorAttributeVar ReadVariable(Managed item, SCR_AttributesManagerEditorComponent manager)
5  {
7  if (!editableEntity || (editableEntity.GetEntityType() != EEditableEntityType.CHARACTER && editableEntity.GetEntityType() != EEditableEntityType.GROUP)) return null;
8  if (editableEntity.HasEntityState(EEditableEntityState.PLAYER)) return null;
9 
10  //WIP
11  #ifndef WORKBENCH
12  return null;
13  #endif
14 
15  int rank;
16 
17  //If character
18  if (editableEntity.GetEntityType() == EEditableEntityType.CHARACTER)
19  {
20  rank = SCR_CharacterRankComponent.GetCharacterRank(editableEntity.GetOwner());
21  }
22  //If group
23  else
24  {
25  SCR_AIGroup aiGroup = SCR_AIGroup.Cast(editableEntity.GetOwner());
26  if (!aiGroup) return null;
27  rank = SCR_CharacterRankComponent.GetCharacterRank(aiGroup.GetLeaderEntity());
28  }
29 
30  return SCR_BaseEditorAttributeVar.CreateInt(rank);
31  }
32 
33  override void WriteVariable(Managed item, SCR_BaseEditorAttributeVar var, SCR_AttributesManagerEditorComponent manager, int playerID)
34  {
35  if (!var) return;
36  SCR_EditableEntityComponent editableEntity = SCR_EditableEntityComponent.Cast(item);
37 
38  if (editableEntity.GetEntityType() == EEditableEntityType.CHARACTER)
39  {
40  Print("Set Character skill to: " + m_aValues[var.GetInt()].GetName());
41  }
42  else if (editableEntity.GetEntityType() == EEditableEntityType.GROUP)
43  {
44  Print("Set Group skill to: " + m_aValues[var.GetInt()].GetName());
45  }
46 
47  //AI rank not in game
48 
49  /*
50  SCR_EditableEntityComponent editableEntity = SCR_EditableEntityComponent.Cast(item);
51  if (!editableEntity.GetEntityType() == EEditableEntityType.CHARACTER && !editableEntity.GetEntityType() == EEditableEntityType.GROUP) return;
52  if (editableEntity.HasEntityState(EEditableEntityState.PLAYER)) return;
53 
54  int rank = var.GetInt();
55 
56  //If character
57  if (editableEntity.GetEntityType() == EEditableEntityType.CHARACTER)
58  {
59  SCR_CharacterRankComponent rankComponent = SCR_CharacterRankComponent.Cast(editableEntity.FindComponent(SCR_CharacterRankComponent));
60  if (!rankComponent) return;
61 
62  rankComponent.SetCharacterRank(rank);
63 
64  rank = SCR_CharacterRankComponent.GetCharacterRank(editableEntity.GetOwner());
65  }
66  //If group
67  else
68  {
69  Print("Set ranks of group members");
70 
71  //Set group rank
72  AIGroup group = SCR_EditableGroupComponent.Cast(editableEntity).GetGroup();
73 
74  array<AIAgent> agents;
75  group.GetAgents(agents);
76  int count = agents.Count();
77 
78  for (int i = 0; i < count; ++i)
79  {
80 
81  }
82  }*/
83  }
84 };
EEditableEntityState
EEditableEntityState
Definition: EEditableEntityState.c:37
m_aValues
SCR_BaseEditorAttributeEntryTimeSlider m_aValues
SCR_BaseEditorAttributeCustomTitle
Definition: SCR_BaseEditorAttribute.c:868
SCR_CharacterRankComponent
void SCR_CharacterRankComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
Definition: SCR_CharacterRankComponent.c:209
SCR_BaseEditorAttributeVar
Definition: SCR_BaseEditorAttributeVar.c:1
EEditableEntityType
EEditableEntityType
Defines type of SCR_EditableEntityComponent. Assigned automatically based on IEntity inheritance.
Definition: EEditableEntityType.c:5
SCR_EditableEntityComponent
Definition: SCR_EditableEntityComponent.c:13
SCR_AIGroup
Definition: SCR_AIGroup.c:68
SCR_BaseFloatValueHolderEditorAttribute
Attribute base for Name, icon and float value for other attributes to inherent from.
Definition: SCR_BaseFloatValueHolderEditorAttribute.c:3
SCR_AiSkillEditorAttribute
Definition: SCR_AISkillEditorAttribute.c:2
BaseContainerProps
SCR_AIGoalReaction_Follow BaseContainerProps
Handles insects that are supposed to be spawned around selected prefabs defined in prefab names array...
Definition: SCR_AIGoalReaction.c:468