3 static const string PRESET_INDEX_PORT =
"PresetIndexIn";
4 static const string FAST_INIT_PORT =
"FastInitIn";
5 static const string WAYPOINT_PORT =
"WaypointIn";
7 [
Attribute(
"-1", UIWidgets.EditBox,
"Set current preset index of defend waypoint")];
8 private int m_iNewPresetIndex;
10 [
Attribute(
"-1", UIWidgets.EditBox,
"Set fast init for of defend waypoint")];
11 private int m_iNewFastInit;
14 protected static ref TStringArray s_aVarsIn = {
19 override TStringArray GetVariablesIn()
25 override ENodeResult EOnTaskSimulate(AIAgent owner,
float dt)
31 AIGroup group = AIGroup.Cast(owner);
35 return ENodeResult.FAIL;
38 if (!GetVariableIn(WAYPOINT_PORT, waypoint))
40 waypoint = group.GetCurrentWaypoint();
46 return NodeError(
this, owner,
"Did not provide defend waypoint to set!");
49 if (!GetVariableIn(PRESET_INDEX_PORT, newIndex))
50 newIndex = m_iNewPresetIndex;
52 if (newIndex > -1 && !wp.SetCurrentDefendPreset(newIndex))
54 return NodeError(
this, owner,
"Wrong index of preset provided");
57 if (!GetVariableIn(FAST_INIT_PORT, newIndex))
58 newIndex = m_iNewFastInit;
62 wp.SetFastInit(newIndex);
65 return ENodeResult.SUCCESS;
69 protected override bool VisibleInPalette()
75 protected override string GetOnHoverDescription()
77 return "Changes preset of defend waypoint, defined in m_DefendPresets array of defend waypoint entity.";