EnglishGermanFrenchRussianItalianSpanish
Log inRegister
 
[MOD] Auto Trader (v1.1 Dec 15 2015)
Post new topic Reply to topic Goto page 1, 2, 3 ... 26, 27, 28  Next
View previous topic :: View next topic
Author Message
euclid
Moderator (Script&Mod)
Moderator (Script&Mod)



Joined: 15 Feb 2004
Posts: 9142 on topic
Location: Gower, South Wales
Thank you for registering your game
modified
PostPosted: Mon, 6. Jan 14, 03:41    Post subject: [MOD] Auto Trader (v1.1 Dec 15 2015) Reply with quote Print

AutoTrader Ver.1.1:

V1.1: Added type for trade reservation (change of script command format in X Rebirth 4.0)

DOWNLOAD



    I. Requirements:
    You need a ship with universal storage capacity. To start the AutoMiner the ship needs at least 10 Scooper and 10 surface drones.


    II. How to start:

      1) Fly to a zone which sector has enough trade opportunities because the initial range of an AutoTrader will be this sector.
      2) Add the ship to your squad and wait until it has arrived.
      3) Select the ship either via property or zone map or simply target it if in visual range.
      4) Engage and disengage the autopilot (default: hit shift-A twice) to trigger a custom conversation "Auto Trade"
      5) Select "AutoTrade" and then one of the trade options "Sector Trader", "Sector Station Trader", "Sector Miner" or "Sector Station Miner" (see I. Requirements).
      6) Remove the ship from your squad.


    III. Promotion
    The total profit of an Auto trader unlocks an optional promotion. A corresponding message (including status details) is send to the player's logbook. To promote an auto trader just trigger the menu (see II.,4)) and select the Cluster or Galaxy trader option. Except the benefit of a wider range a promoted auto trader will work slightly faster and deals in higher ranked wares. However, his fee also increases slightly.

    IV. Relocation
    It is easy to move an auto trader to another sector or cluster. Just follow the steps 1) to 6) in II. above.

    V. Warnings:

      1) Be careful where you start what type of AutoTrader! Any station miner or station trader will exclusively trade between player-owned stations only within his range (initially the current sector). For the station miner ensure that you own at least one station in that sector and that this station need resources available in this sector. For the station trader you need at least two stations in that sector which production and resources are mutually dependent (one produces the resource of the other).

      2) Be careful how many traders you promote to Cluster or even Galaxy range. A Galaxy Auto Trader will search the entire galaxy for most profitable deals and hence the list he has to check will become very long. If you run too many Galaxy Traders there will be significant lag spikes when they search for trades.


    VI. Installation
    As usual extract the entire AutoTrader folder to your extensions folder.


    VII.Deinstallation
    Add all your auto traders to your squad to stop the scripts. Then save your game and exit. Remove the folder AutoTrader from your extensions folder. Start the game, load the saved game and find other jobs for the former auto traders.


    VIII. Compatibility
    As all my mods also this mod does not use or alter any vanilla files for the ultimate compatibility. However, it does use but uses several global and local (on the captain) variables and also adds some inventory items and an account to the captain. [bPlease do not change these! [/b]

    IX. CopyRight
    I allow everyone to use this mod in parts or entirely for your own mod. Change or modify it as you like but, please, do not publish your mod of this mod at the Nexus (as some did already Sad ). I will maintain my mods there and do not wish any conflict.

Question & Answers

Q: I've started the Station Trader and now he is following me around. What is wrong?
A: If you start a Station Trader or Station Miner in a sector where you do not own any stations then he will send you a corresponding message (check you logbook) and will follow you.

Q: I do own several stations in the sector where I have started the Station Miner but he is following me. Is this a bug?
A: No bug. The Station Miner and the Sector Miner will check initially and regularly the amount of scooper and surface drones. If there are not 10 of each then he send a message and follow you around. Lead him to a ship Yard and buy the missing collector drones. The lead him back to the sector wher he is suppose to work, hail the captain and select "resume autotrade" either the Station Miner or Sector Miner.

Q: I have a Cluster Station Trader running but now I've changed my mind and want him to serve not only my stations but trade with NPC stations, too. How can I do that?
A: Just follow steps II. 2) to 6).
Q: I have observed my Station miner for some time and he is collecting and the drones do show "in Use" but there are no drones flying about. What is wrong?
A: Nothing, similar as with the autotrader's cargo lifters the mod do not launch the collector drones for collection. The entire collection is 'simulated'. So there is also no need for a ship to have a mining laser.

