is it possible for a ship to build another ship when it is destroyed?
Not by any method i'm aware of.
you could use the separation to launch a lifeboat before your ship is destroyed.
gd idea thanks
You could do something similar to the old Genesis device trick.
Use a replaceweapon to create 2 objects, one that destroys itself immediately (up to you how to do this...), the other that stays around. The AI won't use it though.
You could also try using a weapon that creates an object which itself creates an object. The original object could destroy itself, leaving the other object remaining. This is similar to how the Genesis device worked in that one A1 mod I can't remember the name of (the Oberth created an object which had two weapons... one that spawned planet and a nebula for about 10 seconds, the other which detonated in a massive shockwave... it was a great implementation).
depends how exactly you want this doing. if you want the ship to build just as its going to be destroyed by an enemy then no but if you want it to build something then be destroyed automatically then yeah if your using fleet operations you just need to use the borg module idea