[Mod] UT CaC v0.20 ( Old Name: Not Another Trader ) - Architect integrated

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

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

User avatar
Marvin Martian
Posts: 3616
Joined: Sun, 8. Apr 12, 09:40
x4

Post by Marvin Martian »

I3laze wrote:1. Station manager of my cell fab matrix is not telling my 3 liquid miners to mine resources. I have no ions left and I am confussed why my miners just sit there. I have restarted the script to no effect. I then decided to destroy the manager and replace with vanilla manager and then the miners started gathering resources. I then destroyed the captains of the miners added new ones and made them join my squad. Then I converted the manager of the station with your script and gave him the miners back. Again the manager is not telling them to mine for ions, plasma or hydrogen. I sure they was mining ok before when I first started using your script.
do you have the Mining zone set at the range setting of the manager? maybe best as a single zone setting
I3laze
Posts: 78
Joined: Tue, 13. Oct 15, 11:52
x4

Post by I3laze »

I think I have the range set as follows:

1. Fervid Corona highlighted green
2. Molten Archon highlighted blue
3. Omicron Lyrae highlighted blue
4. Bleak Pebble highlighted blue

I need to check my game later just to be sure though. Have I set it up wrong? if I have set my ranges as above. Bleak pebble is where the liquid mining takes I'm sure.
Sparky Sparkycorp
Moderator (English)
Moderator (English)
Posts: 8074
Joined: Tue, 30. Mar 04, 12:28
x4

Post by Sparky Sparkycorp »

I3laze wrote: Bleak pebble is where the liquid mining takes I'm sure.
That would make sense as a pretty good map shows ions and plasma being available there.
User avatar
Marvin Martian
Posts: 3616
Joined: Sun, 8. Apr 12, 09:40
x4

Post by Marvin Martian »

i don't know how the actual zone <> range check works - so it's only a guess

the returnvalue of the miningressource-finding-function returns always a zone, so it might be required to define this zone (at a top position) instead of the whole sector in the range, because last time it take a look in it, there was a simple $foo == $bar.{$i} and nothing magic "is $foo part of something in $bar"

edit:

Code: Select all

      <do_all exact="$range.count" counter="$i" reverse="false">
        <do_if value="$range.{$i}.exists">
          <find_closest_resource zone="$zone" ware="$ware" minamount="$amount" refobject="$range.{$i}"/>
          <wait exact="6s - (this.skill.management)s" comment="to make it look like he is actually looking where to Mine wait ( 6 - mangmentskill) seconds per Ware checked (Better Managers are faster)"/>
          <!-- found Ressource in Range - exit with success -->
          <do_if value="$zone.exists and ( $zone.hascontext.{$range.{$i}} or $zone == $range.{$i} )">
            <debug_text filter="general" chance="@this.$debug *100" text="'%1 %2 %3 Found wanted Ressource in Range:\nRange: %4 - Zone: %5'.[player.age,this.name,this.container.name,$range.{$i}.knownname,$zone]"/>
            <signal_objects object="$entity.ship" param="'new order'" param2="table[$script='ut.cac.com.captain.mining',$displayname='Mining in %1 (Manager)'.[$zone.knownname],$zone=$zone,$ware=$ware,$amount=$amount,$mininglist=$mininglist,$interruptable=false]"/>
            <return value="true"/>
          </do_if>
        </do_if>
      </do_all>
as it looks like, it might be best to define the prefered mining grounds (as zone!!) at the first positions, otherwise it could be that the miners will send to a place far away with low yields

Edit2
to pass the range-control it would be required to make cluster and sector ranges convert into his zones
because it think $zone.cluster or $zone.sector won't work this way? or will it blend?
I3laze
Posts: 78
Joined: Tue, 13. Oct 15, 11:52
x4

Post by I3laze »

If I understand you correctly I cannot set the mining zone fisrt I think. The starting range is the location of ths station which is in Fervid Corona and my understanding is that I cannot then set Bleak Pebble as next range because the ship needs to travel through Molten Archon sector to get there which I have not set on the range.

