<RetVar/IF> <RefObj> has a free ship dock port: ship subtype = <Value>
- Returns null if docking bays are full
- Sensitive to class of ship, e.g. HCP docks M5 but not M3.
- <value> can be a ship instance or ship type (but not class)
- <RefObj> can be a station or ship
- BUG: reports a false positive if docking bays are filled with ships that were created in a docked state
<RetVar><RefObj> is docking allowed at <Var/Ship/Station>
- Returns null if docking bays are full
- Ignores class of ship
- Refobj can be ship type, ship instance or object class.
<RetVar/IF> <RefObj> is docking possible of <Value>
- Ignores whether docking bays are full
- Sensitive to class of ship, e.g. HCP docks M5 but not M3.
- <value> can be a ship instance (not ship type or class)
Reference
Script
Code: Select all
$Carrier.Bays = $Carrier-> get dock bay size
$Carrier.Type = datatype[$Carrier]
$Docked = $Carrier->get ship array from sector/ship/station
$Docked.Count = size of array $Docked
$Carrier.Bays.Free = $Carrier.Bays - $Docked.Count
$m2.class = [M2]
$m3.class = [M3]
$m4.class = [M4]
$m5.class = [M5]
$m2.ware = {Argon Titan}
$m3.ware = {Argon Nova}
$m4.ware = {Argon Buster}
$m5.ware = {Argon Discoverer}
$m2.ship = create ship: type=$m2.ware owner=[Neutral Race] addto=null x=0 y=0 z=0
$m3.ship = create ship: type=$m3.ware owner=[Neutral Race] addto=null x=0 y=0 z=0
$m4.ship = create ship: type=$m4.ware owner=[Neutral Race] addto=null x=0 y=0 z=0
$m5.ship = create ship: type=$m5.ware owner=[Neutral Race] addto=null x=0 y=0 z=0
$m2.ware.free = $Carrier-> has a free ship dock port: ship subtype = $m2.ware
$m3.ware.free = $Carrier-> has a free ship dock port: ship subtype = $m3.ware
$m4.ware.free = $Carrier-> has a free ship dock port: ship subtype = $m4.ware
$m5.ware.free = $Carrier-> has a free ship dock port: ship subtype = $m5.ware
$m2.ship.free = $Carrier-> has a free ship dock port: ship subtype = $m2.ship
$m3.ship.free = $Carrier-> has a free ship dock port: ship subtype = $m3.ship
$m4.ship.free = $Carrier-> has a free ship dock port: ship subtype = $m4.ship
$m5.ship.free = $Carrier-> has a free ship dock port: ship subtype = $m5.ship
$m2.class.free = $Carrier-> has a free ship dock port: ship subtype = $m2.class
$m3.class.free = $Carrier-> has a free ship dock port: ship subtype = $m3.class
$m4.class.free = $Carrier-> has a free ship dock port: ship subtype = $m4.class
$m5.class.free = $Carrier-> has a free ship dock port: ship subtype = $m5.class
$m2.ware.allowed = $m2.ware-> is docking allowed at $Carrier
$m3.ware.allowed = $m3.ware-> is docking allowed at $Carrier
$m4.ware.allowed = $m4.ware-> is docking allowed at $Carrier
$m5.ware.allowed = $m5.ware-> is docking allowed at $Carrier
$m2.ship.allowed = $m2.ship-> is docking allowed at $Carrier
$m3.ship.allowed = $m3.ship-> is docking allowed at $Carrier
$m4.ship.allowed = $m4.ship-> is docking allowed at $Carrier
$m5.ship.allowed = $m5.ship-> is docking allowed at $Carrier
$m2.class.allowed = $m2.class-> is docking allowed at $Carrier
$m3.class.allowed = $m3.class-> is docking allowed at $Carrier
$m4.class.allowed = $m4.class-> is docking allowed at $Carrier
$m5.class.allowed = $m5.class-> is docking allowed at $Carrier
$m2.ware.possible = $Carrier-> is docking possible of $m2.ware
$m3.ware.possible = $Carrier-> is docking possible of $m3.ware
$m4.ware.possible = $Carrier-> is docking possible of $m4.ware
$m5.ware.possible = $Carrier-> is docking possible of $m5.ware
$m2.ship.possible = $Carrier-> is docking possible of $m2.ship
$m3.ship.possible = $Carrier-> is docking possible of $m3.ship
$m4.ship.possible = $Carrier-> is docking possible of $m4.ship
$m5.ship.possible = $Carrier-> is docking possible of $m5.ship
$m2.class.possible = $Carrier-> is docking possible of $m2.class
$m3.class.possible = $Carrier-> is docking possible of $m3.class
$m4.class.possible = $Carrier-> is docking possible of $m4.class
$m5.class.possible = $Carrier-> is docking possible of $m5.class
$m2.ship-> destruct: show no explosion=1
$m3.ship-> destruct: show no explosion=1
$m4.ship-> destruct: show no explosion=1
$m5.ship-> destruct: show no explosion=1
write to log file 1234 append=1 value='-----------------------------------------------------------'
write to log file 1234 append=1 printf: fmt='Carrier=%s, Type=%s, Bays.Total=%s, Bays.Free=%s', $Carrier, $Carrier.Type, $Carrier.Bays, $Carrier.Bays.Free, null
write to log file 1234 append=1 printf: fmt='Free dock port (ware): m2=%s, m3=%s, m4=%s, m5=%s', $m2.ware.free, $m3.ware.free, $m4.ware.free, $m5.ware.free, null
write to log file 1234 append=1 printf: fmt='Free dock port (ship): m2=%s, m3=%s, m4=%s, m5=%s', $m2.ship.free, $m3.ship.free, $m4.ship.free, $m5.ship.free, null
write to log file 1234 append=1 printf: fmt='Free dock port (class): m2=%s, m3=%s, m4=%s, m5=%s', $m2.class.free, $m3.class.free, $m4.class.free, $m5.class.free, null
write to log file 1234 append=1 printf: fmt='Docking allowed (ware): m2=%s, m3=%s, m4=%s, m5=%s', $m2.ware.allowed, $m3.ware.allowed, $m4.ware.allowed, $m5.ware.allowed, null
write to log file 1234 append=1 printf: fmt='Docking allowed (ship): m2=%s, m3=%s, m4=%s, m5=%s', $m2.ship.allowed, $m3.ship.allowed, $m4.ship.allowed, $m5.ship.allowed, null
write to log file 1234 append=1 printf: fmt='Docking allowed (class): m2=%s, m3=%s, m4=%s, m5=%s', $m2.class.allowed, $m3.class.allowed, $m4.class.allowed, $m5.class.allowed, null
write to log file 1234 append=1 printf: fmt='Docking possible (ware): m2=%s, m3=%s, m4=%s, m5=%s', $m2.ware.possible, $m3.ware.possible, $m4.ware.possible, $m5.ware.possible, null
write to log file 1234 append=1 printf: fmt='Docking possible (ship): m2=%s, m3=%s, m4=%s, m5=%s', $m2.ship.possible, $m3.ship.possible, $m4.ship.possible, $m5.ship.possible, null
write to log file 1234 append=1 printf: fmt='Docking possible (class): m2=%s, m3=%s, m4=%s, m5=%s', $m2.class.possible, $m3.class.possible, $m4.class.possible, $m5.class.possible, null
return null
Code: Select all
-----------------------------------------------------------
Carrier=Tractor Beam Factory Alpha(Prophecy Fulfilled), Type=DATATYPE_STATION, Bays.Total=5, Bays.Free=5
Free dock port (ware): m2=0, m3=1, m4=1, m5=1
Free dock port (ship): m2=0, m3=1, m4=1, m5=1
Free dock port (class): m2=0, m3=0, m4=0, m5=0
Docking allowed (ware): m2=1, m3=1, m4=1, m5=1
Docking allowed (ship): m2=1, m3=1, m4=1, m5=1
Docking allowed (class): m2=1, m3=1, m4=1, m5=1
Docking possible (ware): m2=null, m3=null, m4=null, m5=null
Docking possible (ship): m2=null, m3=1, m4=1, m5=1
Docking possible (class): m2=null, m3=null, m4=null, m5=null
-----------------------------------------------------------
Carrier=Duke's Shipyard(Duke's Buccaneers Headquarters), Type=DATATYPE_STATION, Bays.Total=11, Bays.Free=11
Free dock port (ware): m2=1, m3=1, m4=1, m5=1
Free dock port (ship): m2=1, m3=1, m4=1, m5=1
Free dock port (class): m2=1, m3=1, m4=1, m5=1
Docking allowed (ware): m2=1, m3=1, m4=1, m5=1
Docking allowed (ship): m2=1, m3=1, m4=1, m5=1
Docking allowed (class): m2=1, m3=1, m4=1, m5=1
Docking possible (ware): m2=1, m3=1, m4=1, m5=1
Docking possible (ship): m2=1, m3=1, m4=1, m5=1
Docking possible (class): m2=1, m3=1, m4=1, m5=1
-----------------------------------------------------------
Carrier=Heavy Centaur Prototype, Type=DATATYPE_WARE, Bays.Total=0, Bays.Free=0
Free dock port (ware): m2=null, m3=null, m4=null, m5=null
Free dock port (ship): m2=null, m3=null, m4=null, m5=null
Free dock port (class): m2=null, m3=null, m4=null, m5=null
Docking allowed (ware): m2=null, m3=null, m4=null, m5=null
Docking allowed (ship): m2=null, m3=null, m4=null, m5=null
Docking allowed (class): m2=null, m3=null, m4=null, m5=null
Docking possible (ware): m2=null, m3=null, m4=null, m5=null
Docking possible (ship): m2=null, m3=null, m4=null, m5=null
Docking possible (class): m2=null, m3=null, m4=null, m5=null
-----------------------------------------------------------
********* M5 created in docked state *******
Carrier=Your Heavy Centaur Prototype, Type=DATATYPE_SHIP, Bays.Total=1, Bays.Free=0
Free dock port (ware): m2=0, m3=0, m4=0, m5=1 <-- BUG
Free dock port (ship): m2=0, m3=0, m4=0, m5=1
Free dock port (class): m2=0, m3=0, m4=0, m5=0
Docking allowed (ware): m2=null, m3=null, m4=null, m5=null
Docking allowed (ship): m2=null, m3=null, m4=null, m5=null
Docking allowed (class): m2=null, m3=null, m4=null, m5=null
Docking possible (ware): m2=null, m3=null, m4=null, m5=null
Docking possible (ship): m2=null, m3=null, m4=null, m5=1
Docking possible (class): m2=null, m3=null, m4=null, m5=null
-----------------------------------------------------------
********* M5 was docked manually *******
Carrier=Your Heavy Centaur Prototype, Type=DATATYPE_SHIP, Bays.Total=1, Bays.Free=0
Free dock port (ware): m2=0, m3=0, m4=0, m5=0
Free dock port (ship): m2=0, m3=0, m4=0, m5=0
Free dock port (class): m2=0, m3=0, m4=0, m5=0
Docking allowed (ware): m2=null, m3=null, m4=null, m5=null
Docking allowed (ship): m2=null, m3=null, m4=null, m5=null
Docking allowed (class): m2=null, m3=null, m4=null, m5=null
Docking possible (ware): m2=null, m3=null, m4=null, m5=null
Docking possible (ship): m2=null, m3=null, m4=null, m5=1
Docking possible (class): m2=null, m3=null, m4=null, m5=null
-----------------------------------------------------------
Carrier=Your Heavy Centaur Prototype, Type=DATATYPE_SHIP, Bays.Total=1, Bays.Free=1
Free dock port (ware): m2=0, m3=0, m4=0, m5=1
Free dock port (ship): m2=0, m3=0, m4=0, m5=1
Free dock port (class): m2=0, m3=0, m4=0, m5=0
Docking allowed (ware): m2=1, m3=1, m4=1, m5=1
Docking allowed (ship): m2=1, m3=1, m4=1, m5=1
Docking allowed (class): m2=1, m3=1, m4=1, m5=1
Docking possible (ware): m2=null, m3=null, m4=null, m5=null
Docking possible (ship): m2=null, m3=null, m4=null, m5=1
Docking possible (class): m2=null, m3=null, m4=null, m5=null
-----------------------------------------------------------
Carrier=Paranid Military Zeus Y$X: K22 L0, Type=DATATYPE_SHIP, Bays.Total=43, Bays.Free=24
Free dock port (ware): m2=0, m3=1, m4=1, m5=1
Free dock port (ship): m2=0, m3=1, m4=1, m5=1
Free dock port (class): m2=0, m3=0, m4=0, m5=0
Docking allowed (ware): m2=1, m3=1, m4=1, m5=1
Docking allowed (ship): m2=1, m3=1, m4=1, m5=1
Docking allowed (class): m2=1, m3=1, m4=1, m5=1
Docking possible (ware): m2=null, m3=null, m4=null, m5=null
Docking possible (ship): m2=null, m3=1, m4=1, m5=1
Docking possible (class): m2=null, m3=null, m4=null, m5=null