Mining ship trying to isolate why it won't mine

The place to discuss scripting and game modifications for X Rebirth.

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

Post Reply
Browser_ice
Posts: 485
Joined: Sun, 5. Feb 06, 17:15
x4

Mining ship trying to isolate why it won't mine

Post by Browser_ice » Fri, 14. Apr 17, 19:32

Hi, I was playing around with the sripts mining.ship.station.xml and mining.ship.collect.xml + debugging enabled. The first thing I did was assign one of my big mining ship to a warehouse and some interesting stuffs came out of the log.
  • [Scripts] 74832.09 *** aicontext<mining.ship.station,0x11cbb>: 74832.087 looking good, starting new mining run
    [Scripts] 74832.09 *** aicontext<mining.ship.station,0x11cbb>: updating warebasket on Trader-Miner-Big-All(0x11c86) to collect [ware.crystals,ware.hydrogen,ware.ice,ware.ions,ware.nividium,ware.ore,ware.plasma,ware.silicon]
    [Scripts] 74832.09 *** aicontext<mining.ship.station,0x11cbb>: 74832.087 homebase Warehouse-Mining [0x11d55] has 5 offers for [ware.crystals,ware.hydrogen,ware.ice,ware.ions,ware.nividium,ware.ore,ware.plasma,ware.silicon]
    [Scripts] 74832.09 *** aicontext<mining.ship.station,0x11cbb>: 74832.087 Warehouse-Mining wants 57409(want 59979, expecting 2570) units of Crystals
    [Scripts] 74832.09 *** aicontext<mining.ship.station,0x11cbb>: 74832.087 Warehouse-Mining wants 64711(want 70711, expecting 6000) units of Ice
    [Scripts] 74832.09 *** aicontext<mining.ship.station,0x11cbb>: 74832.087 Warehouse-Mining wants 59638(want 59638, expecting 0) units of Nividium
    [Scripts] 74832.09 *** aicontext<mining.ship.station,0x11cbb>: 74832.087 Warehouse-Mining wants 45387(want 46387, expecting 1000) units of Ore
    [Scripts] 74832.09 *** aicontext<mining.ship.station,0x11cbb>: 74832.087 Warehouse-Mining wants 45579(want 46579, expecting 1000) units of Silicon
    ok, it said my warehouse is in need of filling up on some mining products

    [Scripts] 74832.09 *** aicontext<mining.ship.station,0x11cbb>: 74832.087 now looking for Nividium...
    [Scripts] 74832.09 *** aicontext<mining.ship.station,0x11cbb>: 74832.087 there is Nividium in zone CS-Mining-Warehouse
    ok, it said it found Nividium that can be mined.

    [Scripts] 74834.81 *** aicontext<mining.ship.station,0x11cbb>: 74834.81 destination reached
    ok, it was already in the same zone

    [Scripts] 74834.81 *** aicontext<mining.ship.station,0x11cbb>: miner not interested in Ions
    [Scripts] 74834.81 *** aicontext<mining.ship.station,0x11cbb>: miner not interested in Plasma
    [Scripts] 74834.81 *** aicontext<mining.ship.station,0x11cbb>: miner not interested in Hydrogen
    [Scripts] 74834.81 *** aicontext<mining.ship.station,0x11cbb>: miner not interested in Nividium
    hummm, it said it will extract Nividium but now it says it won't ?

    [Scripts] 74834.81 *** aicontext<mining.ship.station,0x11cbb>: miner not interested in Ore
    [Scripts] 74834.81 *** aicontext<mining.ship.station,0x11cbb>: miner not interested in Silicon
    [Scripts] 74834.81 *** aicontext<mining.ship.station,0x11cbb>: miner not interested in Ice
    [Scripts] 74834.81 *** aicontext<mining.ship.collect,0x11cbb>: 74834.81 movement started Random destity [pickup count: 0, asteroid count: 0 (0)]
    so then it just goes on moving randomly and as side effects, it has no pickup count to manage ....
I am thinking the problem is in the mining.ship.station.xml, in the following code:
  • <label name="collect"/>
    <!-- clean up secwares so we don't collect minerals our homebase does not need -->
    <set_value name="$homebaseresources" exact="$homebase.resources.list" />
    <do_all exact="$secwares.count" reverse="true" counter="$w">
    <do_if value="$homebaseresources.indexof.{$secwares.{$w}} == 0">
    <debug_text text="'miner not interested in ' + $secwares.{$w}" chance="$debugchance2" />
    <remove_value name="$secwares.{$w}" />
    </do_if>
    </do_all>
But not knowing enough about the variables and so on, I am wondering if from the start it is using the right kind of list ?

Any one has any idea ?

[by the way, how to keep the tabs/spaces in code when paste it in a forum?]
Steam X-Superbox, XR, playing X4
WIndows-10
Intel I7-3770
16Gb Memory
Nvgidia GTX-1060

UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader » Fri, 14. Apr 17, 22:00

iirc the default mining Script tries not only to get the defined wanted Ressource, but also all other mineable Ressources the Homebase might need. highly annoying behavior if you want the Ship to get exactly the given Ressource and nothing else. The Code Block you posted is iirc for regulating this behavior (basically excluding all additional Mineables not wanted by the Station). This is just in addition to the wanted ware.
The random movement probably refers to how the Script works OoV - when not Visible Asteroids dont exist and Mining is simply Number Crunching. To simulate activity the Miner does move arund randomly though. Interesting would be if the pickup count increases when some time has passed ;)


regarding your btw:

Code: Select all

[code]
[/code] ;)
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)

j.harshaw
EGOSOFT
EGOSOFT
Posts: 1872
Joined: Mon, 23. Nov 15, 18:02

Re: Mining ship trying to isolate why it won't mine

Post by j.harshaw » Wed, 19. Apr 17, 16:01

Browser_ice wrote:<set_value name="$homebaseresources" exact="$homebase.resources.list" />
is the list of resources the station already has, and
Browser_ice wrote:[Scripts] 74834.81 *** aicontext<mining.ship.station,0x11cbb>: miner not interested in Nividium
means that the miner isn't interested in the resource because it considers it a secondary ware and their station still has it.

A secondary ware in this case is something the miner would normally only pick up if it's also available rather than something they'll go out of their way to get.

However,
Browser_ice wrote:[Scripts] 74832.09 *** aicontext<mining.ship.station,0x11cbb>: 74832.087 now looking for Nividium...
means that nividium is actually that ship's primary ware, something they would actually go out of their way for. Also note that the "not interested" debug line doesn't really mean that the miner isn't really interested in the ware, merely that they are removing that ware from their secondary list of wares. Since nividium in this case is the miner's primary ware, they should still go and try to get that resource. (technically, the ship's captain would then proceed to execute mining.ship.collect. best guess as to why the ship didn't move to mine is because mining.ship.collect failed for some reason. without output from mining.ship.collect, though, any guesses as to why it failed would be pure speculation.)

Post Reply

Return to “X Rebirth - Scripts and Modding”