I'm wondering if because I have set the ranges as below is the problem.

1. Fervid Corona highlighted green
2. Molten Archon highlighted blue
3. Omicron Lyrae highlighted blue
4. Bleak Pebble highlighted blue

I tried setting as below but I cannot use Molton Archon twice. I want my miners to mine in Bleak Pebble and my freighters to trade in Omicron and parts of DeVries.

1. Fervid Corona highlighted green
2. Molten Archon highlighted blue
3. Bleak Pebble highlighted blue
4. Molten Archon highlighted blue
5. Omicron Lyrae highlighted blue
UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader »

the order of the Ranges is irrelevant for in which Order Ships may travel through the Sectors, they just need to cover consecutive area without interruptions ;) otherwise you cannt set them as jump or highway range

you can use them to set simple priorities though - slots with lower number are preffered over the ones with a higher number

regarding the mining: i am sure i have confirmed that searching for ressources also works with Zones, Sectors or Clusters as refobject (basically they are objects, too) - but will look into it again.
(Only problem with this Command is that it searches in the whole Cluster, thats wy i check f the returned Zone is insid the desired Range)

regarding your second Setup:
the same Space twice is technically possible, but i have some limitations on the total count of Sectors and Clusters which can be used. and the second MA is over this limit for a 5Star Manager. but it is rendundant anyway because you aleady defined it.


@Marvin (second Edit)
i am asking the other way around:
<do_if value="$zone.exists and ( $zone.hascontext.{$range.{$i}} or $zone == $range.{$i} )">
$zone.exists - checks if i got a valid returnvalue (to avoid debug spam)
$zone.hascontext.{$range.{$i}} -> checks if the returned Zone is inside / has context of the range setting (works for Sector or Cluster ranges, does not work for Zones though)
$zone == $range.{$i} -> checks if the Zone returned is the same as the range (to complement the previous test)
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 ;)
User avatar
Marvin Martian
Posts: 3616
Joined: Sun, 8. Apr 12, 09:40
x4

Post by Marvin Martian »

UniTrader wrote:i am asking the other way around:
.hascontext.
ah ok, thanks for explain, didn't know that detail

but!
you search the ranges simply by do_all and take the first match, or i'm wrong?
so if i have a base in Malstrom and my first range is DeVries (in case i change, or the local Sector hasn't the ressource), i will find my minders in DeVries not in closer zones i define later
or is here any check i don't see yet
I3laze
Posts: 78
Joined: Tue, 13. Oct 15, 11:52
x4

Post by I3laze »

UniTrader wrote:
you can use them to set simple priorities though - slots with lower number are preffered over the ones with a higher number

regarding the mining: i am sure i have confirmed that searching for ressources also works with Zones, Sectors or Clusters as refobject (basically they are objects, too) - but will look into it again.
(Only problem with this Command is that it searches in the whole Cluster, thats wy i check f the returned Zone is insid the desired Range)
Ok so would this setup for range work better for my miner's? I am using a lower number and specifying a zone.

1. Fervid Corona highlighted green
2. Twilight sentinel highlighted blue (mining resourses)
3. Omicron Lyrae highlighted blue
4. Molton Archon highlighted blue

Update: It does not matter what way I set ranges as my miners still do not mine. My food factory freighter is still stuck saying buying water from water Distillery and sell to my food factory, but when you look at map veiw and select the freighter it says wait. It has been like that for over 1 game hour.

I think my campaign game is now broken so I've started a new game start from the dlc. I've edited in the same amount of credits 430mil that I had from old game into my new game, as I would like to get the money achievement from playing the game. I've also removed a few mods that I think may have been the problem, mainly trade related and station related.
UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader »

ok, i found the Error with mining: i gave the Signal for the Mining Order to the wrong Object - the Ship. it should have been the Pilot/Captain who should receive this (error was introduced in latest Version where i changed the way orders are passed so i can log them all in a consistent manner)

will commit the fix as soon as i have confirmed all range types work - just to be safe ;)