Q: My Rahanas energy freighter does not have the auto trader option, why?
A: The AutoTrader will only work with ship that have universal storage. However, if you insist of having an energy-only auto trader running then please feel free to mod my mod Wink

Q: Could you recommend a good station setup for the Station Trader?
A: There are many good setups. An Engergy Array is always good to have because ecells are needed by every station. Similar with food rations, so a Foodstuff Supply in addition is a good setup. But also, for example, a Metalworks Yard and an Arms Tech Fab because the refined metals produced in the Metalworks are needed as a resource in the Arms Tech Fab to produce reinforced metal plating.

Q: My auto trader is not moving and hasn't send any report for some time.
A: Trigger the menu (see II. steps 3) & 4)) and see if the option "Show profit" appears. If so feel free to click it for a status update in your logbook. Probably your trader has not found any deals in his range.

Q: I did hail him but there is no such show profit option. What is wrong?
A: The only way that can happen is if your pilot has received another command. Either you have assigned him to a new superior or added him to your squad or issued any other order. But no panic, you can restart him (see II. above).

Q: No, that didn't work either. What now?
A: Kick him from your squad, add him again and if you still do not get the option then send me your zipped saved game please Smile

Q: What about fuel?
A: No worries, the pilot covers for the fuel cost via his commision charge. (Technically: they do not use fuel for jumping). If they have fuel initially it will be used for jumping.

Q: I've accidentially added him to my squad and now he's just following me. Is all lost?
A: Nope, all is cool. Just restart him (see II. above).

Q: I keep getting reputation gains with faction I never met but nothing increases. Is this brocken?
A: No, not broken, it's intended. Every trade partner's faction will be known to you, too, and With each trade you gain a very small reputation with the trader faction. It is so small that it requires many runs to "see" a reputation gain.

Q: LOL ! I've never been in Omicron Lyrae but in the map some sectors and zones are "known" to me. Is that right?
A: Do you remember the feature in X3 where you could set a fast ship to follow the Goner U.F.O.? It would eventually map out for you the entire universe Very Happy The auto trader has the same feature: if an area is known to them it is also known to you.

Q: I watched my auto trader during trades but where are the cargo lifter?
A: This mod does not use cargo lifters for load wares. The auto trader's ship has secretly been upgraded and equipped with a transporter beam Wink

Q: What would you consider as an optimum ship setup for an auto trader?
A: Use a Titurel (go captue one Razz) with a high-skilled engineer and a defence officer (command set on defend), fully equipped ammo, 75 welder drones and 75 interceptor Mk2, no fuel.


Cheers Euclid


_________________
"In any special doctrine of nature there can be only as much proper science as there is mathematics therein.”
- Immanuel Kant (1724-1804), Metaphysical Foundations of the Science of Nature, 4:470, 1786


Last edited by euclid on Fri, 18. Mar 16, 00:11; edited 25 times in total
Back to top
View user's profile Send private message Send e-mail MSN Messenger
UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)

MEDAL

Joined: 20 Nov 2005
Posts: 13725 on topic

Thank you for registering your game
PostPosted: Mon, 6. Jan 14, 03:57    Post subject: Re: [MOD] Auto Trader Reply with quote Print

euclid wrote:
The reason is that the current script system lacks of global variables as we know them from the "old" SE. Hence it's tricky to 'safe' data if a script, that has defined them, is cancelled. My solution is to use the pilot's inventory (yes, NPCs have one Wink ) which I use to safe the auto trader's level. I've also added an account to the pilot and set a maximum budget to save the profit.

Global Variables exist and are far easier to use than in the old SE Rolling Eyes Wink (probably its too simple, i didnt find it at first, too ^^)
global.$variable <-use this like any variable you would use in the Script. no need to explicitly read/write them.

