Code: Select all
(objSetData gSource "orderTarget" (setq test (objgetid aDestroyer)))
And got 619.
However, I used
Code: Select all
(setq prevTarget (objGetData gSource "orderTarget))
Code: Select all
(objSetData gSource "orderTarget" (setq test (objgetid aDestroyer)))
Code: Select all
(setq prevTarget (objGetData gSource "orderTarget))
Is gSource correct? I thought your original code stored the data in "theLeader" or something. [My example was just an example--you have to apply it to your situation.]RPC wrote:I think I know what happened. I usedCode: Select all
(objSetData gSource "orderTarget" (setq test (objgetid aDestroyer)))
And got 619.
However, I usedin the OnDestroy tag and got "nil". Maybe the data is cleared (because the ship is replaced with a destroyed version of itself)? I'll see what happens if I use aWreck.Code: Select all
(setq prevTarget (objGetData gSource "orderTarget))
Code: Select all
<OnDestroy>
;; check if this ship is the leader
(if (objGetData gSource "teamLeader")
(block (escorts prevOrder prevTarget)
;; get the ships currently escorting destroyed ship
(setq escorts (sysFindObject gSource "sO:escort"))
;prev orders + target
(setq prevOrder (objGetData gSource "shipOrder"))
(setq prevTarget (objGetData gSource "orderTarget"))
;; only proceed if we have any escorts left
(if escorts
(block (newleader test)
;; the first becomes the new leader
(setq newleader (item escorts 0))
;; designate the ship as teamLeader
(objSetData newleader "teamLeader" true)
;; give the new leader some useful order
;; (cancel any previous ones first)
(shpCancelOrders newleader)
(shpOrder newleader 'attack prevTarget)
(plyMessage gPlayer "PrevTarget is "prevTarget"!")
;set Target again for the next leader
(objSetData newLeader "orderTarget" (objGetData gSource "orderTarget"))
(plyMessage gPlayer "Next leader's targ is "prevTarget"!")
;; if there are any more ships, tell them to escort newleader
(enum (subset escorts 1) s
(block nil
(shpCancelOrders s)
(shpOrder s 'escort newleader)
)
)
)
)
)
)
</OnDestroy>
Code: Select all
;here is the inserted code to get fleets
;give retaliation ship this event
(objSetEventHandler theLeader &evRetaliationEventHandler;)
;set the teamLeader status
(objSetData theLeader "teamLeader" true)
;get ShipOrders from previous leader
;ObjSetData- what?
;order
(objsetdata theLeader "shipOrder" 'attack)
;target
(objSetData theLeader "orderTarget" (setq test adestroyer))
;order the leader to wait so the squad forms up-- taken from evStdConvoyEncounterBehavior
(shpOrder theLeader 'wait 10)
Code: Select all
frequency= "notrandom"
Code: Select all
Captain: Release the mines!
Private: Sir, our Class I shields won't stand a chance against lightning turrets!
No, don't do it! ....shhsshshshshs..
</transmission ends>
I have to page back and forth to read: forgot these:1a. Same with the freighter---I don't know which freighters to use for Teratons and such--- although I could just use the scarab as a multi-purpose freighter.
2.If I have a new station to take over the old one, how will I make sure they have the same name?
(Drako Slyith)* I am a person
(Eliza chatbot)> Do you believe it is normal to be a person?
Code: Select all
program state: OnAnimate
program state: updating object
obj class: CShip
obj name: Tieren Mk I-class mobile suit
obj pointer: 2b43c10
CStandardShipAI
Order: 14
m_State: 3
m_pDest: none
m_pTarget: 2b3fa88 Mayfly-class Capitalist-ForTrans (CShip)
m_pNavPath: none
game state: in game
Code: Select all
program state: OnAnimate
program state: updating object behavior
obj class: CShip
obj name: Flooded
obj pointer: a28c6d0
CStandardShipAI
Order: 12
m_State: 1
m_pDest: none
m_pTarget: a28c548 Ranx gunship (CShip)
m_pNavPath: none
game state: in game