also one more note: the Debug Menu does not contain the all-purpose-make-it-working-tools but tools to find causes of Errors or to restore original functionality of my Script in case something went really wrong. (for example if the base script is somehow killed, which should never happen)
It does not Fix any Issues in my Scripts (or only temporary, see next point).
Also it wont change the Orders given because there is no randomisation in them - usually if the circumstates are the same my manager will always decide for the same. and these tools are also not thoroughly tested because they are not designed to be used regulary (in fact just found out that the restart-script function breaks the Range Settings of the Manager completely because the related Lists are deleted but not restored)
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 ;)
I3laze
Posts: 78
Joined: Tue, 13. Oct 15, 11:52
x4

Post by I3laze »

Ah so I was not going mad thinking that the miners worked before. I forgot I updated to your latest script. I wish I had not deleted my saves now :(

Will we see a update this weekend? no pressure :wink:
UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader »

ok, Fix is commited and confirmed to work (tested for Zone and Sector Range, Cluster is the next but i am confident this will work, too)

just replace all Mod files with the new ones, you can even continue your Save ;) could take a while (10 to 20 minutes) until the Ship starts working, but thats it.

also i noticed there is a not planned delay between Asking for Orders from the Captain and the moment the Manager Receives this Signal.. no idea why this happens, will look into this for the next update.. until then be a bit patient with my managed Ships..


@Marvin
yes, i search for Trades and Mining Locations on a first match-base. no complicated comparision between diffrent Offers or Locations, the first one fulfilling all Criteria is selected. doing it this way for multiple reasons:
=> allows easy implementatioon of Priorities (just sort all Options in the order of their Priority before cycling through them)
=> its Performance-Saving (i want to use this Script for all Ships in the Univers on the long term, so already thinking about the possible impact on performance)
=> Also it may not find the Best of all possible Options (which is not the goal because there often is none) but this way it also should not make any serious mistakes (which is the goal ;) )

also i have vague plans to extend the Trade Search to also account for other possible Trades at the Place of the selected Trade Offer (buying and selling multiple Wares in one Tour), taking these into account in a search for the "best" option is not feasible because of the expotential groth of Options
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 ;)
I3laze
Posts: 78
Joined: Tue, 13. Oct 15, 11:52
x4

Post by I3laze »

Ok I have a new start and have built a Hardware Supplier factory in Omicron Lyrae/Last Stand which so far has 2 x Reinforced metals production and 2 x Refined metals production. I have equipped the station with 30 mk2 surface mining drones but they do not seem to mine. I have no ore what so ever and the station is built near ore fields. How do I get the manager to tell the drones to mine for ore?
UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader »

Ore collection from the manager is not supported (yet) because Stations don't have the capability to break small rocks efficiently - currently only Gas Mining directly by the Manager is supported (although this can be changed by a few tweaks in the files, but it will only work similar to gas collection, you won't see the drones pick up rocks)

Also I am thinking about implementing it in such a way that fight drones break up nearby small rocks until they are collectable but this will require more testing especially regarding it's efficiency
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 ;)
I3laze
Posts: 78
Joined: Tue, 13. Oct 15, 11:52
x4

Post by I3laze »

Ah ok, I guess I'll be ordering a Fedhelm then.

I've just read your first post again and I could of answered my own question. Sorry about that.

Edit: scoop mining drones do not collect plasma for my Cell fab matrix in Drippy Ascent. Also my mining ship is refusing to mine for ions or plasma. When I first setup the miner it went and collected ions no problem but for some strange reason now it just sits idle. I did add some more ranges but surely that is not effecting it. Ion stock is around 200. If I kill the manger in the debug and replace, the miners go off to mine straight the way.

Another thing I have noticed is that my two miners for my Hardware factory in Last Stand keeps getting told to buy refined metals when I have low stock of ore. The strange thing is that my refined metals storage space is nearly full. I would prefer them to mine the ore that is in the same zone as my factory instead of buying metal.