additionally you also have local Variables on Entities:
this.$variable (acces to $variable on the Entity, probably the Pilot/Captain in your case)

PS i think may find this code snippet useful when you want to use this Script on other Ships with limited Cargo (it filters a list with all availabele wares so only the transportable, legal ones are left):
Code:
      <!-- list of all wares for iteration - i wish i could get this one dynamically.. (or simply only the compatible wares..) -->
      <run_script name="'lib.ut.get.unreachable.values'" result="$allwares">
        <param name="value" value="'allwares'"/>
      </run_script>
      <create_list name="$basket" exact="0"/>
      <do_all exact="$allwares.count" counter="$i">
        <!-- we want only transportable Goods -->
        <do_if value="this.ship.cargo.{$allwares.{$i}}.max">
          <!-- we dont want to trade Fuel (re-charging is done seperately)-->
          <do_if value="$allwares.{$i} != ware.fuelcells">
            <!-- dont include illegal Wares (ToDo: finer check needed; for now i only ignore globally Illegal Wares -->
            <do_if value="not $allwares.{$i}.illegal">
                <append_to_list name="$basket" exact="$allwares.{$i}"/>
            </do_if>
          </do_if>
        </do_if>
      </do_all>
      <remove_value name="$allwares"/>
      <show_notification caption="'Warebasket'" details="$basket" queued="true" chance="$debugoutputchance"/>



_________________
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 Wink

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help Wink
Back to top
View user's profile Send private message
werewolves?



MEDALMEDALMEDAL

Joined: 31 Jan 2012
Posts: 1062 on topic
Location: Aotearoa
Thank you for registering your game
PostPosted: Mon, 6. Jan 14, 04:12    Post subject: Reply with quote Print

you guys are rad.

Back to top
View user's profile Send private message
Tanvaras





Joined: 27 Nov 2003
Posts: 34 on topic
Location: Australia
Thank you for registering your game
PostPosted: Mon, 6. Jan 14, 04:56    Post subject: Reply with quote Print

In the words of Monty Burns "Excellent!!!!"

Thank gawd for modders Smile

Cheers

Back to top
View user's profile Send private message
YorrickVander





Joined: 29 Oct 2013
Posts: 2627 on topic
Location: The naughty corner
Thank you for registering your game
PostPosted: Mon, 6. Jan 14, 07:04    Post subject: Reply with quote Print

Euclid, above and beyond mate. Great job.


_________________
X Rebirth - A Sirius Cybernetics Corporation Product

Split irritate visiting pilot with strange vocal patterns.
Back to top
View user's profile Send private message
iforgotmysocks





Joined: 08 Nov 2013



PostPosted: Mon, 6. Jan 14, 10:25    Post subject: Reply with quote Print

Pretty nice!

PS: md scripts aren't macros. You don't need to add them to any index file. ^^
Only macros and components.

Back to top
View user's profile Send private message
euclid
Moderator (Script&Mod)
Moderator (Script&Mod)



Joined: 15 Feb 2004
Posts: 9142 on topic
Location: Gower, South Wales
Thank you for registering your game
PostPosted: Mon, 6. Jan 14, 14:12    Post subject: Re: [MOD] Auto Trader Reply with quote Print

UniTrader wrote:

.......
global.$variable <-use this like any variable you would use in the Script. no need to explicitly read/write them.

additionally you also have local Variables on Entities:
this.$variable (acces to $variable on the Entity, probably the Pilot/Captain in your case)
.......

iforgotmysocks wrote:

........
PS: md scripts aren't macros. You don't need to add them to any index file. ^^
Only macros and components.


Thanks to both of you Smile

Cheers Euclid


_________________
"In any special doctrine of nature there can be only as much proper science as there is mathematics therein.”
- Immanuel Kant (1724-1804), Metaphysical Foundations of the Science of Nature, 4:470, 1786
Back to top
View user's profile Send private message Send e-mail MSN Messenger
YorrickVander





Joined: 29 Oct 2013
Posts: 2627 on topic
Location: The naughty corner
Thank you for registering your game
PostPosted: Mon, 6. Jan 14, 14:41    Post subject: Reply with quote Print

Been trying out the trader today, works very well Smile May I pop in a request for something similar for mining vessels? Perhaps with similar skill upgrades to sell local, cluster or galactic and at some stage learn to favour player offers over npc?

I am btw seeing a lot of these errors in my log though the trader is till making money regardless:

[General] ======================================
[=ERROR=] Error in AI script autotrade on entity 0x17795F: Property lookup failed: $buyoffers.{353}.unitprice
* Expression: $Maxprofit lt $Amount * ($buyoffers.{$i}.unitprice - $selloffers.{$j}.unitprice) and player.money gt 2 * $Amount * $selloffers.{$j}.unitprice
[General] ======================================
[General] ======================================
[=ERROR=] Error in AI script autotrade on entity 0x17795F: Property lookup failed: $buyoffers.{353}.ware
* Expression: [this.ship.cargo.{$buyoffers.{$i}.ware}.free, $buyoffers.{$i}.amount, $selloffers.{$j}.amount].min
[General] ======================================


_________________
X Rebirth - A Sirius Cybernetics Corporation Product

Split irritate visiting pilot with strange vocal patterns.
Back to top
View user's profile Send private message
euclid
Moderator (Script&Mod)
Moderator (Script&Mod)



Joined: 15 Feb 2004
Posts: 9142 on topic
Location: Gower, South Wales
Thank you for registering your game
PostPosted: Mon, 6. Jan 14, 17:25    Post subject: Reply with quote Print

YorrickVander wrote:

...................*snip*.................
[=ERROR=] Error in AI script autotrade on entity 0x17795F: Property lookup failed: $buyoffers.{353}.unitprice
* Expression: $Maxprofit lt $Amount * ($buyoffers.{$i}.unitprice - $selloffers.{$j}.unitprice) and player.money gt 2 * $Amount * $selloffers.{$j}.unitprice
...................*snip*................

Hm .....353 buy offers Surprised .... that should not happen. One reason the cluster and galaxy trader have a restricted shopping list. For example if you search for all trades in the entire galaxy then the returned list is so long that the algorithm, to find the optimum deal, takes too much time to execute so that some (or at least one) of the trade offers has been reserved by someone else and, since the list entries are passed by reference, there is no way to hold the data.

May I ask what trader caused that (sector/cluster/galaxy) and in which sector does he work?

Cheers Euclid


_________________
"In any special doctrine of nature there can be only as much proper science as there is mathematics therein.”
- Immanuel Kant (1724-1804), Metaphysical Foundations of the Science of Nature, 4:470, 1786
Back to top
View user's profile Send private message Send e-mail MSN Messenger
YorrickVander





Joined: 29 Oct 2013
Posts: 2627 on topic
Location: The naughty corner
Thank you for registering your game
PostPosted: Mon, 6. Jan 14, 19:07    Post subject: Reply with quote Print

It's a scaldis started as sector trader in ascendancy. Just before end of log (a few hours afk to see how it went) I upgraded to cluster trader.

Full log from that session if helpful :
https://docs.google.com/file/d/0BzGfezjYefWQTENmT0h0MURWRlU/edit

Edit : I should add that my TradeThing (on Nexus) mod is also installed to make the npc traders do their thing too.


_________________
X Rebirth - A Sirius Cybernetics Corporation Product

Split irritate visiting pilot with strange vocal patterns.
Back to top
View user's profile Send private message
fiby





Joined: 29 Jan 2007
Posts: 72 on topic

Thank you for registering your game
PostPosted: Mon, 6. Jan 14, 19:18    Post subject: Reply with quote Print

Finally a mod that I've been waiting for! Thanks for taking the time to design and implement it. Just one question do I still need to look for the offers myself around the galaxy or does the ship have access to that information already?

Keep up the good work!

Back to top
View user's profile Send private message
toepick





Joined: 29 Feb 2012

Location: Clayton, NY

PostPosted: Mon, 6. Jan 14, 22:17    Post subject: Reply with quote Print

yep..this is awesome!! seems to be working great.. have 4 running each sector of Albion atm..as soon as last one reaches level two I will 'promote' each one.

this is almost too easy (and fast lol) Not that I am complaining at all.. is it feasible to allow them to work their cargo normally (without the transporter beam). Or was that necessary to get the mod to work properly?

Back to top
View user's profile Send private message
UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)

