Skip to content
Snippets Groups Projects
Commit 170f06ac authored by Reeves, David E's avatar Reeves, David E
Browse files

* send extra units to attack positions

parent e5258301
No related branches found
No related tags found
Loading
...@@ -18,6 +18,8 @@ borg.redConvoyDest=dict() ...@@ -18,6 +18,8 @@ borg.redConvoyDest=dict()
borg.redFormsByUnit=dict() borg.redFormsByUnit=dict()
borg.redUnitStatus=dict() borg.redUnitStatus=dict()
borg.redWaitingUnits=[]
# for logging # for logging
borg.redUnitActivity=dict() borg.redUnitActivity=dict()
borg.redUnitActivityTime=dict() borg.redUnitActivityTime=dict()
...@@ -266,89 +268,89 @@ while len(dismounts)>0: ...@@ -266,89 +268,89 @@ while len(dismounts)>0:
_gt_activeNode.putVar("convoyIndex", 0) _gt_activeNode.putVar("convoyIndex", 0)
# activate one # activate one
if borg.params_activateConvoyOne: al = ArrayList()
al = ArrayList() al.add(borg.params_activateConvoyOne)
al.add("circle") al.add("circle")
al.add("FIRE_CONTROL_RADAR") al.add("FIRE_CONTROL_RADAR")
al.add("TELAR") al.add("TELAR")
al.add("TELAR") al.add("TELAR")
al.add("TELAR") al.add("TELAR")
al.add("TELAR") al.add("TELAR")
al.add("TELAR") al.add("TELAR")
al.add("TELAR") al.add("TELAR")
al.add("TELAR") al.add("TELAR")
UtilityFuncsExp.scheduleEvent( UtilityFuncsExp.scheduleEvent(
dm, dm,
info.getMyAssignedName(), info.getMyAssignedName(),
"GoalTracker_CreateConvoy", "GoalTracker_CreateConvoy",
0.001, 0.001,
al) al)
# activate two # activate two
if borg.params_activateConvoyTwo: al = ArrayList()
al = ArrayList() al.add(borg.params_activateConvoyTwo)
al.add("bigellipse") al.add("bigellipse")
al.add("FIRE_CONTROL_RADAR") al.add("FIRE_CONTROL_RADAR")
al.add("FIRE_CONTROL_RADAR") al.add("FIRE_CONTROL_RADAR")
al.add("TELAR") al.add("TELAR")
al.add("TELAR") al.add("TELAR")
al.add("TELAR") al.add("TELAR")
al.add("TELAR") al.add("TELAR")
al.add("TELAR") al.add("TELAR")
al.add("TELAR") al.add("TELAR")
al.add("TELAR") al.add("TELAR")
al.add("TELAR") al.add("TELAR")
al.add("TELAR") al.add("TELAR")
al.add("TELAR") al.add("TELAR")
al.add("TELAR") al.add("TELAR")
al.add("TELAR") al.add("TELAR")
al.add("TELAR") al.add("TELAR")
al.add("TELAR") al.add("TELAR")
UtilityFuncsExp.scheduleEvent( UtilityFuncsExp.scheduleEvent(
dm, dm,
info.getMyAssignedName(), info.getMyAssignedName(),
"GoalTracker_CreateConvoy", "GoalTracker_CreateConvoy",
5, 5,
al) al)
# activate three # activate three
if borg.params_activateConvoyThree: al = ArrayList()
al = ArrayList() al.add(borg.params_activateConvoyThree)
al.add("bigbox") al.add("bigbox")
al.add("FIRE_CONTROL_RADAR") al.add("FIRE_CONTROL_RADAR")
al.add("TARGET_ACQ_RADAR") al.add("TARGET_ACQ_RADAR")
al.add("SPT_VEH") al.add("SPT_VEH")
al.add("SPT_VEH") al.add("SPT_VEH")
al.add("SPT_VEH") al.add("SPT_VEH")
al.add("SPT_VEH") al.add("SPT_VEH")
al.add("SPT_VEH") al.add("SPT_VEH")
al.add("SPT_VEH") al.add("SPT_VEH")
al.add("SPT_VEH") al.add("SPT_VEH")
al.add("SPT_VEH") al.add("SPT_VEH")
al.add("SPT_VEH") al.add("SPT_VEH")
al.add("SPT_VEH") al.add("SPT_VEH")
al.add("SPT_VEH") al.add("SPT_VEH")
al.add("SPT_VEH") al.add("SPT_VEH")
al.add("SPT_VEH") al.add("SPT_VEH")
al.add("SPT_VEH") al.add("SPT_VEH")
al.add("SPT_VEH") al.add("SPT_VEH")
al.add("SPT_VEH") al.add("SPT_VEH")
al.add("SPT_VEH") al.add("SPT_VEH")
al.add("SPT_VEH") al.add("SPT_VEH")
al.add("SPT_VEH") al.add("SPT_VEH")
al.add("SPT_VEH") al.add("SPT_VEH")
al.add("TELAR") al.add("TELAR")
al.add("TELAR") al.add("TELAR")
al.add("TELAR") al.add("TELAR")
UtilityFuncsExp.scheduleEvent( UtilityFuncsExp.scheduleEvent(
dm, dm,
info.getMyAssignedName(), info.getMyAssignedName(),
"GoalTracker_CreateConvoy", "GoalTracker_CreateConvoy",
10, 10,
al) al)
</Code> </Code>
<Import /> <Import />
...@@ -395,6 +397,11 @@ convoyIndex = _gt_activeNode.getVar("convoyIndex") ...@@ -395,6 +397,11 @@ convoyIndex = _gt_activeNode.getVar("convoyIndex")
# a list of the profiles the are part of this convoy # a list of the profiles the are part of this convoy
profiles = state.getLastTriggerParams()[0] profiles = state.getLastTriggerParams()[0]
# grab the activation flag. we still want to create the unit
# but we don't send them out if the activate flag is off
activateFlag = profiles.get(0)
profiles.remove(0)
# formation name to use. formation is the first string in the # formation name to use. formation is the first string in the
# profile list # profile list
formName = profiles.get(0) formName = profiles.get(0)
...@@ -427,8 +434,10 @@ tu = PythonUnit._py_createTacticalUnitMtry("CONVOY_"+str(convoyIndex), memberLis ...@@ -427,8 +434,10 @@ tu = PythonUnit._py_createTacticalUnitMtry("CONVOY_"+str(convoyIndex), memberLis
_gt_activeNode.putVar("convoyIndex", convoyIndex+1) _gt_activeNode.putVar("convoyIndex", convoyIndex+1)
# go to making the convoy move (still in this tree) # go to making the convoy move (still in this tree)
SendEntityEventDelay(info.getMyAssignedName(), "GoalTracker_MoveConvoy", [tu.getName(), formName], 1) if activateFlag:
SendEntityEventDelay(info.getMyAssignedName(), "GoalTracker_MoveConvoy", [tu.getName(), formName, "False"], 1)
else:
borg.redWaitingUnits.append([tu.getName(), formName])
</Code> </Code>
<Import /> <Import />
...@@ -493,6 +502,13 @@ elif numDestChance &gt; 0.5: ...@@ -493,6 +502,13 @@ elif numDestChance &gt; 0.5:
if borg.params_overrideNumDests &gt; 0: if borg.params_overrideNumDests &gt; 0:
numDestinations = borg.params_overrideNumDests numDestinations = borg.params_overrideNumDests
# check for back unit override
backupUnit = state.getLastTriggerParams()[0].get(2)
if backupUnit == "True":
# this only happens on attack runs so we trick the system into just creating an attack
# position
numDestinations = 0
convoyDests = [] convoyDests = []
for n in range(numDestinations): for n in range(numDestinations):
destName = borg.redDestinations[0] destName = borg.redDestinations[0]
...@@ -534,11 +550,20 @@ if state.getLastTrigger() == "doGoalTracker_StartAttackMove": ...@@ -534,11 +550,20 @@ if state.getLastTrigger() == "doGoalTracker_StartAttackMove":
<Import /> <Import />
<HTNNode AllowMsg="true" Name="startAttackMove" Type="INTERRUPT"> <HTNNode AllowMsg="true" Name="startAttackMove" Type="INTERRUPT">
<Parent>isMoveConvoy</Parent> <Parent>isMoveConvoy</Parent>
<Code IsFile="false">heardBefore = _gt_activeNode.getVar("heardAttackMsg") <Code IsFile="false">import cxxi.model.knowledge.group.holders.NewUnitHolder as NewUnitHolder
heardBefore = _gt_activeNode.getVar("heardAttackMsg")
if heardBefore == 0: if heardBefore == 0:
printMessage("START ATTACK METHODOLOGY", True) printMessage("START ATTACK METHODOLOGY WAITING UNITS:"+str(borg.redWaitingUnits), True)
_gt_activeNode.putVar("heardAttackMsg", 1) _gt_activeNode.putVar("heardAttackMsg", 1)
for unitInfo in borg.redWaitingUnits:
unitName = unitInfo[0]
formName = unitInfo[1]
SendEntityEventDelay(info.getMyAssignedName(), "GoalTracker_MoveConvoy", [unitName, formName, "True"], 1)
</Code> </Code>
<Import /> <Import />
</HTNNode> </HTNNode>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment