Page 1 of 4

[MOD 0.11.22] Galactic Trade Mod

Posted: Sun May 24, 2015 6:23 am
by coopmaster
Type: Mod
Name: Galactic Trade
Description: Adds the ability to buy and sell items. This version is no longer supported, go here for the latest versions.
License: MIT
Version: 0.4.1
Release: 2015-07-17
Tested-With-Factorio-Version: 0.11.22
Category: Item
Tags: Trading, Market
Download-Url: https://forums.factorio.com/forum/dow ... hp?id=4523
Website: archive of older versions (because I don't have a website yet)
License
Long description
Version history
media
Adding Support for Other Mods
Planned Features
Archive

Re: [MOD 0.11.22] Galactic Trade Mod [WIP]

Posted: Mon May 25, 2015 12:49 am
by Devildog
Sounds interesting!
Will give it a try.

Edit : I really like it.

Re: [MOD 0.11.22] Galactic Trade Mod [WIP]

Posted: Mon May 25, 2015 1:47 am
by coopmaster
Devildog wrote:Sounds interesting!
Will give it a try.
(look below for an update to this, I was actually mistaken about compatibility)
Sorry I can't respond to pm's since I'm new to the forums. To answer your question, I haven't tried to test it many mods. Anything that calls the events "ontick", "onbuiltentity", "onpreplayermineditem", "onentitydied", and "onguiclick" I don't think will work. So anything that has a gui, tries to update "per tick", or probably anything that tries to add special functionality to entities wont work. But mods that just add items and recipes will probably work. I will try to see if I can make my mod compatible with those other mods though. So, you might just need to do some trial and error with other mods, but I will post a new version if I find that I can make my mod compatible with them.

Re: [MOD 0.11.22] Galactic Trade Mod [WIP]

Posted: Mon May 25, 2015 1:56 am
by SHiRKiT
That's a great idea! And I'm sure you have thought about this, but prices should fluctuate based on demand/offer, but this can't be computed properly since there's only one person buying/selling. That's a hard problem to solve.

Re: [MOD 0.11.22] Galactic Trade Mod [WIP]

Posted: Mon May 25, 2015 2:20 am
by coopmaster
I actually take my last comment back, it seems things like testmode actually work. I had it installed but was looking at its code and must have accidently made some changes that caused it to not work. As far as I know it should work with most if not all mods.

Re: [MOD 0.11.22] Galactic Trade Mod [WIP]

Posted: Mon May 25, 2015 2:55 am
by L0771
I'm started with a mod like this, but my mod will calcule price automatically and every buy/sell changes the price.
Maybe I can help you with the code. ;)

Re: [MOD 0.11.22] Galactic Trade Mod [WIP]

Posted: Mon May 25, 2015 3:05 am
by coopmaster
SHiRKiT wrote:That's a great idea! And I'm sure you have thought about this, but prices should fluctuate based on demand/offer, but this can't be computed properly since there's only one person buying/selling. That's a hard problem to solve.
What I was actually thinking was simulated factories that affect the economy. The idea was that over time there would be more factories and existing ones would get better. This means the prices could be based on supply and demand, the more factories there are for, let's say electronics, the cheaper electronics gets. I don't know how hard it would be to do this, or even if it would just lag out the game, but I'll try something like this.

Re: [MOD 0.11.22] Galactic Trade Mod [WIP]

Posted: Mon May 25, 2015 3:11 am
by coopmaster
L0771 wrote:I'm started with a mod like this, but my mod will calcule price automatically and every buy/sell changes the price.
Have you released it yet? I would be interested to see it. I have it planned to have a dynamic economy which will have prices that fluctuate depending on the items you buy along with simulated other factories, I just wanted to get the mod out there and get feedback early though. I knew that I wanted to calculate the prices automatically, but I knew that some prices needed to be higher and some needed to not be tradable. So instead of immediately making pricing automatic I decided to set prices manually for now. In the future I will look at setting the price based on their construction cost and a system of supply and demand, but I know that will take a lot of time to implement correctly.

Re: [MOD 0.11.22] Galactic Trade Mod [WIP]

