How to transfer wares between stations?

The place to discuss scripting and game modifications for X4: Foundations.

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

leecarter
Posts: 379
Joined: Sat, 9. Sep 06, 22:35
x3tc

How to transfer wares between stations?

Post by leecarter »

Digging around through the XSDs and I see plenty on creating orders, but I can't find a way to do a straight transfer. I'm trying to tell a ship "go pickup X amount of this ware from this station and drop it off at this other station". Basically the transfer equivalent of create_trade_order. Does this exist?
djmidex
Posts: 122
Joined: Wed, 22. Sep 10, 07:41
x4

Re: How to transfer wares between stations?

Post by djmidex »

No. I still cant understand why developers have not implemented station tresholds and proper station traders, couriers etc. At the moment, you can transfer wares between stations using TaterTrader mod. Not perfectly, but it works.
leecarter
Posts: 379
Joined: Sat, 9. Sep 06, 22:35
x3tc

Re: How to transfer wares between stations?

Post by leecarter »

I'm talking about in the scripts. Tater trader is great, but I'm trying to do something different. Playing with create_trade_offer now, but not getting very far.
UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Re: How to transfer wares between stations?

Post by UniTrader »

Code: Select all

<execute_custom_trade amount buyer chance commandaction comment price result resume seller sinceversion totalprice tradeorder unbundle usecommandermoney ware weight />
from aiscript.xsd


PS requires both Stations to be in the same Zone/Masstraffic Network and having Cargo Drones
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 ;)
morbideth
Posts: 391
Joined: Sun, 9. Nov 08, 03:07
x3tc

Re: How to transfer wares between stations?

Post by morbideth »

leecarter wrote: Mon, 7. Jan 19, 00:27 Digging around through the XSDs and I see plenty on creating orders, but I can't find a way to do a straight transfer. I'm trying to tell a ship "go pickup X amount of this ware from this station and drop it off at this other station". Basically the transfer equivalent of create_trade_order. Does this exist?
Not sure what your are asking? Do you mean transfer between two of your own stations? If you want do a transfer like you said above without it being a trade order (why?) you have to tell it to fly to station a and dock for trade, then transfer wares, then fly to station b, then dock to trade, then transfer wares.
leecarter
Posts: 379
Joined: Sat, 9. Sep 06, 22:35
x3tc

Re: How to transfer wares between stations?

Post by leecarter »

UniTrader wrote: Mon, 7. Jan 19, 03:54

Code: Select all

<execute_custom_trade amount buyer chance commandaction comment price result resume seller sinceversion totalprice tradeorder unbundle usecommandermoney ware weight />
from aiscript.xsd


PS requires both Stations to be in the same Zone/Masstraffic Network and having Cargo Drones
I was playing with that, couldn't seem to get it working, but it's been a few hours now and I can't remember the issue. Also doesn't really work with the zone/drone requirements anyway so I need to do another approach anyway.
morbideth wrote: Mon, 7. Jan 19, 03:57 Not sure what your are asking? Do you mean transfer between two of your own stations? If you want do a transfer like you said above without it being a trade order (why?) you have to tell it to fly to station a and dock for trade, then transfer wares, then fly to station b, then dock to trade, then transfer wares.
My own stations. I kind of figured I would need to hold the damn thing's hand and guide it step by step through the process instead of just firing off a couple of create_trade_order style commands based on what I was seeing in the XSD's. Bleh.
UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Re: How to transfer wares between stations?

Post by UniTrader »

so you just want to cheat and add/remove wares from a Station, basically teleporting them?

Code: Select all

<add_cargo object ware exact result /> <remove_cargo object ware exact result/> <transfer_money amount from to result />
have fun with doing all the needed checks to not mess up the amounts..
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 ;)
leecarter
Posts: 379
Joined: Sat, 9. Sep 06, 22:35
x3tc

Re: How to transfer wares between stations?

Post by leecarter »

UniTrader wrote: Mon, 7. Jan 19, 04:38 so you just want to cheat and add/remove wares from a Station, basically teleporting them?

Code: Select all

<add_cargo object ware exact result /> <remove_cargo object ware exact result/> <transfer_money amount from to result />
have fun with doing all the needed checks to not mess up the amounts..
Saw that, was trying to avoid the magic approach but there may not be another way to do it. I guess doing a straight cargo transfer between my own stations outside the context of a trade order is some wild and crazy idea.
morbideth
Posts: 391
Joined: Sun, 9. Nov 08, 03:07
x3tc

