Hi,
I would like to make a script and have a few questions.
Following scenario: I have ordered one of my ships to resupply another one with...e.g. microchips. It should amass 500 units in the cargo hold of the target ship.
Bear in mind, that chipplants are quite seldom and they store a max number of 20 tonns of microchips.
Thus, the collector ship will have to travel quite a lot to fulfill its task.
In the advanced jumpdrive configuration, autojump is enabled and the fuel resupply quantity is set to 50.
The ship starts jumping around collecting the microchips. But, instead of resupplying energy cells when they get below 500 (1 jump = 10 e cells), the ship keeps jumping till all e cells are consumed.
From then on, it traveles conventional, as it has no energy cells for jumping.
My questions:
1. Is this behaviour normal?
2. If it is not normal, I would like to make a script to change this. I need to know how to check within a script, if the autojump is enabled and the fuel resupply quantity.
3. How is a global script defined, I mean, how do I make a script, which runs on every ship when the game is started? Or at least on all moving player ships.
regards
Advanced jumpdrive configuration issue?
Moderators: Moderators for English X Forum, Scripting / Modding Moderators
Well,
I figuered out myself most I did not know.
But now I am stuck. I managed the ship on autojump to interrupt its current task and to refuel energy cells. The problem is: The ship does not resume its previous task correctly.
I think the interrupt is not correct:
Here a link to the complete code I made so far.
http://www.megaupload.com/?d=P4AHL197
I figuered out myself most I did not know.
But now I am stuck. I managed the ship on autojump to interrupt its current task and to refuel energy cells. The problem is: The ship does not resume its previous task correctly.
I think the interrupt is not correct:
Code: Select all
... $busy = $ship->get local variable: name='ship.busy.loc'
if $busy != 'Yes'
$ship->interrupt task 0 with script 'plugin.autojump.refuel' and prio 20: arg1=null arg2=null arg3=null arg4=null
end
...
http://www.megaupload.com/?d=P4AHL197
I did not manage to resolve the problem globally.
I was only able to solve the problem in the resupply script itself. As far as I have tested by now, the altered script is working. When resupplying a ship, the resupplyer will get the needed energy cells automaticly.
Anyone interested is welcome to ask for the script.
I was only able to solve the problem in the resupply script itself. As far as I have tested by now, the altered script is working. When resupplying a ship, the resupplyer will get the needed energy cells automaticly.
Anyone interested is welcome to ask for the script.