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

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

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

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

Post by YorrickVander » Fri, 20. Jan 17, 13:31

Just when I thought I was out, they drag me back in!

Only kidding. Intersting idea mate, I suspect I need to do some testing to make sure it all still works ok with the game changes too :)
X Rebirth - A Sirius Cybernetics Corporation Product

Split irritate visiting pilot with strange vocal patterns.

Sparky Sparkycorp
Moderator (English)
Moderator (English)
Posts: 8074
Joined: Tue, 30. Mar 04, 12:28
x4

Post by Sparky Sparkycorp » Sun, 22. Jan 17, 00:37

Eeek, sorry! :D

Thanks very much for taking this into consideration whatever the outcome :)

Chrionix
Posts: 11
Joined: Wed, 25. Feb 15, 04:00
x4

Post by Chrionix » Sat, 4. Feb 17, 07:50

Hi Yorrick (and others :)),

I'm a new guy working my way through the campaign, and I'm just trying to get your mod working, I've got the free Rahanas in DeVries, and have set him to operate within the system. He's got cargolifter URV's on board, but when I set him to free trade, he just sits still and is apparently searching for trades. What am I doing wrong?

p.s. I've got a bunch of trade update dudes throughout the system. Thanks for any help.

edit: Disregard, changing it to galaxy-wide (when I found out pmc won't attack my freighters) got him moving.

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

Post by YorrickVander » Tue, 11. Apr 17, 19:14

Sorry for slow relpy - There's not much trading to be done in devries until you make it yourself. I haven't had time for mod testing with the current game version, are you seeing any issues?
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 » Fri, 5. May 17, 17:44

Hi Yorrick, great mod but I'm wondering if it's possible to add options for done replacement like you can for the stations. I ask this because I must have at least 15 YAT traders that I have setup with at least 40 attack drones for defence. After a while the traders start loosing them as well as the construction drones due to attacks. A buy replacement drone option would be very helpful.

Anyway thanks for this mod.

User avatar
alexalsp
Posts: 1820
Joined: Fri, 18. Jul 14, 05:28
x4

Post by alexalsp » Sun, 28. May 17, 12:08

mainmenu.xml

Text

Code: Select all

Cancel trade updates please.
Not in a text file.

:wink:

Please fix

Code: Select all


<?xml version="1.0" encoding="iso-8859-1" ?>
<diff>
  <!-- add remove trade sub from trade manager of station to allow changes to trading whitelist -->
  <add sel="//cue[@name='SectionHandler']//do_if[@value='$object.tradenpc']" pos="before">
    <do_if value="(not $object.tradenpc.isplayerowned) and ($object.hastradesubscription)">
      <add_player_choice text="{98981,500}" comment="Remove offer updates" section="gYAT_RemoveTradeUpdates" choiceparam="$object" selectable="true" />
    </do_if>
  </add>
</diff>




for 007 lng file

Code: Select all


      <!-- gYAT_RemoveTradeUpdates -->
      <t id="500">Отменить обновления торговых предложений.</t>



for file

content.xml

Code: Select all


UTF-8

<text language="07" name="Yet Another Trader" description="Система автоматической торговли и добычи" author="Yorrick Vander" /> 


User avatar
bbn
Posts: 88
Joined: Mon, 31. Jan 11, 18:30
x4

Post by bbn » Wed, 7. Jun 17, 00:11

YorrickVander wrote:Probably the best way would be to setup a ship, say a large well defended one, next to a station. Assign YAT ships to that, send them on their way :)
Tired just that, but ships that are assigned to other ships don't have option to assign it to trade manager... Am I doing something wrong?

User avatar
Sinxar
Posts: 1224
Joined: Tue, 22. Mar 11, 05:44
x4

Post by Sinxar » Wed, 5. Jul 17, 13:22

I am having issue with this script. When giving the start command from outside the trader's home zone, it will fly home then just sit there. I have to stop and restart the command for it to start working.

I looked at the script myself but I have no idea where to look to fix it myself.

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

Post by YorrickVander » Fri, 4. Aug 17, 02:47

I'm gonna have to remember how all this works myself before i can fix it :)
X Rebirth - A Sirius Cybernetics Corporation Product

Split irritate visiting pilot with strange vocal patterns.

User avatar
bbn
Posts: 88
Joined: Mon, 31. Jan 11, 18:30
x4

Post by bbn » Thu, 5. Oct 17, 23:24

For those that would like to have also data on how much profit the miners made you can add

Code: Select all

<set_value name="this.$YAT_buyprice" exact="1" />
Just above

Code: Select all

 <run_script name="'YAT.trade.performplayertraderun'"/> 
in yat.mining.ship.free.xml.

The above is a hack, will give you profit reduced by 1. I noticed that there is a code for profit calculation that checks both buy and selling price:

Code: Select all

<do_if value="(this.$YAT_buyprice > 0) and (this.$YAT_sellprice > 0)">
        <set_value name="this.$YAT_ProfitsMade" exact="this.$YAT_ProfitsMade + (this.$YAT_sellprice - this.$YAT_buyprice)"/>
</do_if>
One could remove the first condition, but I'm not sure if it will not mess up with other parts of the script (it shouldn't but I didn't look that hard in the scripts yet).

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

Post by YorrickVander » Fri, 6. Oct 17, 01:40

Alternatively you could just add the extra clause to the check instead of forcing value of 1 :)

