[MOD] Player Owned Warehouses

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

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

LegionOfOne
Posts: 122
Joined: Sun, 16. Dec 18, 13:16
x4

Re: [MOD] Player Owned Warehouses

Post by LegionOfOne » Sun, 20. Jan 19, 21:27

amox wrote:
Wed, 16. Jan 19, 11:46
If you can find a way to allow us setup the buy orders, that would be most helpful.
I did by modding the UI, so the buy offers are visible and the prices can be controlled, works like a charm.
I can post the code, or a link to a working version, if you want.
Viper61 wrote:
Wed, 16. Jan 19, 09:33
I am struggling to get it to work
I managed to make it work great, maybe I can help.
First, if you don't have a 'Trade Subsciption' with another Faction, requiring +30 relations, the offers in your stations are only visible to ships flying past and don't update automatically.
If your station is a bit out of the way, no-one will know what you sell or buy.
So you'll have to handle the buying and selling yourself, until you get good enough relations.

Beyond that, Autotraders and Tatertraders are way too slow for my taste, because of the number of possible trade routes they have to compare.
I really suggest using simpler scripts like Supply and Trade Route and my favourite the Station Mule.

amox
Posts: 25
Joined: Sun, 16. Dec 18, 11:33
x4

Re: [MOD] Player Owned Warehouses

Post by amox » Mon, 21. Jan 19, 11:58

LegionOfOne wrote:
Sun, 20. Jan 19, 21:27
amox wrote:
Wed, 16. Jan 19, 11:46
If you can find a way to allow us setup the buy orders, that would be most helpful.
I did by modding the UI, so the buy offers are visible and the prices can be controlled, works like a charm.
I can post the code, or a link to a working version, if you want.
Viper61 wrote:
Wed, 16. Jan 19, 09:33
I am struggling to get it to work
I managed to make it work great, maybe I can help.
First, if you don't have a 'Trade Subsciption' with another Faction, requiring +30 relations, the offers in your stations are only visible to ships flying past and don't update automatically.
If your station is a bit out of the way, no-one will know what you sell or buy.
So you'll have to handle the buying and selling yourself, until you get good enough relations.

Beyond that, Autotraders and Tatertraders are way too slow for my taste, because of the number of possible trade routes they have to compare.
I really suggest using simpler scripts like Supply and Trade Route and my favourite the Station Mule.

yes please make your changes available. It would help a lot to improve this mod with avaiable buy prices.

Apart from that, please explain the Trade Subscription a little more. What effects does it have? So far I was under the impression that it only allows me to see all the prices of that faction. Will the licence do more ?

LegionOfOne
Posts: 122
Joined: Sun, 16. Dec 18, 13:16
x4

Re: [MOD] Player Owned Warehouses

Post by LegionOfOne » Mon, 21. Jan 19, 15:46

amox wrote:
Mon, 21. Jan 19, 11:58
yes please make your changes available. It would help a lot to improve this mod with avaiable buy prices.

Apart from that, please explain the Trade Subscription a little more. What effects does it have? So far I was under the impression that it only allows me to see all the prices of that faction. Will the licence do more ?
From what I have seen Trade Subscriptions also allow the trade ships of that particular faction to see all offers on your Stations, just like it allows your trade ships to see their stations' offers.

And here is my updated version of the mod, with changes to the UI to show and edit the buy offers in the Logical Overview :
Mega Download

Edit : The download has been updated to the 0.31 version of the G_Workaround mod, that allows UI mods to work.
The workaround mod is not included, get the latest version in the thread.
As for the code part, it is very simple :
Show

I changed one line inside one function in the ui/addons/ego_detailmonitor/menu_station_overview.lua file.

The function is onExpandStorage, and the change is this :
Original line :
if (waretype == "resource") or (waretype == "intermediate") then

New line :
if (waretype == "resource") or (waretype == "intermediate") or (waretype == "trade") then

This is a very small modification, simply allowing an already existing buy offer to display.
There are small UI bugs in the Logical Overview, but they are vanilla (for ex. : sometimes, clicking on the buy price changes the sell price instead, and vice-versa).
I may have to update this mod with Egosoft's fixes for these bugs, as they appear to have been fixed in the latest Beta.
And finally a few tips that may not be obvious to everyone :
Show
When setting prices manually, if you set the buy price to absolute minimum, no regular trader will ever sell to your station.
All NPC trade ships and player ships using autotrade orders need to make a profit.
So, at best, they can buy a ware at minimum price somewhere, and sell it to your station at minimum price +1