Posted: Mon May 25, 2015 4:41 pm
by Xterminator
This looks really cool! I have wanted something like this in the game for a long time. Definitely continue improving it and adding features. :D I think I will do a mod spotlight on it if you don't mind, and considering doing a let's play series based around it. :D
Quick question, as I haven't actually used the mod yet. Are all the items in the game available to buy/sell? Primarily I am interested in if the Rocket Defense can be bought?

Thanks!

Re: [MOD 0.11.22] Galactic Trade Mod [WIP]

Posted: Mon May 25, 2015 6:45 pm
by coopmaster
Xterminator wrote:This looks really cool! I have wanted something like this in the game for a long time. Definitely continue improving it and adding features. :D I think I will do a mod spotlight on it if you don't mind, and considering doing a let's play series based around it. :D
Quick question, as I haven't actually used the mod yet. Are all the items in the game available to buy/sell? Primarily I am interested in if the Rocket Defense can be bought?

Thanks!
At this point not all items are able to be bought, I intentionally left out the rocket defense since it seemed very exploitable. If you wait a couple of days I will probably have a better version with the rocket defense included.

Re: [MOD 0.11.22] Galactic Trade Mod [WIP]

Posted: Tue May 26, 2015 1:29 am
by coopmaster
For anyone who is using the mod and is wondering why the price you get from selling stuff is wrong, its because I messed the selling code up. There will be an update to the mod tonight which will also include a gui for the selling trading chest.

Re: [MOD 0.11.22] Galactic Trade Mod [WIP]

Posted: Tue May 26, 2015 1:43 am
by Devildog
Yep Im hoping i can get it to work with version 0.11.12!
Ill add it into my series if i can get it to work well with it.

Re: [MOD 0.11.22] Galactic Trade Mod [WIP]

Posted: Tue May 26, 2015 3:10 am
by coopmaster
A new version has been posted with bug fixes and a new gui for the selling trading chest.

Re: [MOD 0.11.22] Galactic Trade Mod [WIP]

Posted: Tue May 26, 2015 4:42 pm
by Xterminator
coopmaster wrote:
Xterminator wrote:This looks really cool! I have wanted something like this in the game for a long time. Definitely continue improving it and adding features. :D I think I will do a mod spotlight on it if you don't mind, and considering doing a let's play series based around it. :D
Quick question, as I haven't actually used the mod yet. Are all the items in the game available to buy/sell? Primarily I am interested in if the Rocket Defense can be bought?

Thanks!
At this point not all items are able to be bought, I intentionally left out the rocket defense since it seemed very exploitable. If you wait a couple of days I will probably have a better version with the rocket defense included.
Alright that makes sense. Yeah I am fine with waiting a little bit if you are willing to add in the ability to buy Rocket Defense. :D Out of curiosity, what other items can you not buy/sell?
Again, great work and really looking to future updates!

Re: [MOD 0.11.22] Galactic Trade Mod [WIP]

Posted: Tue May 26, 2015 8:18 pm
by coopmaster
Xterminator wrote:
coopmaster wrote:
Xterminator wrote:This looks really cool! I have wanted something like this in the game for a long time. Definitely continue improving it and adding features. :D I think I will do a mod spotlight on it if you don't mind, and considering doing a let's play series based around it. :D
Quick question, as I haven't actually used the mod yet. Are all the items in the game available to buy/sell? Primarily I am interested in if the Rocket Defense can be bought?

Thanks!
At this point not all items are able to be bought, I intentionally left out the rocket defense since it seemed very exploitable. If you wait a couple of days I will probably have a better version with the rocket defense included.
Alright that makes sense. Yeah I am fine with waiting a little bit if you are willing to add in the ability to buy Rocket Defense. :D Out of curiosity, what other items can you not buy/sell?
Again, great work and really looking to future updates!
Right now basically most of the basic stuff, you can see on the buying trading chest screenshot what is in right now. In the next update everything will be tradable and be based on its crafting value. That update will be coming either today or tomorrow. I will also mess with trying to add labels to the items in the buying trading chest gui, but it might cause it to be a little big. I will have to blacklist some things since they aren't supposed to be in the game, but rocket defense will definitely be tradable.

