like in this example: https://www.reddit.com/r/X4Foundations/ ... ng_in_410/
drones are removed from the ship (and game) sometimes. What I could observe was that it happens when the drones try to dock simultaneously on all pads.
I have checked the scripts and found that at the moment the drones disappear, they are destroyed by line 1208 in order.dock.xml by
Code: Select all
<destroy_object object="$thisship" explosion="false"/>
In that section this do_if checks (line 1180):
Code: Select all
<do_if value="$callerid and $callerid.$cannotdock?">
Code: Select all
<!-- NB: in most cases, this order in the order queue is followed by either an order that does not require docking or the default order, in which cases, it is fine. possible infinite loop if an order calls DockAndWait immediately, in which case, add handling as described below. -->
<debug_text text="'should we cancel the order that created DockAndWait? we cannot do so. pass in $callerid to DockaAndWait, add $cannotdock parameter to the order and handling in the order script.\n callerid: %s %s\n isparameditable: %s\n critical? %s\n default? %s\n finish? %s\n state: %s'.[@$callerid.id, $callerid, @$callerid.isparameditable.cannotdock, @$callerid.state == orderstate.critical, $callerid == $thisship.defaultorder, @$callerid.state == orderstate.finish, @$callerid.state]" chance="$debugchance"/>
Im not sure about the $callerid so i just made a small workaround in that do_else block (line 1187):
Code: Select all
<cancel_all_orders object="this.ship"/>
<collect_unit object="$destination" unit="this.ship"/>
I made changes to the whole xml file because im not good at finding the correct xpath to that do_else block. I would be glad about help how to make this as a mod. But only of course if this workaround is valid.