
APT.all-test.MOUTBot.record-threat.soar Maven / Gradle / Ivy
echo "\nLoading record-threat"
## Create link to a new enemy
# [1] REW: 2002-07-27wr
# Don't record a threat for an agent for any friendly team members
# Note that MOUT under ^entity.agent.name is not upcased. They have
# to be |MoutBot1| to match here.
# AMN: 2002-08-02 - Added |Player| as a friendly team member so agent will
# ignore the "ghost" that shows up. (Devvan's working on it...)
# [3] REW: 2002-08-26
# Added production to copy new threats to the sentry-watch structure
# [4] REW: 2002-08-28
# Evidently the MoutBot names are now MOUTBot so I added these to the record-threat proposal
# [5] REW: 2002-09-11
# Made basic proposal depend on active objective other than sentry-watch
# Must assume that sentry-watch will terminate if it's ever true that a threat is present
# (ie, where a threat is different from a contact).
# Basic idea is to not use record threat for contacts made during sentry-watch
# This means that sentry-watch will not record threats.
# [6] REW: 2002-09-25
# Completed and tested changes described in [6].
# Note that the threat is never deleted unless we can't determine
# it's name. The ^threat.entity is deleted/re-added as threats change
# from visible to not visible and back again.
# [7] REW: 2003-05-27
# Make the determination of threat be someone not on IGNORE or REDFOR scenario list
# IF we use ^team then we can't ignore non-combatants/just ignore the player
# [8] REW: 2003-06-04
# Only record threat based on vision (input-link.entity) if the bot is not behind
# (this simulates peripheral vision; sensor is ready but we need sound too)
# [9] REW: 2003-06-05
# record-threats that are behind when also underfire (not tested)
# REW: This should fire both when the active objective is not sentry-watch and also
# when there is no active objective at all.
# REW: 2003-05-27. Added red and bvlue prods. Collapse to one production somaday
sp {unreal*propose*record-threat*red
(state ^name unreal
^io.input-link.objects.entity
^self.force |Red|
-^threats.threat.entity.name
# [5]: Make proposal specific to active objectives other than sentry-watch
-^mission.active-objective.type sentry-watch
# [7]: Determine who's on my team or who to ignore
-^scenario.<< REDFOR IGNORE >>.name
# [8]
^entity )
( ^name
# [8]
^egocentric-location <> behind)
# ( ^name { <> |Player| <> |MoutBot1| <> |MoutBot2| <> |MoutBot3| <> |MoutBot4| <> |MoutBot5|
# <> |MOUTBot1| <> |MOUTBot2| <> |MOUTBot3| <> |MOUTBot4| <> |MOUTBot5| } )
-->
# (write (crlf) | Recording threat for new enemy | )
( ^operator +, = 50)
( ^name record-threat
^type new
^entity )}
sp {unreal*propose*record-threat*red*behind*underfire
(state ^name unreal
^io.input-link.objects.entity
^self.force |Red|
-^threats.threat.entity.name
# [5]: Make proposal specific to active objectives other than sentry-watch
-^mission.active-objective.type sentry-watch
# [7]: Determine who's on my team or who to ignore
-^scenario.<< REDFOR IGNORE >>.name
# 2003-06-04
^entity
^self.underfire.value <> none)
( ^name
#2003-06-04
^egocentric-location behind)
-->
# (write (crlf) | Recording threat for new enemy | )
( ^operator +, = 50)
( ^name record-threat
^type new
^entity )}
sp {unreal*propose*record-threat*blue
(state ^name unreal
^io.input-link.objects.entity
^self.force |Blue|
-^threats.threat.entity.name
# [5]: Make proposal specific to active objectives other than sentry-watch
-^mission.active-objective.type sentry-watch
# [7]: Determine who's on my team or who to ignore
-^scenario.<< BLUEFOR IGNORE >>.name )
( ^name )
# ( ^name { <> |Player| <> |MoutBot1| <> |MoutBot2| <> |MoutBot3| <> |MoutBot4| <> |MoutBot5|
# <> |MOUTBot1| <> |MOUTBot2| <> |MOUTBot3| <> |MOUTBot4| <> |MOUTBot5| } )
-->
# (write (crlf) | Recording threat for new enemy | )
( ^operator +, = 50)
( ^name record-threat
^type new
^entity )}
## If have saved a threat and the enemy reappears on vision - replace the
## saved version with the new enemey
sp {unreal*propose*enemy-record*replace
(state ^name unreal
^io.input-link.objects.entity
^threats.threat.entity { <> })
( ^name
^visible false)
( ^name
^visible true
# [8]
^egocentric-location <> behind)
-->
# (write (crlf) | Recording threat for no longer visible enemy that is now visible | )
( ^operator +, = 50)
( ^name record-threat
^entity
^old-enemy
^type replace)}
## If the enemy disappears off vision, then create a record of him
sp {unreal*propose*enemy-record*save
(state ^name unreal
^io.input-link.objects.entity
^threats.threat )
( ^entity )
( ^name
^visible false)
-->
# (write (crlf) | Recording threat for no longer visible enemy | )
( ^operator +, = 50)
( ^name record-threat
^entity
^type save)}
###### ELABORATIONS ######
# The production below does not work for agents that are outside.
# If there's not an area that's consistent with the threat's (x,y,z), assume it is outside
sp {unreal*record-threat*area*Outside
(state ^name unreal
^operator
^top-state.map