all credits go to alaardb, who discovered the use of the sectorobject id (see http://www.egosoft.com/x2/forum/viewtopic.php?t=40285 )
docked ships always seem to have sectorobjectid higher than their carrier ship (has to be verified further). Scanning a range from about 1000 ids should be enough even for the largest carriers.
since i have no webspace at the moment to directly upload the script, here is it:
Code: Select all
001 * undock all ships from current ship
002
003 $id = [THIS] -> get SectorObject ID
004 $maxid = $id + 1000
005 while $id < $maxid
006 if exists SectorObject $id
007 $obj = get object from SectorObject $id
008 $obj.env = $obj -> get environment
009 if $obj.env == [THIS]
010 @ START $obj -> call script '!move.movetoposition' : sector=[SECTOR] position x=0
position y=0 position z=0 precision=5000
011 end
012 end
013 inc $id =
014 end
015
016 return null