Skip to content

Instantly share code, notes, and snippets.

@alterecco
Created July 21, 2010 04:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alterecco/484074 to your computer and use it in GitHub Desktop.
Save alterecco/484074 to your computer and use it in GitHub Desktop.
<?xml version="1.0" ?>
<!DOCTYPE TranscendenceExtension
[
<!ENTITY modAutonomousAutons "0xDCBA00A0">
<!ENTITY itAAutonAdvertiser "0xDCBA00A1">
]>
<TranscendenceExtension UNID="&modAutonomousAutons;" version="0.99c">
<!--
Requires:
DockScreenFramework
Overrides:
scStdAutonBase
scAutoSentinel
sc300DDefenderAuton
sc310AAegisAuton
sc1MBattleAuton
sc1MiBattleAuton
scMuleAuton
itAutoSentinel
it300DDefenderAuton
it310AAegisAuton
it1MBattleAuton
it1MiBattleAuton
itMuleAuton
itDefectiveAuton
TODO:
Drones dont get attack orders
don't nest more than one level
Squadron->FormUp does not work after a Squadron->Wait
Rename evade to retreat
Attack Cap-Ship
Fighter Defense (Intercept)
Dock and repair
Dock and shop
Dock and sell
Add a "hang back" command
Add toggle chatter to main panel
Add OnDestroy Event to restore control
Allow autons to be recalled (packed into cargo bay again)
Refuse to attack an opponent of too high power
-->
<Globals>
(block Nil
;; helper functions to manage the list of controlled autons
(setq aa_AddAuton (lambda (controller auton)
(block Nil
(setq lst (objGetData controller 'controlledAutons))
(setq lst (lnkAppend lst (objGetID auton)))
(objSetData controller 'controlledAutons lst)
)
))
(setq aa_GetAutons (lambda (controller)
(block (lst ret)
(setq ret (list))
(setq lst (objGetData controller 'controlledAutons))
(enum lst oID
(setq ret (lnkAppend ret (objGetObjByID oID)))
)
ret
)
))
(setq aa_RemoveAuton (lambda (controller auton)
(block (lst)
(setq lst (objGetData controller 'controlledAutons))
(setq lst (lnkRemove lst (find lst (objGetID auton)) Nil))
(objSetData controller 'controlledAutons lst)
lst
)
))
;; get autons in the current system that can be managed
(setq aa_GetControllableAutons (lambda (base override) (block (autons ret)
(setq ret (list))
(setq autons (sysFindObject base "s +auton"))
(enum autons aObj (block Nil
;; if auton is alive, "controllable" and friendly
;; and the current controller is not `base'
(if (and
(eq (objGetSovereign aObj) &svFriendlyAuton;)
(or override (not (eq (objGetObjByID (objGetData aObj 'controller)) base)))
(not (objIsEnemy aObj))
(objCanAttack aObj)
)
(setq ret (lnkAppend ret aObj))
)
))
ret
)))
;; get a nice string that will display info on a autons control situation
(setq aa_GetAutonStatus (lambda (auton)
(block (str controller cnt)
(setq controller (aa_GetController auton))
(if (eq controller gPlayerShip)
(setq controller "Player")
(setq controller (objGetName controller))
)
(setq cnt (count (aa_GetAutons auton)))
(if (eq cnt 1)
(setq cnt "1 auton")
(setq cnt (cat cnt " autons"))
)
(setq str (cat "Controlled by " controller " - Controlling " cnt))
str
)))
;; send a message to player if he is auton controller
(setq aa_SendMessage (lambda (source message priority) (block (controller)
;; if controller is player, aknowledge
(if (eq (aa_GetController source) gPlayerShip) (block (name chatty)
(setq chatty (objGetData gPlayerShip "ChattyAutons"))
(setq name (objGetName source))
(if (or chatty priority)
(objSendMessage gPlayerShip source (cat name ": " (intTranslate source message)))
)
))
)))
(setq aa_ValidTarget (lambda (target) (block Nil
(if (isError (objGetName target))
Nil
True
)
)))
(setq aa_AAutonScreen (lambda (screen data)
(block Nil (switch
(eq screen 'main)
(list
'screenName "Autonomous Auton Control Panel"
'paneDesc "Manage your autonomous autons"
'screenType "CustomPicker"
'actions (list
(list
'name '("Select" 'S)
'runFunc '(block Nil
(dsf_SetScreenState 'controller (dsf_GetListEntryData 'aObj))
(aa_AAutonScreen 'manage)
)
)
(list
'name '("Rename" 'R)
'runFunc '(block Nil
(dsf_SetScreenState 'controller (dsf_GetListEntryData 'aObj))
(aa_AAutonScreen 'rename)
)
)
)
'customPicker (block (dList)
(setq dList (list))
;; build a list of autons that we can manage
;; show image, name and current status
(enum (aa_GetControllableAutons gPlayerShip True) aObj
(lnkAppend dList (list
'title (objGetName aObj)
'subtitle (aa_GetAutonStatus aObj)
'aObj aObj
))
)
dList
)
)
(eq screen 'rename)
(list
'screenName "Autonomous Auton Control Panel"
'paneDesc "Rename auton"
'paneType "TextInput"
'hideBack True
'actions (list
(list
'name '("Rename" 'R)
'runFunc '(block (name)
(setq name (scrGetInputText gScreen))
(objSetName (dsf_GetScreenState 'controller) name)
(aa_AAutonScreen 'main)
)
)
(list
'name '("Back" 'B)
'runFunc '(aa_AAutonScreen 'main)
)
)
)
(eq screen 'manage)
(block Nil
;; if we have data, it is the controller
(if data (dsf_SetScreenState 'controller data))
(list
'screenName "Manage Auton Controller"
'paneDesc "Manage which autons this auton controls"
'screenType "CustomPicker"
'hideBack True
'customPicker (list
(list
'title "Control Auton"
'subtitle "Select which autons should be managed by this controller"
'hideList '(not (aa_GetControllableAutons (dsf_GetScreenState 'controller)))
'actions (list
(list
'name '("Select" 'S)
'runFunc '(aa_AAutonScreen 'control)
)
(list
'name '("Back" 'B)
'runFunc '(aa_AAutonScreen 'main)
)
)
)
(list
'title "Release Auton"
'subtitle "Select which autons to release control of"
'hideList '(not (aa_GetAutons (dsf_GetScreenState 'controller)))
'actions (list
(list
'name '("Select" 'S)
'runFunc '(aa_AAutonScreen 'release)
)
)
)
(list
'title "Rename Auton"
'subtitle "Change designation of auton"
'hideList '(not (dsf_GetScreenState 'controller))
'actions (list
(list
'name '("Rename" 'R)
'runFunc '(block Nil
(aa_AAutonScreen 'rename)
)
)
)
)
(list
'title "Toggle Chatter"
'subtitle (cat "Current status: " (if (objGetData gPlayerShip 'ChattyAutons) "Chatty" "Quiet"))
'actions (list
(list
'name '("Toggle Chatter" 'T)
'runFunc '(block Nil
(dbgLog "ChattyAutons: " (not objGetData gPlayerShip 'ChattyAutons))
(if (objGetData gPlayerShip 'ChattyAutons)
(objSetData gPlayerShip 'ChattyAutons Nil)
(objSetData gPlayerShip 'ChattyAutons True)
)
(aa_AAutonScreen 'manage)
)
)
)
)
)
)
)
(eq screen 'control)
(list
'screenName "Manage Auton Controller"
'paneDesc "Select which autons to take control of"
'screenType "CustomPicker"
'hideBack True
'actions (list
(list
'name '("Control Auton" 'C)
'runFunc '(block Nil
(aa_ChangeController (dsf_GetListEntryData 'aObj) (dsf_GetScreenState 'controller))
(aa_AAutonScreen 'control)
)
)
(list
'name '("Back" 'B)
'runFunc '(aa_AAutonScreen 'manage)
)
)
'customPicker (block (dList)
(setq dList (list))
;; build a list of normal autons that we can manage
(enum (aa_GetControllableAutons (dsf_GetScreenState 'controller)) aObj
(lnkAppend dList (list
'title (objGetName aObj)
'subtitle (aa_GetAutonStatus aObj)
'aObj aObj
))
)
dList
)
)
(eq screen 'release)
(list
'screenName "Manage Auton Controller"
'paneDesc "Select which autons to release"
'screenType "CustomPicker"
'hideBack True
'actions (list
(list
'name '("Release Auton" 'R)
'runFunc '(block Nil
(aa_ChangeController (dsf_GetListEntryData 'aObj) gPlayerShip)
(aa_AAutonScreen 'release)
)
)
(list
'name '("Back" 'B)
'runFunc '(aa_AAutonScreen 'manage)
)
)
'customPicker (block (dList)
(setq dList (list))
;; build a list of normal autons that we can manage
(enum (aa_GetAutons (dsf_GetScreenState 'controller)) aObj
(lnkAppend dList (list
'title (objGetName aObj)
'subtitle (aa_GetAutonStatus aObj)
'aObj aObj
))
)
dList
)
)
))
))
(setq aa_OrderFollowTarget (lambda (source target recurse)
(block Nil
;; order self to follow target
(shpCancelOrders source)
(shpOrder source 'follow target)
(objSetData source 'behaviour 'following)
;; order all controlled drones to follow self
(if recurse
(enum (aa_GetAutons source) drone
(aa_OrderFollowTarget drone source)
)
)
)
))
;; follow target, but never get closer than `near' distance
;; When player is in between `near' and `far', wait. When player
;; gets further away than `far', follow player again. When he gets
;; closer than `near', calc a route away from player, and engage
(setq aa_OrderHangBack (lambda (source target near far recurse)
(block Nil
;; order self to follow target
(shpCancelOrders source)
(shpOrder source 'follow target)
(objSetData source 'behaviour 'hangingBack)
(objSetData source 'hangingBackNear near)
(objSetData source 'hangingBackFar far)
;; order all controlled drones to follow self
(if recurse
(enum (aa_GetAutons source) drone
(aa_OrderFollowTarget drone source)
)
)
)
))
(setq aa_OrderGotoAndChangeOrder (lambda (source vector order recurse)
(block (marker)
;(dbgOutput "Go to and change order to: " order)
;; create a marker
(setq marker (sysCreateMarker "" vector &svFriendlyAuton;))
;; save it on ship
(objSetObjRefData source 'gotoMarker marker)
;; save orders on ship
(objSetData source 'behaviour 'gotoAndChange)
(objSetData source 'nextBehaviour order)
;; give the order
(shpCancelOrders source)
(shpOrder source 'goto marker)
(if recurse
(enum (aa_GetAutons source) drone
(aa_OrderFollowTarget drone source)
)
)
)
))
(setq aa_OrderEscortTarget (lambda (source target recurse)
(block Nil
;; order self to escort target
(shpCancelOrders source)
(shpOrder source 'escort target)
(objSetData source 'behaviour 'escorting)
;; order all controlled drones to escort self
(if recurse
(enum (aa_GetAutons source) drone
(aa_OrderEscortTarget drone source)
)
)
)
))
(setq aa_OrderEvade (lambda (source recurse hold)
(block (safePos)
(shpCancelOrders source)
;; get safePos
(setq safePos (aa_GetSafePosition source hold))
;; order self to evade
(shpOrder source 'goto safePos)
(objSetData source 'behaviour 'evading)
(if recurse
;; order all controlled drones to evade
(enum (aa_GetAutons source) drone
(aa_OrderFollowTarget drone source)
)
)
)
))
(setq aa_OrderWait (lambda (source recurse)
(block Nil
;; order self to wait
(shpCancelOrders source)
(shpOrder source 'hold)
(objSetData source 'behaviour 'waiting)
;; order all controlled drones to wait
(if recurse
(enum (aa_GetAutons gSource) drone
(aa_OrderFollowTarget drone source)
)
)
)
))
(setq aa_OrderContinuousTargeting (lambda (source recurse)
(block (target)
(setq target (objGetTarget gPlayerShip))
(if target
(block Nil
;; order self to attack continuously
(shpCancelOrders source)
(shpOrder source 'attack target)
(objSetData source 'behaviour 'continuousOffense)
;; order all controlled drones to attack continuously
(if recurse
(enum (aa_GetAutons source) drone
(aa_OrderContinuousTargeting drone)
)
)
)
(aa_OrderFollowTarget source (aa_GetController source) True)
)
)
))
(setq aa_OrderAttackAtWill (lambda (source recurse squadtarget)
(block (target)
(if (or (not squadtarget) (eq squadtarget True))
(setq target (sysFindObject gPlayerShip "sTEAN"))
(setq target squadtarget)
)
(if (and target (aa_ValidTarget target) (leq (objGetDistance gPlayerShip target) 100))
(block Nil
;; order self to attack at will
(shpCancelOrders source)
(shpOrder source 'attack target)
(if squadtarget
(objSetData source 'behaviour 'squadAttackAtWill)
(objSetData source 'behaviour 'attackAtWill)
)
(if recurse
;; order all controlled drones to attack at will
(enum (aa_GetAutons gSource) drone
(aa_OrderAttackAtWill drone Nil squadtarget)
)
)
)
(block Nil
(aa_OrderFollowTarget source (aa_GetController source) True)
(aa_SendMessage gSource 'EscortAck True)
)
)
)
))
(setq aa_OrderAttackTarget (lambda (source recurse target)
(block (t)
(if target
(setq t target)
(setq t (objGetTarget gPlayerShip))
)
(if t
(block Nil
;; order self to attack
(shpCancelOrders source)
(shpOrder source 'attack t)
(objSetData source 'behaviour 'attackTarget)
(if recurse
;; order all controlled drones to attack
(enum (aa_GetAutons source) drone
(aa_OrderAttackTarget drone Nil t)
)
)
)
(block Nil
(aa_OrderFollowTarget source (aa_GetController source) True)
(aa_SendMessage gSource 'EscortAck True)
)
)
)
))
(setq aa_GetSafePosition (lambda (source hold)
(block (controller safePos)
;; get current controller
(setq controller (aa_GetController source))
;; if our controller is the player, then calc a new position
(if (eq controller gPlayerShip)
(block Nil
(if hold
(block Nil
(setq safePos (sysCreateMarker "" (objGetPos source) &svFriendlyAuton;))
;; save it on ship
(objSetObjRefData source 'safeEvasionPosition safePos)
)
(block Nil
;; if we already have a safe position, use it
(setq safePos (objGetObjRefData source 'safeEvasionPosition))
(if (not safePos) (block (enemy ang vec)
;; get closest enemy
(setq enemy (sysFindObject source "sTEN"))
;; find safe angle and vector
(setq vec (aa_GetOppositeDirection source enemy 200))
;; make sure the vector is not next to enemies
(setq vec (sysVectorRandom vec 10 150 "sTE"))
;; spawn a marker at safe vector
(setq safePos (sysCreateMarker "" vec &svFriendlyAuton;))
;; save it on ship
(objSetObjRefData source 'safeEvasionPosition safePos)
))
)
)
)
;; if controller is not player, then we are nested, and our
;; current controller should provide safe position
(block Nil
(setq safePos (aa_GetSafePosition controller))
)
)
safePos
)
))
(setq aa_GetOppositeDirection (lambda (source target distance)
(sysVectorPolarOffset
source
(add 180 (sysVectorAngle (sysVectorSubtract
(objGetPos target)
(objGetPos source))))
distance)
))
(setq aa_ChangeController (lambda (source target)
(block (controller)
;; get current controller
(setq controller (aa_GetController source))
;; update controller data
(aa_RemoveAuton controller source)
(aa_AddAuton target gSource)
(objSetData source 'controller (objGetID target))
;; order escort new controller
(aa_OrderFollowTarget source target)
)
))
(setq aa_GetController (lambda (source)
(objGetObjByID (objGetData source 'controller))
))
(setq auton (lambda Nil (block Nil
(shpInstallTargetingComputer gPlayerShip)
(objAddItem gPlayerShip (itmCreate &it300DDefenderAuton; 5))
)))
)
</Globals>
<ItemType UNID="&itAAutonAdvertiser;"
name= "AutonomousAuton DockScreen Advertiser"
frequency= "notrandom"
modifiers= "ScreenHook; TerminalService; CannotOrder; NotForSale;"
>
<Image imageID="&rsItems1;" imageX="0" imageY="192" imageWidth="96" imageHeight="96"/>
<StaticData>
<HookTitle>"Autonomous Auton Controller"</HookTitle>
<HookSubtitle>"Enhances your autons to work autonomously."</HookSubtitle>
<ScreenData>'(aa_AAutonScreen 'main)</ScreenData>
</StaticData>
</ItemType>
<!----------------------------------------------------
<! Vanilla Autons and Spawner Items
<!----------------------------------------------------
<!
<! We override these autons to move them to the
<! shpOrder command syntax, and to provide for
<! more advanced commands
<!
<!--------------------------------------------------->
<!---------------------------------------------------------------------------------------
<! Auton Base Class
<!-------------------------------------------------------------------------------------->
<ShipClass UNID="&scStdAutonBase;"
class= "(auton base class)"
virtual= "true"
attributes= "baseClass"
>
<!--
Form Up 'F
Attack Target 'A
Break and Attack 'B
Break By Squadron 'S
Continuous Targeting 'C
Wait 'W
Evade 'E
Hang Back 'H
Manage 'M
-->
<Communications>
<Message name="Form up" key="F">
<OnShow>
(and
(eq (objGetData gSource 'controller) (objGetID gPlayerShip))
(not (eq (objGetData gSource 'behaviour) 'following))
)
</OnShow>
<Invoke>
(block Nil
(aa_OrderFollowTarget gSource gPlayerShip True)
(aa_SendMessage gSource 'EscortAck True)
)
</Invoke>
</Message>
<Message name="Attack target" key="A">
<OnShow>
(and
(eq (objGetData gSource 'controller) (objGetID gPlayerShip))
(objGetTarget gSender)
(not (eq (objGetTarget gSender) (objGetTarget gSource)))
(objGetItems gSource "wI")
)
</OnShow>
<Invoke>
(block Nil
(aa_OrderAttackTarget gSource True)
(aa_SendMessage gSource 'AttackTargetAck True)
)
</Invoke>
</Message>
<Message name="Break &amp; Attack" key="B">
<OnShow>
(and
(eq (objGetData gSource 'controller) (objGetID gPlayerShip))
(eq (objGetData gSource 'behaviour) 'following)
)
</OnShow>
<Invoke>
(block Nil
(aa_OrderAttackAtWill gSource True)
(aa_SendMessage gSource 'BreakAndAttackAck True)
)
</Invoke>
</Message>
<Message name="Break by Squadron" key="S">
<OnShow>
(and
(eq (objGetData gSource 'controller) (objGetID gPlayerShip))
;; hide if not a squad commander
(aa_GetAutons gSource)
(eq (objGetData gSource 'behaviour) 'following)
)
</OnShow>
<Invoke>
(block Nil
(aa_OrderAttackAtWill gSource True True)
(aa_SendMessage gSource 'SquadAttackAck True)
)
</Invoke>
</Message>
<Message name="Continuous Targetting" key="C">
<OnShow>
(and
(eq (objGetData gSource 'controller) (objGetID gPlayerShip))
(eq (objGetData gSource 'behaviour) 'following)
)
</OnShow>
<Invoke>
(block Nil
(aa_OrderContinuousTargeting gSource)
(aa_SendMessage gSource 'AttackTargetAck True)
)
</Invoke>
</Message>
<Message name="Wait" key="W">
<OnShow>
(and
(eq (objGetData gSource 'controller) (objGetID gPlayerShip))
(eq (objGetData gSource 'behaviour) 'following)
)
</OnShow>
<Invoke>
(block Nil
(aa_OrderWait gSource True)
(aa_SendMessage gSource 'WaitAck True)
)
</Invoke>
</Message>
<Message name="Hang Back" key="H">
<OnShow>
(and
(eq (objGetData gSource 'controller) (objGetID gPlayerShip))
)
</OnShow>
<Invoke>
(block Nil
(aa_OrderHangBack gSource gPlayerShip 30 80 True)
(aa_SendMessage gSource 'HangBackAck True)
)
</Invoke>
</Message>
<Message name="Evade" key="E">
<OnShow>
(and
(eq (objGetData gSource 'controller) (objGetID gPlayerShip))
)
</OnShow>
<Invoke>
;; if there are enemies within 150 ls, change position
;; else just go on high alert
(if (sysFindObject gSource "sTEN:150")
(block Nil
(aa_OrderEvade gSource True)
(aa_SendMessage gSource 'EvadeAck True)
)
(block Nil
(aa_OrderEvade gSource True True)
(aa_SendMessage gSource 'EvadeHoldAck True)
)
)
</Invoke>
</Message>
<Message name="Manage" key="M">
<OnShow>
(and
(eq (objGetData gSource 'controller) (objGetID gPlayerShip))
(not (isError gScreen))
)
</OnShow>
<Invoke>
(block Nil
(dsf_ShowDockScreen (aa_AAutonScreen 'manage gSource))
)
</Invoke>
</Message>
</Communications>
<Events>
<OnCreate>
(block Nil
(sysAddObjRecurringTimerEvent 60 gSource "OnBehaviour")
)
</OnCreate>
<OnBehaviour>
(block (behaviour)
(setq behaviour (objGetData gSource 'behaviour))
;(dbgOutput behaviour)
;; if we have a target, but it is no longer valid, follow controller
(block (target)
(setq target (objGetTarget gSource))
(if (not (aa_ValidTarget target))
(aa_OrderFollowTarget gSource (aa_GetController gSource))
)
)
(switch
(eq behaviour 'alertHold)
;; if there are enemies within 150 ls, change position
(if (sysFindObject gSource "sTEN:150") (block Nil
(aa_OrderEvade gSource True)
(aa_SendMessage gSource 'AutoEvadeAck)
))
(eq behaviour 'hangingBack)
(block (near far dist)
(setq near (objGetData gSource 'hangingBackNear))
(setq far (objGetData gSource 'hangingBackFar))
(setq dist (objGetDistance gSource gPlayerShip))
;; if we are too close then move away
(if (ls dist near)
(block (vec)
(setq vec (aa_GetOppositeDirection gSource gPlayerShip (subtract far near)))
(aa_OrderGotoAndChangeOrder gSource vec 'hangingBack True)
)
)
;; if we are too far away, then follow player
(if (gr dist far)
(aa_OrderHangBack gSource gPlayerShip near far True)
)
(if (or (leq dist far) (geq dist near))
(shpOrder gSource 'hold)
)
)
(eq behaviour 'gotoAndChange)
(block (target beh)
(setq target (objGetObjRefData gSource 'gotoMarker))
;(dbgOutput "Distance: " (objGetDistance gSource target))
(if (eq (objGetDistance gSource target) 0) (block Nil
;; this order depends on the new behaviour being
;; processed in the OnBehaviour block
;; delete marker
(objDestroy (objGetObjRefData gSource 'gotoMarker))
(setq beh (objGetData gSource 'nextBehaviour))
(objSetData gSource 'behaviour beh)
(objSetData gSource 'nextBehaviour Nil)
))
)
)
)
</OnBehaviour>
<OnOrdersCompleted>
(block (behaviour)
(setq behaviour (objGetData gSource 'behaviour))
;(dbgOutput "Order Complete: " behaviour)
(switch
(eq behaviour 'attackTarget)
(aa_OrderFollowTarget gSource (aa_GetController gSource))
(eq behaviour 'attackAtWill)
(aa_OrderAttackAtWill gSource)
(eq behaviour 'squadAttackAtWill)
;; if we are the lead controller
(if (eq (aa_GetController gSource) gPlayerShip) (block Nil
(aa_OrderAttackAtWill gSource True True)
(aa_SendMessage gSource 'SquadAttackAck Nil)
))
(eq behaviour 'continuousOffense)
(aa_OrderContinuousTargeting gSource)
(eq behaviour 'evading)
(block Nil
;; when done evading, hold
(shpCancelOrders gSource)
(shpOrder gSource 'hold)
(objSetData gSource 'behaviour 'alertHold)
(aa_SendMessage gSource 'EvadeComplete)
;; destroy marker
(objDestroy (objGetObjRefData gSource 'safeEvasionPosition))
)
)
)
</OnOrdersCompleted>
<OnDestroy>
(block Nil
;; if the controller is player, assign new controller
;; to all drones
(if (eq (aa_GetController gSource) gPlayerShip) (block Nil
(enum (aa_GetAutons gSource) drone
(aa_ChangeController drone gPlayerShip)
)
(aa_SendMessage gSource 'TransferCommandAck True)
))
)
</OnDestroy>
<OnPlayerLeftSystem>
(block (behavior)
(setq behavior (objGetData gSource 'behavior))
(switch
; If we're waiting, stay in this system and wait for the player
(or (eq behavior 'waiting) (eq behavior 'repairingArmor))
'waitForPlayer
; Otherwise, follow the player through the gate
'followPlayer
)
)
</OnPlayerLeftSystem>
</Events>
<StaticData>
<Language>
(
('EvadeAck "Affirmative. Shifting position")
('EvadeHoldAck "Holding at hight alert")
('EvadeComplete "Safe vector confirmed. Holding position")
('HangBackAck "Keeping safe distance")
('AutoEvadeAck "Enemies detected. Shifting position")
('EscortAck "Returning to formation")
('FollowAck "Returning to formation")
('WaitAck "Holding position")
('AttackTargetAck "Attacking target")
('BreakAndAttackAck "Weapons Free")
('SquadAttackAck "Attacking my target")
('CanNotComply "Unable to comply")
('TransferCommandAck "Failure. Emergency command transfer")
)
</Language>
</StaticData>
</ShipClass>
<!---------------------------------------------------------------------------------------
<! Vanilla Autons
<!-------------------------------------------------------------------------------------->
<!-- Auton, AutoSentinel -->
<ShipClass UNID="&scAutoSentinel;"
manufacturer= ""
class= "AutoSentinel&#xae;"
type= ""
score= "115"
techOrder= "mech"
mass= "1"
cargoSpace= "0"
thrust= "10"
maneuver= "2"
maxSpeed= "25"
leavesWreck= "0"
attributes= "auton,genericClass"
inherit= "&scStdAutonBase;"
>
<Armor>
<ArmorSection start="0" span="360" armorID="&itHeavyCeramicPlate;" areaSet="0,2,3,7" />
</Armor>
<Devices>
<Device deviceID="&itLaserCannon;"/>
</Devices>
<Image imageID="&rsSmallShips1;" imageX="256" imageY="0" imageWidth="32" imageHeight="32" imageFrameCount="0" imageTicksPerFrame="0"/>
<AISettings
fireRateAdj= "15"
fireAccuracy= "70"
perception= "4"
/>
</ShipClass>
<!-- Auton, 300D Defender Auton -->
<ShipClass UNID="&sc300DDefenderAuton;"
manufacturer= ""
class= "300D defender auton"
type= ""
score= "240"
techOrder= "mech"
mass= "2"
cargoSpace= "0"
thrust= "30"
maneuver= "2"
maxSpeed= "25"
leavesWreck= "0"
attributes= "auton,genericClass"
inherit= "&scStdAutonBase;"
>
<Armor>
<ArmorSection start="0" span="360" armorID="&itPlasteelPlate;" areaSet="0,2,3,7" />
</Armor>
<Devices>
<Device deviceID="&itTurbolaserCannon;"/>
<Device deviceID="&itHullPlateIonizer;"/>
</Devices>
<Image imageID="&rsSmallShips1;" imageX="288" imageY="0" imageWidth="32" imageHeight="32" imageFrameCount="0" imageTicksPerFrame="0"/>
<AISettings
fireRateAdj= "20"
fireAccuracy= "80"
perception= "4"
/>
</ShipClass>
<!-- Auton, 310A Aegis Auton -->
<ShipClass UNID="&sc310AAegisAuton;"
manufacturer= ""
class= "310A aegis auton"
type= ""
score= "390"
techOrder= "mech"
mass= "2"
cargoSpace= "0"
thrust= "30"
maneuver= "2"
maxSpeed= "25"
leavesWreck= "0"
attributes= "auton,genericClass"
inherit= "&scStdAutonBase;"
>
<Armor>
<ArmorSection start="0" span="360" armorID="&itPlasteelPlate;" areaSet="0,2,3,7" />
</Armor>
<Devices>
<Device deviceID="&itLaserCannon;"/>
<Device deviceID="&itLongreachIAutocannon;"/>
<Device deviceID="&itHullPlateIonizer;"/>
</Devices>
<Image imageID="&rsSmallShips1;" imageX="288" imageY="0" imageWidth="32" imageHeight="32" imageFrameCount="0" imageTicksPerFrame="0"/>
<AISettings
fireRateAdj= "20"
fireAccuracy= "80"
perception= "4"
/>
</ShipClass>
<!-- Auton, 1M battle auton -->
<ShipClass UNID="&sc1MBattleAuton;"
manufacturer= ""
class= "1M battle auton"
type= ""
score= "385"
techOrder= "mech"
mass= "4"
cargoSpace= "0"
thrust= "30"
maneuver= "3"
maxSpeed= "25"
leavesWreck= "0"
attributes= "auton,genericClass"
inherit= "&scStdAutonBase;"
>
<Armor>
<ArmorSection start="0" span="360" armorID="&itLightBlastPlate;" areaSet="0,2,3,7" />
</Armor>
<Devices>
<Device deviceID="&itParticleBeamWeapon;"/>
<Device deviceID="&itMonopoleDeflector;"/>
</Devices>
<Image imageID="&rsSmallShips1;" imageX="320" imageY="0" imageWidth="32" imageHeight="32" imageFrameCount="0" imageTicksPerFrame="0"/>
<AISettings
fireRateAdj= "20"
fireAccuracy= "90"
perception= "4"
/>
</ShipClass>
<!-- Auton, 1M/i battle auton -->
<ShipClass UNID="&sc1MiBattleAuton;"
manufacturer= ""
class= "1M/i battle auton"
type= ""
score= "420"
techOrder= "mech"
mass= "4"
cargoSpace= "0"
thrust= "30"
maneuver= "3"
maxSpeed= "25"
leavesWreck= "0"
attributes= "auton,genericClass"
inherit= "&scStdAutonBase;"
>
<Armor>
<ArmorSection start="0" span="360" armorID="&itLightBlastPlate;" areaSet="0,2,3,7" />
</Armor>
<Devices>
<Device deviceID="&itIonCannon;"/>
<Device deviceID="&itMonopoleDeflector;"/>
</Devices>
<Image imageID="&rsSmallShips1;" imageX="320" imageY="0" imageWidth="32" imageHeight="32" imageFrameCount="0" imageTicksPerFrame="0"/>
<AISettings
fireRateAdj= "20"
fireAccuracy= "90"
perception= "4"
/>
</ShipClass>
<!-- Auton, Mule Auton -->
<ShipClass UNID="&scMuleAuton;"
manufacturer= ""
class= "330M mule auton"
type= ""
score= "80"
techOrder= "mech"
mass= "2"
cargoSpace= "87"
thrust= "30"
maneuver= "12"
maxSpeed= "20"
dockScreen= "Main"
leavesWreck= "95"
attributes= "auton,genericClass"
inherit= "&scStdAutonBase;"
>
<Armor>
<ArmorSection start="270" span="180" armorID="&itPlasteelPlate;" areaSet="0,2,3,7" />
<ArmorSection start="90" span="180" armorID="&itPlasteelPlate;" areaSet="1,4" />
</Armor>
<Devices>
<Device deviceID="&itHullPlateIonizer;"/>
</Devices>
<Image imageID="&rsMediumShips1;" imageX="672" imageY="0" imageWidth="48" imageHeight="48"/>
<AISettings
fireRateAdj= "20"
fireAccuracy= "80"
perception= "4"
nonCombatant= "true"
/>
<DockScreens>
<Main name="330M mule auton">
<Panes>
<Default desc="You are docked with a 330M mule auton.">
<Actions>
<Action name="Loot" key="L" default="1" >
(block Nil
(setq gPrevScreen "Main")
(scrShowScreen gScreen "&dsLoot;")
)
</Action>
<Action name="Jettison" key="J">
(block Nil
(setq gPrevScreen "Main")
(scrShowScreen gScreen "&dsJettison;")
)
</Action>
<Action name="Undock" cancel="1" key="U">
<Exit/>
</Action>
</Actions>
</Default>
</Panes>
</Main>
</DockScreens>
<DockingPorts>
<Port x="0" y="40" />
<Port x="0" y="-40" />
<Port x="40" y="0" />
<Port x="-40" y="0" />
</DockingPorts>
</ShipClass>
<!---------------------------------------------------------------------------------------
<! Auton Spawner Items
<!-------------------------------------------------------------------------------------->
<!-- Auton, AutoSentinel -->
<ItemType UNID="&itAutoSentinel;"
name= "AutoSentinel&#xae;| AutoSentinels&#xae;"
level= "3"
value= "490"
mass= "1000"
frequency= "common"
unknownType= "&itUnknownAuton;"
modifiers= "Auton; MinorItem"
description= "For around 500 credits, OmniDefense Systems' AutoSentinel keeps you and your loved ones safe from harm. NOTE: For professional security needs, order the 1M battle auton."
>
<Image imageID="&rsItems1;" imageX="96" imageY="288" imageWidth="96" imageHeight="96"/>
<Invoke key="A">
(aa_SpawnAuton &scAutoSentinel; "AutoSentinel&#xae; v2.01 online" True)
</Invoke>
</ItemType>
<!-- Auton, 300D Defender -->
<ItemType UNID="&it300DDefenderAuton;"
name= "300D defender auton"
level= "4"
value= "2000"
mass= "1000"
frequency= "rare"
unknownType= "&itUnknownAuton;"
modifiers= "Auton; MinorItem"
description= "This is a commercial auton primarily used for defending small stations. NOTE: For professional security needs, order the 1M battle auton."
>
<Image imageID="&rsItems1;" imageX="96" imageY="288" imageWidth="96" imageHeight="96"/>
<Invoke key="A">
(aa_SpawnAuton &sc300DDefenderAuton; "300D Defender online [v2.1d]" True)
</Invoke>
</ItemType>
<!-- Auton, 310A Aegis -->
<ItemType UNID="&it310AAegisAuton;"
name= "310A aegis auton"
level= "4"
value= "2500"
mass= "1000"
frequency= "rare"
unknownType= "&itUnknownAuton;"
modifiers= "Auton; MinorItem"
description= "This variant of the 300D is equipped with an anti-missile defense system."
>
<Image imageID="&rsItems1;" imageX="96" imageY="288" imageWidth="96" imageHeight="96"/>
<Invoke key="A">
(aa_SpawnAuton &sc310AAegisAuton; "310A Aegis online [v1.0f]" True)
</Invoke>
</ItemType>
<!-- Auton, 1M Battle -->
<ItemType UNID="&it1MBattleAuton;"
name= "1M battle auton"
level= "5"
value= "5000"
mass= "5000"
frequency= "rare"
unknownType= "&itUnknownAuton;"
modifiers= "Auton; MinorItem"
description= "The 1M battle auton is the most powerful autonomous defense bot manufactured by the OmniDefense Systems corporation."
>
<Image imageID="&rsItems1;" imageX="96" imageY="288" imageWidth="96" imageHeight="96"/>
<Invoke key="A">
(aa_SpawnAuton &sc1MBattleAuton; "Auton series 1M online" True)
</Invoke>
</ItemType>
<!-- Auton, 1M/i Battle -->
<ItemType UNID="&it1MiBattleAuton;"
name= "1M/i battle auton"
level= "6"
value= "7500"
mass= "5000"
frequency= "rare"
unknownType= "&itUnknownAuton;"
modifiers= "Auton; MinorItem"
description= "This is a variant of OmniDefense Systems' 1M battle auton. Instead of a particle beam, it is equipped with an EMP cannon."
>
<Image imageID="&rsItems1;" imageX="96" imageY="288" imageWidth="96" imageHeight="96"/>
<Invoke key="A">
(aa_SpawnAuton &sc1MiBattleAuton; "Auton series 1M/i online" True)
</Invoke>
</ItemType>
<!-- Auton, 330M Mule -->
<ItemType UNID="&itMuleAuton;"
name= "330M mule auton"
level= "4"
value= "2500"
mass= "5000"
frequency= "rare"
unknownType= "&itUnknownAuton;"
modifiers= "Auton; MinorItem"
description= "Dock with this auton to store supplies on its cargo platform. This auton has space for 75 tons of cargo. "
>
<Image imageID="&rsItems1;" imageX="96" imageY="288" imageWidth="96" imageHeight="96"/>
<Invoke key="A">
(aa_SpawnAuton &scMuleAuton; "330M Mule online [v2.2a]" True)
</Invoke>
</ItemType>
<!-- Auton, Defective -->
<ItemType UNID="&itDefectiveAuton;"
name= "defective auton"
level= "4"
value= "200"
mass= "2000"
frequency= "uncommon"
unknownType= "&itUnknownAuton;"
modifiers= "Auton; MinorItem"
description= "The 200A series was recalled several years ago because of an unstable AI."
>
<Image imageID="&rsItems1;" imageX="96" imageY="288" imageWidth="96" imageHeight="96"/>
<Invoke key="A">
(block (auton)
; Create the auton
(setq auton (sysCreateShip &sc300DDefenderAuton; (objGetPos gSource) &svDefectiveAuton;))
; Escort ship
(shpOrderAttack auton gSource)
;; Store behaviour on auton
(objSetData auton 'behaviour 'attackingTarget)
; Identify the item
(itmSetKnown gItem)
; Welcome message
(objSendMessage gSource Nil "200A: AI.error.safety_module_failure")
; Remove the item from the player's list
(objRemoveItem gSource gItem 1)
)
</Invoke>
</ItemType>
<!------------------------------------------------------------------------------------------------
<! End Vanilla Autons
<!----------------------------------------------------------------------------------------------->
<Globals>
(block Nil
;; generic auton spawner
(setq aa_SpawnAuton (lambda (aUNID msg)
(block (auton)
;; Create the auton
(setq auton (sysCreateShip aUNID (objGetPos gPlayerShip) &svFriendlyAuton;))
;; Follow ship
(aa_OrderFollowTarget auton gPlayerShip)
;; Store controller
(objSetData auton 'controller (objGetID gPlayerShip))
;; add auton to player
(aa_AddAuton gPlayerShip auton)
;; Identify the item
(itmSetKnown gItem)
;; Welcome message
(objSendMessage gPlayerShip Nil msg)
;; Remove the item from the player's list
(objRemoveItem gPlayerShip gItem 1)
)
))
)
</Globals>
</TranscendenceExtension>
<!--
vim:enc=utf-8:nu:ai:si:et:ts=4:sw=4:ft=tscript:
-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment