I've written a script that attempts to follow the storyline from the TOS episode, The Doomsday machine. I'm finding that everything works properly, until the DM is killed and becomes a Dead DM, and the mission crashes. As far as I can tell, its not even reaching the mOnDeath method called when its killed. I suspect that something peculiar happens with the Doomsday Machine, it doesnt actually blow up, but is replaced by a 'dead' version of itself (since the Dead DM is still there). This leads me to believe the game engine has a set of functions hard-coded for the DM, and when killed, a new 'dead' DM is created in its place, which is of course a different 'ship', and therefore, all the pointers I initialised to point to the old one, are no longer valid (which might explain why my mission crashes).
Has anyone written a script using the Doomsday Machine before? Did it work and is it just something I am doing? Or, has this problem been encountered before and there is a workaround for it?
The script was written for OP, by the way.