[MOD] Yet Another Trader v2.03c (updated 11th March '16)

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

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

User avatar
YorrickVander
Posts: 2774
Joined: Tue, 29. Oct 13, 21:59
x4

Post by YorrickVander »

Since every system has all possible mined wares, I don't consider miners taking player orders over npc an issue. If you want a miner to supply your station, assign it to a manager. It works much better that way and with the better mission pay it's no big thing to add a miner to each station.

The mining side is pretty saturated by the npc miners that sell to anyone in all areas but devris (and maybe teladi space, i still spend more time posting and trying to fix stuff than actually enjoying the game :P) so YAT miners are not exactly redundant, but more a fill in for occasional ware gaps, like ice in devries to fuel the water station and get food in production.
X Rebirth - A Sirius Cybernetics Corporation Product

Split irritate visiting pilot with strange vocal patterns.
w.evans
Posts: 2963
Joined: Tue, 18. Nov 14, 16:23
x4

Post by w.evans »

I actually find YAT miners rather useful for supplying more than one station in a cluster. I don't think any other mod does that with the dedicated mining ships since euclid's mod requires the Scaldis or Titurel, and I prefer to use dedicated mining ships for mining for immersion purposes, and so I have a more varied fleet.

About the range problem, I'll let you know when I get to DeVries with mining ships.
User avatar
YorrickVander
Posts: 2774
Joined: Tue, 29. Oct 13, 21:59
x4

Post by YorrickVander »

Ok well if it's actually useful for people then I can look into the miners as player only/player preferred too. Or maybe wangelis in his fork, a it isn't fast going my end.
X Rebirth - A Sirius Cybernetics Corporation Product

Split irritate visiting pilot with strange vocal patterns.
w.evans
Posts: 2963
Joined: Tue, 18. Nov 14, 16:23
x4

Post by w.evans »

Just tested both your mod and wanglewis'. Found my old save from back when I reported the problem in the first place, and fired it up.

Ok, first thing, the range works now! Didn't realize that you had fixed it, but the minute I re-activated YAT on my miners, my universal everything miner crossed the gate to Albion and started going to Distant Fume to sell it's stocked up plasma and ion. Back in XR v2.51, it just sat in Twilight Sentinel.

Second, the behavior between your two mods was different. With YAT, my ore-only miner preferred to sell to the station in-system first before jumping to my station in Forty-Two. With wanglewis' it immediately jumped to Forty-Two. While my station in Forty-Two needed ore more badly (it didn't have any), preferring local stations might be useful in that it's possible to prioritize stations by setting a miner's home system to that of the priority station. But wanglewis' would be faster in filling needs on a more global level. That's what I think, at least.

Makes me almost wish I could run both at the same time.

In any case, back to my new gamestart save.

Thanks for the fix! And sorry if I wasted your time.

ps. Noticed that Cluster range was no longer available in both YAT and wanglewis' mod, by the way. Was there a particular reason for that? It does actually come in handy sometimes.
User avatar
YorrickVander
Posts: 2774
Joined: Tue, 29. Oct 13, 21:59
x4

Post by YorrickVander »

Cluster = System :) That's just the way it is in ego's T files when I started adding translations. More to come.
X Rebirth - A Sirius Cybernetics Corporation Product

Split irritate visiting pilot with strange vocal patterns.
w.evans
Posts: 2963
Joined: Tue, 18. Nov 14, 16:23
x4

Post by w.evans »

Oh right, sorry. I keep confusing System with Sector.
manpapper
Posts: 61
Joined: Thu, 29. May 14, 11:51
x4

Post by manpapper »

Is this mod improves trades between stations?

For instance i have 8 Stations on Devries but someones only trade one resources with traders, if my stations have 0/8000 of energy cells and 7k/8k of plates traders will go buy plates ...

Is this mod will fix this ?
User avatar
YorrickVander
Posts: 2774
Joined: Tue, 29. Oct 13, 21:59
x4

Post by YorrickVander »

Sadly not. There is some xml which appears to be relevant but changing it hasn't achieved anything tangible. Station managers are still very stupid. You might want to try Galaxy Station Range (http://forum.egosoft.com/viewtopic.php?t=369302) which helps a bit by allowing your stations with radar dish built to send traders all over but the ai is still rubbish for that :( I caught one of my manager owned traders flying 2 sectors to buy 2 chemical compounds lol. 2!

