Looking for script to destroy all satellites (whole network)

The place to discuss scripting and game modifications for X³: Terran Conflict and X³: Albion Prelude.

Moderators: Moderators for English X Forum, Scripting / Modding Moderators

Post Reply
ReDev1L
Posts: 18
Joined: Tue, 4. Jan 11, 03:40
x4

Looking for script to destroy all satellites (whole network)

Post by ReDev1L » Tue, 7. Aug 12, 01:41

Any suggestions? cant find anything like that on forum

incarn
Posts: 38
Joined: Sat, 11. Sep 10, 03:51

Post by incarn » Tue, 7. Aug 12, 08:32

No doubt there is a more efficient way of doing it, but try this.

Code: Select all

$ships = get ship array: of race {Player} class/type=null
$counter = size of array $ships
while $counter > 0
  dec $counter =
  $ship = $ships[$counter]
  $class=$ship-> get object class
  
  if $class=={All Satellites}
    $ship->destruct: show no explosion=[TRUE]
    continue
  end
  
  if $class=={Advanced Satellite (object class)}
    $ship->destruct: show no explosion=[TRUE]
    continue
  end
  
  if $class=={Navigation Relay Satellite (object class)}
    $ship->destruct: show no explosion=[TRUE]
    continue
  end
  
end

return null
ftp://incarn.homeip.net/DestroyAllSatts.zip

User avatar
jack775544
Posts: 1277
Joined: Tue, 13. Dec 11, 08:27
x4

Post by jack775544 » Tue, 7. Aug 12, 09:47

Code: Select all

$sats = get ship array: of race {Player} class/type={All Satellites}
$i = size of array $sats
while $i
  dec $i =
  $sat = $sats[$i]
  $sat->destruct: show no explosion=[TRUE]
end
return null

This code is a bit more elegant. Beware both my and incarn's code will destroy any jump beacons deployed.
1940s - Various "computers" are "programmed" using direct wiring and switches. Engineers do this in order to avoid the tabs vs spaces debate.

Jayeye
Posts: 123
Joined: Mon, 3. Oct 11, 12:07

Post by Jayeye » Tue, 7. Aug 12, 09:56

i was actually going to search for just that!
thanks op for asking and thanks to jack775544 and incarn for your scripts!

ReDev1L
Posts: 18
Joined: Tue, 4. Jan 11, 03:40
x4

Post by ReDev1L » Tue, 7. Aug 12, 12:01

thank you very much guys.

Post Reply

Return to “X³: Terran Conflict / Albion Prelude - Scripts and Modding”