Advanced jumpdrive configuration issue?

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
Nicoman35
Posts: 681
Joined: Thu, 17. Nov 05, 13:12
x3tc

Advanced jumpdrive configuration issue?

Post by Nicoman35 » Sat, 29. Oct 11, 11:52

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

Nicoman35
Posts: 681
Joined: Thu, 17. Nov 05, 13:12
x3tc

Post by Nicoman35 » Sun, 30. Oct 11, 16:38

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:

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
...
Here a link to the complete code I made so far.
http://www.megaupload.com/?d=P4AHL197

Nicoman35
Posts: 681
Joined: Thu, 17. Nov 05, 13:12
x3tc

Post by Nicoman35 » Mon, 31. Oct 11, 13:55

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.

Post Reply

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