Re: [MOD 0.11.22] Galactic Trade Mod [WIP]

Posted: Sat May 30, 2015 4:13 am
by kingarthur
coopmaster wrote:
SHiRKiT wrote:That's a great idea! And I'm sure you have thought about this, but prices should fluctuate based on demand/offer, but this can't be computed properly since there's only one person buying/selling. That's a hard problem to solve.
What I was actually thinking was simulated factories that affect the economy. The idea was that over time there would be more factories and existing ones would get better. This means the prices could be based on supply and demand, the more factories there are for, let's say electronics, the cheaper electronics gets. I don't know how hard it would be to do this, or even if it would just lag out the game, but I'll try something like this.
im not very good with coding in lua, but i was thinking something that might be interesting would be if instead of simulating factory's it could connect to a database that could be online and then actual factory's could give and take from the market. it could be set up with only small groups connected to their own database or everybody that uses the mod could connect to a single database that could update every so often with changes. i know how to setup a database and the scripts needed to do all the math in mysql. i dont know how hard it would be to connect lua to it.i found an api called luasql (http://keplerproject.github.io/luasql/d ... anual.html) idk if that would help

Re: [MOD 0.11.22] Galactic Trade Mod [WIP]

Posted: Tue Jun 02, 2015 8:52 pm
by coopmaster
kingarthur wrote:
coopmaster wrote:
SHiRKiT wrote:That's a great idea! And I'm sure you have thought about this, but prices should fluctuate based on demand/offer, but this can't be computed properly since there's only one person buying/selling. That's a hard problem to solve.
What I was actually thinking was simulated factories that affect the economy. The idea was that over time there would be more factories and existing ones would get better. This means the prices could be based on supply and demand, the more factories there are for, let's say electronics, the cheaper electronics gets. I don't know how hard it would be to do this, or even if it would just lag out the game, but I'll try something like this.
im not very good with coding in lua, but i was thinking something that might be interesting would be if instead of simulating factory's it could connect to a database that could be online and then actual factory's could give and take from the market. it could be set up with only small groups connected to their own database or everybody that uses the mod could connect to a single database that could update every so often with changes. i know how to setup a database and the scripts needed to do all the math in mysql. i dont know how hard it would be to connect lua to it.i found an api called luasql (http://keplerproject.github.io/luasql/d ... anual.html) idk if that would help
Sorry its taken me so long for a response, I've been thinking about your idea for a while now. I don't think it is possible for me to add the ability to get market prices from an external server since the game doesn't have the api for it (as far as I know). I would like to have a library that would add that functionality, but I don't think that is possible with factorio. Maybe it is and someone can help me with it, but for now I would like to get my ideas for the mod done and then I will look more into it later. Later in a future version, though, I will be making the mod multiplayer compatible. That will at least make it to where other people in the same game will have an impact on the market values.

Re: [MOD 0.11.22] Galactic Trade Mod [WIP]

Posted: Wed Jun 03, 2015 4:15 pm
by Syriusz
Hi, i like this mod, and I wanted to implement it to NAR mod, but it could not work with some items (like blue and purple science, processing unit). I think, it have something to do with some resources, I added all ore and even some "free" (recipe with 0 ingredients) resources for while.
This is what i added in config:
config
Maybe there is a limit for how many items it can show? (I had 216 with NEAR)

Re: [MOD 0.11.22] Galactic Trade Mod [WIP]

Posted: Wed Jun 03, 2015 7:57 pm
by coopmaster
Syriusz wrote:Hi, i like this mod, and I wanted to implement it to NEAR mod, but it could not work with some items (like blue and purple science, processing unit). I think, it have something to do with some resources, I added all ore and even some "free" (recipe with 0 ingredients) resources for while.
This is what i added in config:
config
Maybe there is a limit for how many items it can show? (I had 216 with NEAR)
If you can post a link to the mod, I can figure out why it isn't working.

Re: [MOD 0.11.22] Galactic Trade Mod [WIP]

Posted: Wed Jun 03, 2015 8:23 pm
by Syriusz