Please extract to your X3 scripts folder. Manually run this in the sector you want the debris destroyed.
For my Salvage Mod I am adding the ability to salvage Station Debris. However, there is no 'find debris' command or anything that will easily return it. So, I wrote this code that checks for wares of mainType 30. Each subtype corresponds to a station - so there is a wreck for each station type. The mainType 20s are station debris found in Presidents End. They are slightly different.
Code: Select all
001 * EDIT HERE 002 $destroyRegularStationDebris = [TRUE] 003 $destroySpecialStationDebris = [TRUE] 004 005 $maxID = [PLAYERSHIP] -> get SectorObject ID 006 $maxID = $maxID + 10000 007 while $maxID 008 dec $maxID = 009 $wareType = get ware type of SectorObject $maxID 010 if $wareType 011 $mainType = get maintype of ware $wareType 012 if $mainType == 30 AND $destroyRegularStationDebris == [TRUE] 013 $object = get object from SectorObject $maxID 014 $object -> destruct: show no explosion=[TRUE] 015 else if $mainType == 20 AND $destroySpecialStationDebris == [TRUE] 016 $subType = get subtype of ware $wareType 017 if $subType >= 38 AND $subType <= 42 018 $object = get object from SectorObject $maxID 019 $object -> destruct: show no explosion=[TRUE] 020 end 021 end 022 end 023 end 024 return null
The previous code found objects that are Station Containers ST sized, but not stations. It did not detect the station debris which was in PE so I've updated it.
If anyone really wants, you can destroy ship debris by checking for maintype 20 subtypes 20, 30 or 43, and destroy destroyed stations with subtypes 57 and 58