I'll create a log file for the cell fab, but how long do I run it for?
UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader »

UniTrader wrote:also i noticed there is a not planned delay between Asking for Orders from the Captain and the moment the Manager Receives this Signal.. no idea why this happens, will look into this for the next update.. until then be a bit patient with my managed Ships..
just commited a fix for this to master. there may be still a short delay between Order request from a Captain and the Manager looking for new Orders, but this delay should be in the seconds-range instead of minutes as before..

sorry for the inconvinience
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 ;)
I3laze
Posts: 78
Joined: Tue, 13. Oct 15, 11:52
x4

Post by I3laze »

Miners working now :) The station scoop drones still do not work, well I do not see drones collecting and the station details say 0 out of 40 scoop drones used. I do have quite a bit of plasma though so maybe it works but there is no animation to show them mining?
User avatar
YorrickVander
Posts: 2774
Joined: Tue, 29. Oct 13, 21:59
x4

Post by YorrickVander »

Gas mining in ships always uses the ooz method, just absorbing materials on a timer so I'd imagine it's the same for the station.
X Rebirth - A Sirius Cybernetics Corporation Product

Split irritate visiting pilot with strange vocal patterns.
I3laze
Posts: 78
Joined: Tue, 13. Oct 15, 11:52
x4

Post by I3laze »

UniTrader wrote:Version 0.02 is now available:

-> Added Gas/Liquid Mining to Manager (Drone usage needs improvement, but thats purely visual
Looking at update 0.02 it makes sense that I don't see them mining. I do have a lot of plasma and I'm pretty sure my traders did not buy any as I have not assigned any liquid traders to the station and my liquid/gas miner is busy mining ion in another sector.

Would be nice if you could see the scoops working but I guess that is something that could be added down the line maybe.
UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader »

well, you can only see the Drones mining if the Manager starts his Mining Operation while the Station is in Visible Range (InZone and possibly in Neighbour-Zone), which is every minute if the Manager is currently mining or every 5 Minutes if not (he will not mine while the Storage is full, but if there is a single unit less than his wanted amount he will launch the Drones to gather it ;) )

the Mining Operation is best visible on a freshly initialized Station because its Cargo is empty (and will take a bit until it is full), and it looks really impressive imo ;) - later you will see this effect only rarely because the Gas Mining is far too efficient (its almost like the Station directly depletes the Zone Yield instead of using its stored Wares :D)


Station based Scoop collecting is on the Road Map but really low prio. also not sure how i can solve this in a non-blocking way.. (manager cannot constantly watch the progress of the Scoop Collection, he has to give out Orders to his Ships and ocassionally do Zone Trading, too.. currently solving both by giving the Order, then exit and after a certain time (mining) or when its finished(zonetrade) evaluate the result and in the meantime leave it running in background - not possible with scoop collecting because someone constantly has to order collecting or crushing specific rocks)

btw: did anyone have this text in his debug log yet:
'%1 %2 %3 Manager Zonetrade %4 finally finished!! IT WORKS! PLEASE TELL ME WHEN YOU SEE THIS!'.[player.age,this.name,this.container.name,$finalselloffer]
in my Test Scenario Zone Trading is not possible because the Products and Ressources dont match, and
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 ;)
I3laze
Posts: 78
Joined: Tue, 13. Oct 15, 11:52
x4

Post by I3laze »

UniTrader wrote:
Station based Scoop collecting is on the Road Map but really low prio.
I'm confused here, you say that station mining works and you can see the drones working when in visible range to the station. I have never seen this happen yet. Will the info panel of the station reflect this when they are mining? Also what drones are you using for this to work because I thought scoop drones are gas collectors.

I've been sitting right next to my staion for a good few hours buying and selling, upgrading stations etc in the hope of seeing the station mining drones set to work.

Return to “X Rebirth - Scripts and Modding”