I have some ideas but they need work and much testing my end - dont hold your breath. Maybe wangelis will get there in his offshoot of this mod :)
X Rebirth - A Sirius Cybernetics Corporation Product

Split irritate visiting pilot with strange vocal patterns.
manpapper
Posts: 61
Joined: Thu, 29. May 14, 11:51
x4

Post by manpapper »

I hope Egosoft will fix this quickly or a good modder because it's game breaking if you would like to build a empire :)
Only one thing to do, I will wait.

Thank you for your quick answer.
wanglewis
Posts: 37
Joined: Thu, 24. Sep 09, 09:59
x4

Post by wanglewis »

@YorrickVander

I agree with your opinion that not consider player's priority(except buildership, which is ok), because the priority of the trader is making profit, and as i changed the code as a test, this will sometimes stuck the trade searching.

EDIT: I just have an idea that creating a new type of autotrader, which can be called station logistiker :D

trader/miner/logistiker

the logistiker only concern the demand of player's stations and also sell the wares of our stations to others, maybe we can also set the demand of player's stations as priority.

But recently i dont have time to do it, so I just put it on the TODO list and maybe you can consider about this idea :D
Last edited by wanglewis on Mon, 29. Dec 14, 18:28, edited 2 times in total.
wanglewis
Posts: 37
Joined: Thu, 24. Sep 09, 09:59
x4

Post by wanglewis »

@w.evans

Actually i didn't set the player's demand as priority in my mod in new versions(maybe also not in old version). Because i find that it's difficult to fill both profit and supply demand. And sometimes it will cause stuck to both miners and traders when there is demand from player.

But as in your game my mod made the decision to fill the demand of a station of yours which has better stock situation, the most reason is because the station give a better price in the range! :)

Recently all the traders and miners in my version consider only profit and demand from buildership!
User avatar
YorrickVander
Posts: 2774
Joined: Tue, 29. Oct 13, 21:59
x4

Post by YorrickVander »

I'm testing a change to allow traders to take care of player stations as priority atm alongside paying and being paid by player stations as it wa brought up earlier in this thread - the trader can get seriously borked after transferring a few expensive loads and ending up with no money to trade with.

I quite agree on the CLS type functionality (for the X3 players); A buyer/seller option pair tied to a specific manager would be cool, and aleviate the horrible manager ai that seems to be hard-coded. I may of course be missing something.

The other todo for me is a rewrite of the clunky ui - I actually designed yat to be 100% radial menu. A brief moment of 'i wonder if this would work' gave me the ui you see now after a couple of hours messing with lua for the first time. It's a bit shit essentially cos I never went back to make it not so shit :)
X Rebirth - A Sirius Cybernetics Corporation Product

Split irritate visiting pilot with strange vocal patterns.
w.evans
Posts: 2963
Joined: Tue, 18. Nov 14, 16:23
x4

Post by w.evans »

@wanglewis I'm pretty sure that was the very first version you released after you forked from YAT. Haven't looked at the code though, so I don't know if you implemented the preference for player-owned stations in that one. Assumed that you did because that was around the time that you were suggesting the change.

@YorrickVander The UI works, I find. Although I'm actually playing with euclid's autotrader at the moment, and like how starting traders simply can't trade further than a sector, while galaxy traders are these all-powerful supernatural beings that seemingly pop in and out of existence teleporting goods without so much as a time-space frizzle. But one thing that I do miss from YAT is the UI.

Starting to foresee that it might start getting hard to track all of the traders when I start to get them in the twenties. But for less than ten, euclid's autotrader works quite well.

And on that note, would either of you gentlemen know if I could run euclid's Autotrader and either of your mods at the same time? Autotrader and YAT use completely different scripts, don't they? They should, in theory, not conflict?
User avatar
YorrickVander
Posts: 2774
Joined: Tue, 29. Oct 13, 21:59
x4

Post by YorrickVander »

There's no conflict that I know of with YAT except changing from euclid's mod to yat and back on the same ship *might* screw up your progress from euclid's. Not having to level my captains was exactly why I stopped using euclid's and made my own though :)
X Rebirth - A Sirius Cybernetics Corporation Product

Split irritate visiting pilot with strange vocal patterns.
User avatar
NZ-Wanderer
Posts: 1627
Joined: Thu, 5. Aug 04, 01:57
x4

Post by NZ-Wanderer »