Re: How to transfer wares between stations?

Post by morbideth »

Well.. it is just that a trade does the same thing? It isn't like it charges you when trading between your own stations.
TheDeliveryMan
Posts: 883
Joined: Sat, 10. Dec 11, 03:10
x4

Re: How to transfer wares between stations?

Post by TheDeliveryMan »

leecarter wrote: Mon, 7. Jan 19, 04:56
UniTrader wrote: Mon, 7. Jan 19, 04:38 so you just want to cheat and add/remove wares from a Station, basically teleporting them?

Code: Select all

<add_cargo object ware exact result /> <remove_cargo object ware exact result/> <transfer_money amount from to result />
have fun with doing all the needed checks to not mess up the amounts..
Saw that, was trying to avoid the magic approach but there may not be another way to do it. I guess doing a straight cargo transfer between my own stations outside the context of a trade order is some wild and crazy idea.
No, the idea is not crazy. When you requested it for my mod, I spend some time to find a solution. Didn't see an obvious way to implemented it, then I stumbled across <add_tradeware> and now we have trade stations ;)

Have you tried to <create_trade_offer> on the station?
leecarter
Posts: 379
Joined: Sat, 9. Sep 06, 22:35
x3tc

Re: How to transfer wares between stations?

Post by leecarter »

morbideth wrote: Mon, 7. Jan 19, 06:37 Well.. it is just that a trade does the same thing? It isn't like it charges you when trading between your own stations.
You have to have money on the station, but that's minor. The bigger issue for what I want to do is that you're at the mercy of the station manager as to what wares you can put in the station.
TheDeliveryMan wrote: Mon, 7. Jan 19, 07:32
No, the idea is not crazy. When you requested it for my mod, I spend some time to find a solution. Didn't see an obvious way to implemented it, then I stumbled across <add_tradeware> and now we have trade stations ;)

Have you tried to <create_trade_offer> on the station?

Good job on that mod too. I was playing around with create_trade_offer but kept getting nulls on the offer name when I went to create_trade_order with it. It was at that point I decided I had enough scripting for a Sunday afternoon and put this post up. I'll tinker around with it some more this evening and maybe get it figured out.
UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Re: How to transfer wares between stations?

Post by UniTrader »

if it helps you here all required attributes according to the xsd:
<create_trade_offer object="null" ware="null" price="null" amount="null" playeronly="false" name="null"/>

Of course you also need a buyer or seller to generate a valid offer. Also note that there is no way that this command will ever transfer wares. it generates Trade Offers which are looked at by the Ships to find good Trade routes, nothing more.

Also get an XML editor which supports autocomplete based on xsds. i personally use xmlcopyedit for example ( http://xml-copy-editor.sourceforge.net/ ) - its a HUGE help. it can also verify if your script is well-formed and valid, preventing many simple errors to ever get tested unssecessfully in the game.
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 ;)
leecarter
Posts: 379
Joined: Sat, 9. Sep 06, 22:35
x3tc

Re: How to transfer wares between stations?

Post by leecarter »

UniTrader wrote: Mon, 7. Jan 19, 21:34 if it helps you here all required attributes according to the xsd:
<create_trade_offer object="null" ware="null" price="null" amount="null" playeronly="false" name="null"/>

Of course you also need a buyer or seller to generate a valid offer. Also note that there is no way that this command will ever transfer wares. it generates Trade Offers which are looked at by the Ships to find good Trade routes, nothing more.

Also get an XML editor which supports autocomplete based on xsds. i personally use xmlcopyedit for example ( http://xml-copy-editor.sourceforge.net/ ) - its a HUGE help. it can also verify if your script is well-formed and valid, preventing many simple errors to ever get tested unssecessfully in the game.
As I've been tinkering around with it, trying to shoehorn a trade into a transfer is just a crap approach. Feels like I'm having issues trying to do a trade on a ware that the station doesn't have set up as an official "tradeware". I'm going to start playing around with the auto-magic transfer. I'll have to jump through some hoops with doing additional quantity checks when the ship finally docks. Eh, we'll see.

Return to “X4: Foundations - Scripts and Modding”