And more questions about <Initialize> and Dockscreens- when and where is gSource valid for the spaceobject?
I placed an <OnDestroy> event in a ship, which used (objSetData) to set a message in the ship (which is a spaceObject? Or what?).
Then I put a (objGetData) to the same message from the dsAbandonedShip <initialize> tag. It printed Nil. The message was: "A trap is sprung."
So... no way to access an object's data from a dockscreen called up by that object, or am I missing some tags? I mean, what is the point of having code in Initialize for a dockscreen if it can't even get a message stored on the object that the dockscreen is used by?
Code: Select all
<OnDestroy>
(block (trapCheck trapItem thisItem trapList)
(setq trapCheck (objSetData gSource "Trap" "This is a trap in a dockscreen."))
(objEnumItems gSource "*U +Trap" trapItem
(shpRechargeItem gSource (itmAtCursor trapItem) 1))
)
)
</OnDestroy>
<Initialize>
(block (desc)
(setq desc "You are docked with the wreck of a ship.")
(setq desc (cat desc " " (objGetData gSource "Trap")))
(scrSetDesc gScreen desc)
)
</Initialize>
This <Initialize> behavior testing has been the equivalent of eight hours of non-productive head scratching. Why won't scripts run there like they do elsewhere? Or is it ObjSetData? All I wanted to do was pass a little info around, and this has been the most frustrating thing I have ever encountered.
GLOBALS
gPlayer: Object representing the player.
gPlayerShip: The player's ship.
gScreen: The current screen being displayed.
gSource: The station/ship that the player is docked at.
gTrans: Transcendence application object.
TEMPORARY GLOBALS
gBuyCriteria
gCost
gItem
gMargin
gPrevScreen
gPrevPane
gBonus
Seems to be telling me that gSource is the ship I am docked at. Yet it doesn't work with the code I wrote. Which is really a basic bit, nothing fancy there- when the object is destroyed, it sets up a little message on gSource and then when you dock the <initialize> looks for it.. and never ever finds it.