YorrickVander wrote:I'm testing a change to allow traders to take care of player stations as priority atm alongside paying and being paid by player stations as it wa brought up earlier in this thread - the trader can get seriously borked after transferring a few expensive loads and ending up with no money to trade with.
Ooo that sounds good.. :) - you guys never cease to amaze me with all the great work you all do :)
Link to the list of Mods working in X4-Foundations and also Link to the list of Mods working in X-Rebirth

NOTE: I play with a modded game, so any reports I make outlining suggestions/problems/bugs/annoyances, are made with mods installed and running.
manpapper
Posts: 61
Joined: Thu, 29. May 14, 11:51
x4

Post by manpapper »

After reading your reply it seems that is really hard to perform the manager so i hope you could if not we just have to wait Egosoft update and hope it will be soon. If you could thank you for your hard work.
wanglewis
Posts: 37
Joined: Thu, 24. Sep 09, 09:59
x4

Post by wanglewis »

@w.evans

in theory there is no conflict. Both mods use their own aiscript and menus.
w.evans
Posts: 2963
Joined: Tue, 18. Nov 14, 16:23
x4

Post by w.evans »

Thanks!
7akata
Posts: 1
Joined: Sat, 1. Feb 14, 20:09

Post by 7akata »

I had a quick question regarding miners. I have my miner added, with 20 mining drones, and assigned to Cozy Shade. He seems to be [possibly bugged, flying around randomly with "Searching for Resources" or flying and stopping with the modes "Flying/Searching for Resources" bouncing back and forth. I've tried both specific Nvid which is in the system, and the generic any with no luck. Any thoughts?
User avatar
YorrickVander
Posts: 2774
Joined: Tue, 29. Oct 13, 21:59
x4

Post by YorrickVander »

The movement is just for show. It always uses out of zone ai as in zone is awfully buggy in vanilla. The hold will fill anyway :)

I tried a little hack yesterday for trying a collection mission. I made some code to point me to nividium rocks and found, to my amusement that there are barely a tiny percentage of actual rocks in a sector compared to the numbers shown on the map. Ore isn't too bad, silicon and crystals are more sparse, nividium i mostly found myself flying 35-100km between patches of 6-8 rocks.

If interested :

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<mdscript name="YorrickFindResource" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="md.xsd">
  <cues>
    <cue name="Yorrick_FindResource" instantiate="false" namespace="this">
      <conditions>
        <event_conversation_next_section sectionprefix="gYorrickFindRes"/>
      </conditions>
      <actions>
        <!-- find mineable wares within the cluster -->
        <create_list name="$availablewares" exact="0"/>
        <set_value name="$ware" exact="ware.nividium" />
        
        <find_closest_resource ware="$ware" refobject="player.ship" zone="$zone" wares="$secwares"/>
        <do_if value="$zone.exists">
          <do_if value="player.ship.cluster" exact="$zone.cluster">
            <append_to_list name="$availablewares" exact="$ware"/>
            <debug_text text="player.age + ' there is %1 in this cluster'.[$ware]" chance="100" filter="error"/>
          </do_if>

          <set_value name="$asteroid" exact="null" />
          <show_help log="true" custom="'Find Resources:\n First res in list %1'.[$availablewares.{1}]" position="6" duration="3s" />
          <find_asteroid_in_cluster name="$asteroid" cluster="player.ship.cluster" refobject="player.ship" canpickup="false" multiple="false" maxdistance="150km" viewangle="360deg" ware="$availablewares.{1}" />

          <debug_text text="player.age + ' found %1 asteroid'.[$asteroid]" chance="100" filter="error"/>

          <do_if value="$asteroid">
            <set_region_object_persistence object="$asteroid" />
            <set_value name="$destination" exact="$asteroid.position" />
            <debug_text text="player.age + ' found %1 pos'.[$destination]" chance="100" filter="error"/>
            <signal_cue_instantly cue="md.Guidance.NewTarget" param="[$asteroid, false]" />
          </do_if>
        </do_if>
        
        <reset_cue cue="this" />
      </actions>
    </cue>
  </cues>
</mdscript>
It's not pretty scripting, more sloppily written proof of concept, but it works fine from a convo/sidebar trigger
X Rebirth - A Sirius Cybernetics Corporation Product

Split irritate visiting pilot with strange vocal patterns.

Return to “X Rebirth - Scripts and Modding”