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

* logic for doing stuff on attack

parent 62cb0e23
No related branches found
No related tags found
No related merge requests found
......@@ -15,7 +15,6 @@
<Code IsFile="false"># create data
borg.redNumSetups = dict()
</Code>
<Import />
</HTNNode>
......@@ -118,6 +117,12 @@ _gt_activeNode.putVar("moveReason", params.get(0))
_gt_activeNode.putVar("moveDestination", wps[0])
randSpd = params.get(1)
# check if the point we're moving to is an attack position
attackFlag = "ATTACK" in params.get(2)
if attackFlag:
SendEntityEventDelay("RFC", "GoalTracker_StartAttackMove", [state.getCurrentUnitName()], 1.0)
borg.redConvoysWaiting[state.getCurrentUnit().getName()].append(info.getMyAssignedName())
CreateNetworkMove(
......@@ -131,7 +136,7 @@ CreateNetworkMove(
"MOVE",
borg.delay)
borg.delay+=5.0
printMessage("Starting move: "+str(wps)+" Spd: "+str(randSpd), True)
printMessage("Starting move("+str(attackFlag)+"): "+str(wps)+" Spd: "+str(randSpd), True)
#####################################################
# set activity to log
......
......@@ -28,6 +28,11 @@ borg.redEntityActivityOverride=dict()
borg.randomMoveStartTime=0
borg.redTimeOnStation=dict()
# used to hear the attack msg only once
_gt_activeNode.putVar("heardAttackMsg", 0)
</Code>
<Import />
</HTNNode>
......@@ -358,6 +363,7 @@ if borg.params_activateConvoyThree:
goalContainer.getCurrentExecutingStack().addReplanTrigger("GoalTracker_CreateConvoy")
goalContainer.getCurrentExecutingStack().addReplanTrigger("GoalTracker_MoveConvoy")
goalContainer.getCurrentExecutingStack().addReplanTrigger("GoalTracker_ReclaimConvoy")
goalContainer.getCurrentExecutingStack().addReplanTrigger("GoalTracker_StartAttackMove")
</Code>
<Import />
</HTNNode>
......@@ -515,6 +521,24 @@ randSpd = 10.0 + (40.0 * randSpd)
SendUnitEventDelay(tu.getName(), "GoalTracker_Assemble", [randSpd], 1)
printMessage("Convoy move: "+str(tu.getName())+" NUM DESTS: "+str(numDestinations)+" LIST: "+str(convoyDests), True)
</Code>
<Import />
</HTNNode>
</HTNNode>
<HTNNode AllowMsg="true" Name="isAttackMove" Type="DEFAULT">
<Parent>printGoalTrackerEvent</Parent>
<Code IsFile="false">
if state.getLastTrigger() == "doGoalTracker_StartAttackMove":
_htn_precon_ret=1
</Code>
<Import />
<HTNNode AllowMsg="true" Name="startAttackMove" Type="INTERRUPT">
<Parent>isMoveConvoy</Parent>
<Code IsFile="false">heardBefore = _gt_activeNode.getVar("heardAttackMsg")
if heardBefore == 0:
printMessage("START ATTACK METHODOLOGY", True)
_gt_activeNode.putVar("heardAttackMsg", 1)
</Code>
<Import />
</HTNNode>
......
......@@ -30,7 +30,7 @@ entityName = "RFC"
#################################################################################################################################################################
# Scenario Parameters
#################################################################################################################################################################
borg.isAttackRun = False
borg.isAttackRun = True
borg.redDestinations=["TRAINING01", "TRAINING02", "TRAINING03", "TRAINING04", "TRAINING05", "TRAINING06", "TRAINING07", "TRAINING08", "TRAINING09", "TRAINING10", "TRAINING11", "TRAINING12", ]
borg.redAttackDestinations=["ATTACK01", "ATTACK02", "ATTACK03", "ATTACK04", "ATTACK05", "ATTACK06", "ATTACK07", "ATTACK08", "ATTACK09", "ATTACK10", "ATTACK11", "ATTACK12", ]
......
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