Let me know if any tweaks are needed, can tell what to change or just explain the expressions so you can do it on your own.
Pretty simple.
Moderator: Moderators for English X Forum
Code: Select all
[@this.ship.commander.tradenpc.skill.management, @this.ship.pilot.skill.piloting].max
Code: Select all
<replace ...>if @this.ship.commander.tradenpc then [@this.ship.commander.tradenpc.skill.management, @this.ship.pilot.skill.piloting].max else [3, @this.ship.pilot.skill.piloting].max / 3</replace>
Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<diff>
<replace sel="//params/param[@name='minbuy']/input_param[@name='max']/@value">[@this.ship.commander.tradenpc.skill.management, @this.ship.pilot.skill.piloting].max</replace>
<replace sel="//params/param[@name='minsell']/input_param[@name='max']/@value">[@this.ship.commander.tradenpc.skill.management, @this.ship.pilot.skill.piloting].max</replace>
<replace sel="//params/param[@name='maxbuy']/input_param[@name='max']/@value">[@this.ship.commander.tradenpc.skill.management, @this.ship.pilot.skill.piloting].max</replace>
<replace sel="//params/param[@name='maxsell']/input_param[@name='max']/@value">[@this.ship.commander.tradenpc.skill.management, @this.ship.pilot.skill.piloting].max</replace>
<replace sel="//init/do_if[@value='this.isplayerowned']/set_value[@name='$maxrange' and @exact='[@this.assignedcontrolled.commander.tradenpc.skill.management, @this.assignedcontrolled.pilot.skill.piloting].max / 3']/@exact">[@this.assignedcontrolled.commander.tradenpc.skill.management, @this.assignedcontrolled.pilot.skill.piloting].max</replace>
<replace sel="//patch/do_if[@value='this.isplayerowned']/set_value[@name='$maxrange' and @exact='[@this.assignedcontrolled.commander.tradenpc.skill.management, @this.assignedcontrolled.pilot.skill.piloting].max / 3']/@exact">[@this.assignedcontrolled.commander.tradenpc.skill.management, @this.assignedcontrolled.pilot.skill.piloting].max</replace>
</diff>
Code: Select all
<param name="minbuy" default="0" type="number" advanced="true" text="{1041, 10066}" comment="Min gate distance to buy. Buy range supported if $minbuy and $maxbuy are provided">
<input_param name="startvalue" value="0"/>
<input_param name="min" value="0"/>
<input_param name="max" value="[([@this.ship.commander.tradenpc.skill.management, @this.ship.pilot.skill.piloting].max / 3) - 1, 0].max"/>
<input_param name="step" value="1"/>
</param>
<param name="maxbuy" default="0" type="number" text="{1041, 10054}" comment="Max gate distance to buy. Buy range supported if $minbuy and $maxbuy are provided">
<input_param name="startvalue" value="0"/>
<input_param name="min" value="0"/>
<input_param name="max" value="[@this.ship.commander.tradenpc.skill.management, @this.ship.pilot.skill.piloting].max / 3"/>
<input_param name="step" value="1"/>
</param>
<param name="minsell" default="0" type="number" advanced="true" text="{1041, 10068}" comment="Min gate distance to sell. Sell range supported if $minsell and $maxsell are provided">
<input_param name="startvalue" value="0"/>
<input_param name="min" value="0"/>
<input_param name="max" value="[([@this.ship.commander.tradenpc.skill.management, @this.ship.pilot.skill.piloting].max / 3) - 1, 0].max"/>
<input_param name="step" value="1"/>
</param>
<param name="maxsell" default="0" type="number" text="{1041, 10057}" comment="Max gate distance to sell. Sell range supported if $minsell and $maxsell are provided">
<input_param name="startvalue" value="0"/>
<input_param name="min" value="0"/>
<input_param name="max" value="[@this.ship.commander.tradenpc.skill.management, @this.ship.pilot.skill.piloting].max / 3"/>
<input_param name="step" value="1"/>
</param>
Code: Select all
<do_if value="this.isplayerowned">
<set_value name="$maxrange" exact="[@this.assignedcontrolled.commander.tradenpc.skill.management, @this.assignedcontrolled.pilot.skill.piloting].max / 3"/>
<do_if value="$minbuy gt [$maxrange - 1, 0].max">
<edit_order_param order="this.assignedcontrolled.order" param="'minbuy'" value="[$maxrange - 1, 0].max"/>
</do_if>
<do_if value="$maxbuy gt $maxrange">
<edit_order_param order="this.assignedcontrolled.order" param="'maxbuy'" value="$maxrange"/>
</do_if>
<do_if value="$minsell gt [$maxrange - 1, 0].max">
<edit_order_param order="this.assignedcontrolled.order" param="'minsell'" value="[$maxrange - 1, 0].max"/>
</do_if>
<do_if value="$maxsell gt $maxrange">
<edit_order_param order="this.assignedcontrolled.order" param="'maxsell'" value="$maxrange"/>
</do_if>
<remove_value name="$maxrange"/>
</do_if>
Code: Select all
<job id="argon_bio_trader_l" name="{20204,1301}">
<modifiers rebuild="false" commandeerable="true"/>
<!--<expirationtime min="14400" max="21600" />-->
<orders>
<order order="TradeRoutine" default="true">
<param name="minbuy" value="0"/>
<param name="maxbuy" value="5"/>
<param name="minsell" value="0"/>
<param name="maxsell" value="5"/>
</order>
</orders>
<basket basket="bio"/>
<category faction="argon" tags="[factionlogic, freighter, trader]" size="ship_l"/>
<quota galaxy="8" cluster="4"/>
<location class="galaxy" macro="xu_ep2_universe_macro" faction="argon" relation="member" comparison="ge"/>
<environment buildatshipyard="true"/>
<ship>
<select faction="argon" tags="[trader, container]" size="ship_l"/>
<loadout>
<level min="0" max="0.4"/>
</loadout>
<owner exact="argon" overridenpc="true"/>
</ship>
</job>
Have you changed the script? Like the min value for min buy/sell for ex?
Nope, not changed anything. I'm wondering now if it perhaps had some left-over Food Rations in it from a prior manual trade or something, I'm really not sure now.pref wrote: ↑Wed, 13. Mar 19, 01:24Have you changed the script? Like the min value for min buy/sell for ex?
I can't say if station traders would do such thing in vanilla, i almost exclusively use ATs as station traders act pretty weird in cases.
By the way when you assign a ship to a station from the context menu, the max buy/sell range will be set to [piloting, management].max * 2 in the lib.request.orders script, and the range will be adjusted by the max range check in order.trade.routine. So currently you cannot set a higher range then skill*2 for station traders without patching lib.request.orders as well.
In case they have leftover cargo that will get sold now, that is normal for station traders as well.Scoob wrote: ↑Wed, 13. Mar 19, 18:07Nope, not changed anything. I'm wondering now if it perhaps had some left-over Food Rations in it from a prior manual trade or something, I'm really not sure now.
The increased trade ranges are really helping though. Ships aren't ranging as far as in 1.6 of course, but they're actually able to sell the stations produce now at least.
Scoob.
Can you make an official post about this mod. It seems pretty interesting and I think other players might like it.pref wrote: ↑Sat, 9. Mar 19, 00:26Made a quick change for this, range = skill (pilot/management), not skill/3.Scoob wrote: ↑Fri, 8. Mar 19, 22:14As the new ranges appear to largely be Stars = Range, a way to rebalance that would be a quick fix. Sadly I had zero X4 modding experience, so wouldn't know where to start looking.
Basically, rather than the current system of (guessing a bit here) of one Star = one Sector, I'd love to edit this out to one Star = three Sectors, two Stars = six Sectors, three Stars = nine Sectors etc. etc. or something along those lines.
Scoob.
TradeRangeIncrease mod
Can't test it much because i get CTD in 30 mins tops, but should work if no other mod changes the affected trade script. Had a ship selling with it from nopileos to the ANT wharf so they do pick targets further away.
Though it is really insufficient, there should be a way to control ware flow in much more detail.
Also if you check modded section there is a mod for warehouses and trade stations by legion of onepref wrote: ↑Fri, 8. Mar 19, 18:20I have seen some posts over at beta forum that player complexes with ship building related modules will not sell ship building resources any more.
Is this an intended change or a bug?
How are we supposed to get our wares outside the max 5 sector radius without having to manually do trade runs constantly then?
I was hoping i could create warehouses which would buy wares of my production complex, and resell them to nearby shipyards. But since endproducts cannot be bought, for this it is a must to have a dock/wharf on the warehouse to turn endproducts into resources.
If these stations will not sell the wares because of that then i see no way to manage logistics in an acceptable manner..
I'd be curious what else options i have then?
I'd really prefer having production centralised in my own space, much more flexible solution in case a relation change happens with any race. Also there are less issues with AI config, less time spent in map and more in my spaceship, less time spent on the employee skill misery, generally more effective with build time and costs, and also i just love the space cities this game made possible to create.
My last hope with this 5 sector trade limit was that i can build logistic centres around the galaxy which are just empty warehouses with an EQ dock attached and config some ATs on them so the wares can reach shipyards further away, but this seems to be impossible now
Hey Scoob!Scoob wrote: ↑Sat, 15. Jun 19, 22:24I just had a quick look at pref's script. It seems it makes changes to maxrange only, which of course did work fine. However, while the increased maxrange can be seen in-game, it's part of a greyed-out slider with Minrange being the skill level in stars. I would try to tweak this to adjust minrange too, but I think that might have other consequences.
Why ES made this change in the first place is a mystery, and why it's subsequently been tweaked again, which has broken this great mod, is a mystery too.
I LOVE building large stations to supply the whole galaxy with resources, it's fun. Now my station can only reach a fraction of it. Not fun.
Scoob.
Thanks for your workLegionOfOne wrote: ↑Sat, 15. Jun 19, 19:14Given your problems, I think you would love my Mules and Warehouses mod.
It solves every problem I ever encountered trying to supply my own stations, shipyards, station construction sites, allows the creation of warehouses, and so much more
Hey pref,pref wrote: ↑Sun, 23. Jun 19, 13:41Hey Scoob!
Is this still of any relevance to you or anyone else?
I never launched the game since, but can take a look if needed. I tested the stuff back then, it worked (have seen ships go autotrade beyond the vanilla limit). Regarding tweaking it i think there was a min/max calculation for both min and max range or something like that, it could be confusing a bit.
Quite possible a patch since then caused it to not function any more.