accessing docked ships *is* possible

The place to discuss scripting and game modifications for X²: The Threat.

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

blackspell
Posts: 128
Joined: Sat, 6. Mar 04, 20:18
x2

accessing docked ships *is* possible

Post by blackspell »

there is a way to access docked ships.
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
User avatar
dPM_HeMan
Posts: 820
Joined: Mon, 16. Feb 04, 13:08
x3

Post by dPM_HeMan »

cool :) :thumb_up:

[EDIT] if you want me to upload your "undock.all" Script send me a PM

Return to “X²: The Threat - Scripts and Modding”