using OnObjDestroyed in dockscreens query

Freeform discussion about anything related to modding Transcendence.
Post Reply
relanat
Militia Captain
Militia Captain
Posts: 941
Joined: Tue Nov 05, 2013 9:56 am

George added the <OnObjDestroyed> event to dockscreens in 1.9a1. I would like to use it to navigate to a different screen if the object in the dockscreen, modified dock service screens in this case, is destroyed. But I'm not sure how to do this.
Supposedly the object needs to be registered for the event.
What populated variables (I think they are called aThingy, etc) are available? Testing shows that gSource is the Taipan playership which has the modified screens.
What would the code need to check for? The screen? The object? Events still confuse me.

The event would be added to a base-class dockscreen, a modified copy of &dsRPGDockServicesBase;, which is inherited by all dock service screens in the Taipan GodShip mod.
These dock service screens can use either the playership or an NPC ship as the 'shipObj'.

To my thinking there would need to be an <OnScreenInit> block which registered the object for events.
Then the <OnObjDestroyed> event would have code to check for the object being destroyed and, if so, navigate to another screen.
But I don't know how the code should look.

TIA.
Stupid code. Do what I want, not what I typed in!
NMS
Militia Captain
Militia Captain
Posts: 569
Joined: Tue Mar 05, 2013 8:26 am

Looks like the defined variables are:

aObjDestroyed
aDestroyer
aOrderGiver
aWreckObj
aDestroy
aDestroyReason
gData
gSource
gType
Post Reply