MEDAL

Joined: 20 Nov 2005
Posts: 13725 on topic

Thank you for registering your game
PostPosted: Mon, 6. Jan 14, 22:58    Post subject: Reply with quote Print

toepick wrote:
yep..this is awesome!! seems to be working great.. have 4 running each sector of Albion atm..as soon as last one reaches level two I will 'promote' each one.

this is almost too easy (and fast lol) Not that I am complaining at all.. is it feasible to allow them to work their cargo normally (without the transporter beam). Or was that necessary to get the mod to work properly?


not necesary, but perhapsn easier since you dont have to do the docking procedure etc. first.. (i am currently working on something similiar and thats where i am a bit lost since the Vanilla Scripts for that are very extensive)


_________________
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 Wink

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help Wink
Back to top
View user's profile Send private message
euclid
Moderator (Script&Mod)
Moderator (Script&Mod)



Joined: 15 Feb 2004
Posts: 9142 on topic
Location: Gower, South Wales
Thank you for registering your game
PostPosted: Mon, 6. Jan 14, 23:33    Post subject: Reply with quote Print

@YorrickVander: Thanks for the debug log. It seems something is heavily interfering with the mod because even the initial cue check shows an error (see your debug). Also you got loads of patch complaints there. I know many people ignore these but you never know for sure what they might do.