if ((this and that) or (other))
...
X Rebirth - A Sirius Cybernetics Corporation Product

Split irritate visiting pilot with strange vocal patterns.

antoniut
Posts: 198
Joined: Sat, 4. Oct 14, 13:07
xr

Post by antoniut » Fri, 6. Oct 17, 12:56

I'm using Transcend and TAF mods (maybe relevant) and this mod. In Transcend, there is a gate directly to Albion. I've retired the trade agent correctly from TU Overwatch in Verdant Profit (plenty marauders there...) but ships still going there to pass from Transcend to Albion.

Some idea?

Thanks

User avatar
bbn
Posts: 88
Joined: Mon, 31. Jan 11, 18:30
x4

Post by bbn » Fri, 6. Oct 17, 13:01

YorrickVander wrote:Alternatively you could just add the extra clause to the check instead of forcing value of 1 :)

if ((this and that) or (other))
...
Yup, that would be more elegant solution. Do you remember if you introduced some variables exclusive for miners, or should I add it?

User avatar
bbn
Posts: 88
Joined: Mon, 31. Jan 11, 18:30
x4

Post by bbn » Sun, 8. Oct 17, 00:18

Ok, so I've cleaned the miner update a little bit. I've introduced new var in yat.mining.ship.free.xml called YAT_miner_selling and changed the conditions on profits calculation to:

Code: Select all

<do_if value="((this.$YAT_sellprice > 0) and ((this.$YAT_buyprice > 0) or (this.$YAT_miner_selling > 0) ))">
        <set_value name="this.$YAT_ProfitsMade" exact="this.$YAT_ProfitsMade + (this.$YAT_sellprice - this.$YAT_buyprice)"/>
      </do_if>
You can get updated scripts in https://drive.google.com/open?id=0ByfVb ... lFaaFB6TkE

(Still, not the most elegant solution... but I'm just getting started with X:R modding :oops: )

User avatar
bbn
Posts: 88
Joined: Mon, 31. Jan 11, 18:30
x4

Post by bbn » Sun, 8. Oct 17, 02:17

One more update.
I've removed some checks - so writing to logbook works again (also verbal notifications, but I removed most of them, leaving only the one on closing trade run).

The updated script is here.

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

Post by YorrickVander » Mon, 9. Oct 17, 12:18

For visibility you might want to fork the mod and make your own thread for it. I'm fine with you doing that but I can't and won't try to support or debug it. Consider it a sane sort of GPL - if/when I return to YAT if you add stuff I like I may want to use it ;)

As for the exclusive to miners vars, not that I recall no, except for the obvious ones added to the pilot entity to track what the ships doing.
Last edited by YorrickVander on Mon, 9. Oct 17, 12:22, edited 1 time in total.
X Rebirth - A Sirius Cybernetics Corporation Product

Split irritate visiting pilot with strange vocal patterns.

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

Post by YorrickVander » Mon, 9. Oct 17, 12:20

antoniut wrote:I'm using Transcend and TAF mods (maybe relevant) and this mod. In Transcend, there is a gate directly to Albion. I've retired the trade agent correctly from TU Overwatch in Verdant Profit (plenty marauders there...) but ships still going there to pass from Transcend to Albion.

Some idea?

Thanks
Not really :( The pathing will just try to find the fastest route, not the safest. And even then only fastest by means of jumps, not fastest by means of in sector travel :(
X Rebirth - A Sirius Cybernetics Corporation Product

Split irritate visiting pilot with strange vocal patterns.

Exavier724
Posts: 118
Joined: Fri, 12. Dec 03, 02:13
x2

Post by Exavier724 » Mon, 9. Oct 17, 16:59

Yorrick,
I am not sure if you are still working on improvements for this based on some of your comments but I had a suggestion.

Would it be possible to get a toggle-able limiter for "Buy From" & "Sell To"? Specifically with the options for:
- All (Any valid location)
- NPC (Any NPC Station or Player Station set to sell to NPCs)
- Player (Only Player stations flagged to Restrict Trade)

One I hit about 20 stations in my personal empire it became obnoxious to manage all the freighters so I tried to set up a group of your traders to handle it universally. When I switched all the stations to Restrict to Player trading only it caused alot of strange behavior. Half the time the traders couldn't find any trades but periodically I would see them selling off resources I was trying to keep within the network.

antoniut
Posts: 198
Joined: Sat, 4. Oct 14, 13:07
xr

Post by antoniut » Mon, 9. Oct 17, 22:41

YorrickVander wrote:
antoniut wrote:I'm using Transcend and TAF mods (maybe relevant) and this mod. In Transcend, there is a gate directly to Albion. I've retired the trade agent correctly from TU Overwatch in Verdant Profit (plenty marauders there...) but ships still going there to pass from Transcend to Albion.

Some idea?

Thanks
Not really :( The pathing will just try to find the fastest route, not the safest. And even then only fastest by means of jumps, not fastest by means of in sector travel :(
:thumb_up:

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

Post by YorrickVander » Mon, 9. Oct 17, 23:01

@Exavier724 Not soon, but maybe I'll update :)

@antoniut I should add that's vanilla pathing, YAT does no custom route finding
X Rebirth - A Sirius Cybernetics Corporation Product

Split irritate visiting pilot with strange vocal patterns.

Post Reply

Return to “X Rebirth - Scripts and Modding”