For the same reason, if you set a sell order to maximum prices, no regular trade ship will ever buy this ware from this station.

But SnTR can make trade runs for 0 profit, and the wonderful Mules don't even care about prices.

What I like to do with my trade stations is sell to other factions, but never buy.
Since you can't exclude trade with other factions on a buy offer or sell offer separately, I use a minimum buy price on every ware so I never buy from other factions.
Then I only use Mules and SNTR to deliver the goods I produce to my station, where NPC ships can come and buy them.
I also use Mules to deliver all the wares I can sell to every NPC Trade Station, Shipyard and dock in the game's universe, it works great.
Last edited by LegionOfOne on Fri, 25. Jan 19, 01:23, edited 3 times in total.

Doctorzook
Posts: 8
Joined: Fri, 18. Jan 19, 16:35
x4

Re: [MOD] Player Owned Warehouses

Post by Doctorzook » Wed, 23. Jan 19, 17:47

Thank you both TDM for creating and Legion for refining this mod, and for taking time out of your day to create mods in the first place. It's wonderfull to see what can be achieved with all these mods, that make a game better/or at least more interesting!

Is there any way to make it compatible with G_workaround 0.31?
Infocenter is a great mod which adds a great deal of Information over ones fleet and it already upgraded to 0.31.

ty

LegionOfOne
Posts: 122
Joined: Sun, 16. Dec 18, 13:16
x4

Re: [MOD] Player Owned Warehouses

Post by LegionOfOne » Thu, 24. Jan 19, 13:33

Doctorzook wrote:
Wed, 23. Jan 19, 17:47
Is there any way to make it compatible with G_workaround 0.31?
Edit : updated to 0.31 and to properly use dependencies, and added the link in my previous post.

NoelSt
Posts: 61
Joined: Tue, 4. Dec 18, 12:42
x4

Re: [MOD] Player Owned Warehouses

Post by NoelSt » Sun, 27. Jan 19, 22:53

Hello and thx both of you for the mods. One question:

I have noticed Ore, Silicon, Methane and similar raw materials cannot be transported to a warehouse. Miners don't mine for the station neither. I tried to transport some Ore to a warehouse but the freighter cannot do that. Any experiences like these related? My plans are to transport raw materials to a warehouse and sell it from there.

Requiemfang
Posts: 3206
Joined: Thu, 16. Jul 09, 12:24
x4

Re: [MOD] Player Owned Warehouses

Post by Requiemfang » Mon, 28. Jan 19, 00:25

NoelSt wrote:
Sun, 27. Jan 19, 22:53
Hello and thx both of you for the mods. One question:

I have noticed Ore, Silicon, Methane and similar raw materials cannot be transported to a warehouse. Miners don't mine for the station neither. I tried to transport some Ore to a warehouse but the freighter cannot do that. Any experiences like these related? My plans are to transport raw materials to a warehouse and sell it from there.
Does your station have the supported storage modules? gas requires liquid storage module, ore, silicon, ice, ect requires solid module.

NoelSt
Posts: 61
Joined: Tue, 4. Dec 18, 12:42
x4

Re: [MOD] Player Owned Warehouses

Post by NoelSt » Mon, 28. Jan 19, 00:37

Requiemfang wrote:
Mon, 28. Jan 19, 00:25
NoelSt wrote:
Sun, 27. Jan 19, 22:53
Hello and thx both of you for the mods. One question:

