
APT.all-test.HauntBot.record-actor.soar Maven / Gradle / Ivy
echo "\nLoading record-actor"
## Create link to a new enemy
# [1] REW: 2002-07-27
# Don't record a actor for an agent for any friendly team members
# Note that Haunt under ^entity.agent.name is not upcased. They have
# to be |HauntBot1| 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 actors to the sentry-watch structure
# [4] REW: 2002-08-28
# Evidently the HauntBot names are now HauntBot so I added these to the record-actor 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 actor is present
# (ie, where a actor is different from a contact).
# Basic idea is to not use record actor for contacts made during sentry-watch
# This means that sentry-watch will not record actors.
# [6] REW: 2002-09-25
# Completed and tested changes described in [6].
# Note that the actor is never deleted unless we can't determine
# it's name. The ^actor.enemy is deleted/re-added as actors change
# from visible to not visible and back again.
# REW: This should fire both when the active objective is not sentry-watch and also
# when there is no active objective at all.
sp {haunt*propose*record-actor
(state ^name haunt
^io.input-link.objects.entity
-^actors.actor.enemy.name )
( ^name { <> |Player| <> |HauntBot1| <> |HauntBot2| <> |HauntBot3| <> |HauntBot4| <> |HauntBot5|
<> |HauntBot1| <> |HauntBot2| <> |HauntBot3| <> |HauntBot4| <> |HauntBot5| } )
-->
#(write (crlf) | Recording actor for enemy | )
( ^operator + =, >)
( ^name record-actor
^type new
^enemy )}
## If have saved a actor and the enemy reappears on vision - replace the
## saved version with the new enemey
sp {haunt*propose*enemy-record*replace
(state ^name haunt
^io.input-link.objects.entity
^actors.actor.enemy { <> })
( ^name
^visible false)
( ^name
^visible true)
-->
( ^operator + =, >)
( ^name record-actor
^enemy
^old-enemy
^type replace)}
## If the enemy disappears off vision, then create a record of him
sp {haunt*propose*enemy-record*save
(state ^name haunt
^io.input-link.objects.entity
^actors.actor )
( ^enemy )
( ^name
^visible false)
-->
(write (crlf) |Actor | | has disappeared - visible false.|)
( ^operator + =, >)
( ^name record-actor
^enemy
^type save)}
###### ELABORTIONS ######
#Elaborate the enemy with the area that it currently resides in
sp {haunt*record-actor*area
(state ^name haunt
^operator
^top-state.map