Best advise I can offer is to test the mod with a new game not using any other mods you have running atm..



@fiby: You have probably found out yourself by now that you don't need to do anything. Once started the auto(nomous) trader will do it's job until the end of days Wink



@toepick: No, not necessary but, as Unitrader said already, the game scripts for cargo transfer via drones is tricky:
Your ship needs to find a docking spot risking to get blocked by others and may lose the trade reservation resulting in long queues and a full cargo hold. The cargo lifters have to be available. Ok, your freighter has some but NPC ships or station may not. Again resulting in waiting queues.
This is why I've decided not to code that. Besides, who is actually watching the trader to dock and then send the cargo lifters? Wink


Cheers Euclid


_________________
"In any special doctrine of nature there can be only as much proper science as there is mathematics therein.”
- Immanuel Kant (1724-1804), Metaphysical Foundations of the Science of Nature, 4:470, 1786
Back to top
View user's profile Send private message Send e-mail MSN Messenger
hannahb





Joined: 31 Aug 2007
Posts: 67 on topic
Location: Exploring strange new worlds...
Thank you for registering your game
modified
PostPosted: Tue, 7. Jan 14, 00:00    Post subject: Reply with quote Print

Great mod, I really like this one.

If I could recommend an improvement? Perhaps you could limit an auto-traders reports back about their activities based on time,level in order to reduce spam?

Ideally, for example, a sector trader could report back after completing 5 trades instead of every trade and a higher level trader could report back less often as you would then have more confidence he is operating correctly.

Perhaps you could even use his total profits value and a capped logarithmic inverse to make him report back frequently at first and less often as he gains experience. This way you can see right away that he's working and as he gets better he spams you less. This kind of represents a system where you wouldn't worry about him as much once you are confident he is working correctly.



Last edited by hannahb on Tue, 7. Jan 14, 00:23; edited 1 time in total
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic Reply to topic Goto page 1, 2, 3 ... 26, 27, 28  Next
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum
Control Panel
Login Data
The time now is Wed, 22. Aug 18, 09:07

All times are GMT + 2 Hours

[ Disclaimer / Impressum ] | [ Privacy Policy / Datenschutz ]

Board Security

Copyright © EGOSOFT 1989-2018
Powered by phpBB © 2001, 2005 phpBB Group
Template created by Avatar & BurnIt!
Debug: page generation = 0.18868 seconds, sql queries = 29