I have noticed Ore, Silicon, Methane and similar raw materials cannot be transported to a warehouse. Miners don't mine for the station neither. I tried to transport some Ore to a warehouse but the freighter cannot do that. Any experiences like these related? My plans are to transport raw materials to a warehouse and sell it from there.
Does your station have the supported storage modules? gas requires liquid storage module, ore, silicon, ice, ect requires solid module.
Yep, warehouse have 1 of each. Liquid, Solid and Container. The fact is, if i want to transport the excedent of ore to my warehouse (from Refined Metals factory of my own), i can`t. And i cannot assign a miner to my warehouse. I feedback this if it can help to improve this mod, warehouse idea is fantastic :)

LegionOfOne
Posts: 122
Joined: Sun, 16. Dec 18, 13:16
x4

Re: [MOD] Player Owned Warehouses

Post by LegionOfOne » Wed, 30. Jan 19, 07:52

NoelSt wrote:
Sun, 27. Jan 19, 22:53
I have noticed Ore, Silicon, Methane and similar raw materials cannot be transported to a warehouse.
Indeed, that's not supposed to be possible. There are no trade ships capable of transporting raw materials anyway. Only mining ships can, and they only transport from a resource field to a station, never station to station.
The only wares you can buy/sell on a warehouse are the container wares, that trade ships can transport. It is completely useless to build liquid or solid storage on a warehouse.

So you will need to assign mining ships directly to each of your factories, you can't supply them from a warehouse.

NoelSt
Posts: 61
Joined: Tue, 4. Dec 18, 12:42
x4

Re: [MOD] Player Owned Warehouses

Post by NoelSt » Wed, 30. Jan 19, 15:29

LegionOfOne wrote:
Wed, 30. Jan 19, 07:52
NoelSt wrote:
Sun, 27. Jan 19, 22:53
I have noticed Ore, Silicon, Methane and similar raw materials cannot be transported to a warehouse.
Indeed, that's not supposed to be possible. There are no trade ships capable of transporting raw materials anyway. Only mining ships can, and they only transport from a resource field to a station, never station to station.
The only wares you can buy/sell on a warehouse are the container wares, that trade ships can transport. It is completely useless to build liquid or solid storage on a warehouse.

So you will need to assign mining ships directly to each of your factories, you can't supply them from a warehouse.
A mod to allow raw materials transport would be nice...thx all helping here.

Misunderstood Wookie
Posts: 377
Joined: Mon, 15. Mar 04, 08:07
x4

Re: [MOD] Player Owned Warehouses

Post by Misunderstood Wookie » Thu, 11. Apr 19, 06:22

This is neat, only its a tedious process, could be easier if ware groups were added like in the various other trade mods such as taters trader.

Legit wares
Hugh tech
Shipbuilding parts

Etc

Or allow the use of multiple ware selections to be applied at the same time, as adding every ware one a time is a long ass process.
*modified*
*X3 LiteCube User*
MOD GemFX Real Space Shaders
MOD Variety and Rebalance Overhaul Icon Pack
I lost my Hans and should not be flying Solo.
Image

nickolaiproblem
Posts: 246
Joined: Mon, 5. Nov 18, 23:12
x4

Re: [MOD] Player Owned Warehouses

Post by nickolaiproblem » Thu, 11. Apr 19, 23:13

ledhead900 wrote:
Thu, 11. Apr 19, 06:22
This is neat, only its a tedious process, could be easier if ware groups were added like in the various other trade mods such as taters trader.

Legit wares
Hugh tech
Shipbuilding parts

Etc

Or allow the use of multiple ware selections to be applied at the same time, as adding every ware one a time is a long ass process.
I agree I also think that maybe the mod should have station based menu since its a station based mod.

Misunderstood Wookie
Posts: 377
Joined: Mon, 15. Mar 04, 08:07
x4

Re: [MOD] Player Owned Warehouses

Post by Misunderstood Wookie » Fri, 12. Apr 19, 09:21

I thought the same, tho I think the mod relies on the docking part in some way, I am not sure if it does not rely on a ship to cause a station update then it may as well move over to the Gui_Workaroung and Right Click Menu API and implement its own button to the station menu.
*modified*
*X3 LiteCube User*
MOD GemFX Real Space Shaders
MOD Variety and Rebalance Overhaul Icon Pack
I lost my Hans and should not be flying Solo.
Image

nickolaiproblem
Posts: 246
Joined: Mon, 5. Nov 18, 23:12
x4

Re: [MOD] Player Owned Warehouses

Post by nickolaiproblem » Fri, 12. Apr 19, 12:17

ledhead900 wrote:
Fri, 12. Apr 19, 09:21
I thought the same, tho I think the mod relies on the docking part in some way, I am not sure if it does not rely on a ship to cause a station update then it may as well move over to the Gui_Workaroung and Right Click Menu API and implement its own button to the station menu.
Yea it probably does I just thing select wares and waiting for them populate configure in warehouse is better when its station based rather than ship.

Misunderstood Wookie
Posts: 377
Joined: Mon, 15. Mar 04, 08:07
x4

Re: [MOD] Player Owned Warehouses

Post by Misunderstood Wookie » Fri, 12. Apr 19, 12:58

Might be, I am not too fussed how more concerned about having to do either way per ware the docking method is really slow if you are doing this for every ware in the game it can take hours upon hours just re issuing a command with a different ware.

I knew how to XML I would have fixed this myself. It is no secret since XML took over Xscript language I stopped modding, it is not that the new engine is less powerful it is quite better over the X3 script engine but the formatting for XML just makes my head hurt I never liked expression based coding.

I like to define a set of variables or DO segments as I call them then call those anywhere within the script or externally
One script set all the information into something I can be ****** typing by taking a long segment or block of code and putting it a variable that can be re-used to query the code block.
(usually, this is where you would add your engine queries for things like maybe you need to check seven things first add them all to a block then you can simply write 'do Qcheck' for example to with XML you need to define everything per block and that infuriated me.

Someone is willing to teach me a better way but that is how I understood the XML formatting since X:R
There are scripts around for X4 at least which convert this XML to scripting languages like LUA or Python
Either is much better IMO, XML is okay for simply replacing something but modifying upon new code it drives me insane.
*modified*
*X3 LiteCube User*
MOD GemFX Real Space Shaders
MOD Variety and Rebalance Overhaul Icon Pack
I lost my Hans and should not be flying Solo.
Image

nickolaiproblem
Posts: 246
Joined: Mon, 5. Nov 18, 23:12
x4

Re: [MOD] Player Owned Warehouses

Post by nickolaiproblem » Sun, 14. Apr 19, 16:36

ledhead900 wrote:
Fri, 12. Apr 19, 12:58
Might be, I am not too fussed how more concerned about having to do either way per ware the docking method is really slow if you are doing this for every ware in the game it can take hours upon hours just re issuing a command with a different ware.

I knew how to XML I would have fixed this myself. It is no secret since XML took over Xscript language I stopped modding, it is not that the new engine is less powerful it is quite better over the X3 script engine but the formatting for XML just makes my head hurt I never liked expression based coding.

I like to define a set of variables or DO segments as I call them then call those anywhere within the script or externally
One script set all the information into something I can be ****** typing by taking a long segment or block of code and putting it a variable that can be re-used to query the code block.
(usually, this is where you would add your engine queries for things like maybe you need to check seven things first add them all to a block then you can simply write 'do Qcheck' for example to with XML you need to define everything per block and that infuriated me.

Someone is willing to teach me a better way but that is how I understood the XML formatting since X:R
There are scripts around for X4 at least which convert this XML to scripting languages like LUA or Python
Either is much better IMO, XML is okay for simply replacing something but modifying upon new code it drives me insane.
You could try x4 discord https://discord.gg/2zsWzKQ modding section

nickolaiproblem
Posts: 246
Joined: Mon, 5. Nov 18, 23:12
x4

Re: [MOD] Player Owned Warehouses

Post by nickolaiproblem » Sun, 14. Apr 19, 16:36

Does anyone know if main modder behind this is still working on this project?

LegionOfOne
Posts: 122
Joined: Sun, 16. Dec 18, 13:16
x4

Re: [MOD] Player Owned Warehouses

Post by LegionOfOne » Sun, 2. Jun 19, 17:47

nickolaiproblem wrote:
Sun, 14. Apr 19, 16:36
Does anyone know if main modder behind this is still working on this project?

Doesn't look that way at first glance, but I still use the mod in 2.5 without trouble.

nickolaiproblem
Posts: 246
Joined: Mon, 5. Nov 18, 23:12
x4

Re: [MOD] Player Owned Warehouses

Post by nickolaiproblem » Mon, 3. Jun 19, 01:19

LegionOfOne wrote:
Sun, 2. Jun 19, 17:47
nickolaiproblem wrote:
Sun, 14. Apr 19, 16:36
Does anyone know if main modder behind this is still working on this project?

Doesn't look that way at first glance, but I still use the mod in 2.5 without trouble.
That's a shame but glad it works in 2.5

LegionOfOne
Posts: 122
Joined: Sun, 16. Dec 18, 13:16
x4

Re: [MOD] Player Owned Warehouses

Post by LegionOfOne » Tue, 4. Jun 19, 13:47

nickolaiproblem wrote:
Mon, 3. Jun 19, 01:19
That's a shame but glad it works in 2.5
Don't despair. I'm not the mod's main creator, but I did add the UI changes to it, and I recently started to play and mod X4 again.
I'm trying to make a new version with ware groups, for ease of use.

If I manage it, I'll probably post it as a new mod, to give it visibility.
As it is, I'm not sure my version is used more often than the original, since it is hidden on page two of the thread.

It's a shame it won't work on the Steam workshop though, but mods have to be packaged there, so no UI mods.

Post Reply

Return to “X4: Foundations - Scripts and Modding”