[MOD 0.12.X] Galactic Trade

Topics and discussion about specific mods
coopmaster
Fast Inserter
Fast Inserter
Posts: 109
Joined: Mon May 18, 2015 1:12 am
Contact:

Re: [0.12]Galactic Trade

Post by coopmaster »

darkshadow1809 wrote:FreekillX1Alpha wrote:
Found a bug with the Galatic Trade mod, when opening a buying chest i get the error:
Error while running the event handler: __GalacticTrade__/prototypes/scripts/trading-chest.lua:397: Unknown style gas-canister_gt_button_style

The game then crashes to the main menu.

Using mod pack 0-0-1 for 0.12 (single player version).

Factorio Build 103; Windows 64 bit

update: upon further inspection i find that there is another window that opens behind the main window; cannot copy the text so ill try and write it out manually:
Error when running the event handler: __GalacticTrade__/control.lua.394: bad argument #-1 to get_localised_tem_name' string expected, got nil

Update 2: been trying to fix this myself, haven't yet but i have managed to change the error. If you set dytech to enabled in the galactic trade config file, you get the error from my previous update (still in the back ground) and my original error is placed by: Error while running the event handler: __GalacticTrade__/control.lua:529: attempt to index field 'item_selection' (a nil value)
===============================================================================================================================================================

Hi there :) Someone reported this to me when hes using my modpack :) Could you look into it? Thanks!

Now i read in a bit about the mod compatibility fix.. But I don't think thats related to this o.o

If I am stupid and you already fixed it please tell me so xD haha. Sorry I've been crazy busy getting things ready for 0.12

Link to modpack: https://forums.factorio.com/forum/vie ... 60&t=13591 DL for all mods that are in there that may cause an issue with your mod :p Sorry I haven't done the credits section yet since I am still hourly removing/adding mods to make it work together.
the steps for compatibility should fix this. Make sure that the styles.lua is copied into all of the other mod folders and you edit their data.lua. The problem is that the button style can only be created if it knows of all of the items, and it can only be done when the mods are loading when you first start factorio. Since my mod doesn't always load last (and it's hard to tell which one loads last) it is needed to put it in all other mod folders that contain added items. So whatever mod has gas canisters, that mod needs to have the steps done to it. If for some reason this doesn't help, just tell me but there was another person who had the same series of errors that it fixed it for.
Creator of the Galactic Trade mod
coopmaster
Fast Inserter
Fast Inserter
Posts: 109
Joined: Mon May 18, 2015 1:12 am
Contact:

Re: [0.12]Galactic Trade

Post by coopmaster »

ssilk wrote:Moved thread to convenience, I think this is not just a new item. :)
ok thanks!
Creator of the Galactic Trade mod
starxplor
Fast Inserter
Fast Inserter
Posts: 164
Joined: Sun May 18, 2014 11:25 pm
Contact:

Re: [0.12]Galactic Trade

Post by starxplor »

At first, I did not realize the steps needed for 'compatibility', and when I used the selling chest, it sold wood(logs from cutting trees) just fine. After I went through and updated all of the mods I have, the initial trade value I had stored was erased, and now wood seems to have no value and doesn't get sold. I have not touched anything in the GT zip file, only copied out the styles.lua and edit other mods' data.lua files.

Where are all the regular items' values defined and are there any known issues with items being removed that were available to sell previously?
MrSilver2510
Burner Inserter
Burner Inserter
Posts: 5
Joined: Sat Jul 25, 2015 9:59 am
Contact:

Re: [0.12]Galactic Trade

Post by MrSilver2510 »

Hi there!

I have same problems:
Shanix wrote:Anyone else having an error when opening the Buy Chest? I get an error that game.get_localised_item_name(gt_glob.buyingtradingchests_itemselected[item_index]) is a nil value when opening, and when closing I get an error saying game.player.gui.left.item_selection.destroy() is a nil value as well. Lines 394 and 529 respectively in control.lua.
Shanix wrote:[...] and now the only error is every time I load my save, I lose all credits and have to place all of my chests again.
I tried your mod with my mods without compibilyty, then with it, then with fresh and clean 0.12 client.

Always the same on load geme - "lose all credits" and "broken chests". That's very sad.

Please, fix this problem, I realy enjoy the idea!
keyboardhack
Filter Inserter
Filter Inserter
Posts: 478
Joined: Sat Aug 23, 2014 11:43 pm
Contact:

Re: [0.12]Galactic Trade

Post by keyboardhack »

darkshadow1809 wrote:FreekillX1Alpha wrote:
Found a bug with the Galatic Trade mod, when opening a buying chest i get the error:
Error while running the event handler: __GalacticTrade__/prototypes/scripts/trading-chest.lua:397: Unknown style gas-canister_gt_button_style
coopmaster wrote:So the problem is that you need to follow the steps on the thread about making other mods compatible with my mod,
1. go to galactic trade mod folder
2. copy styles.lua
3. go to mod you want to add support with (if it has extra items)
4. paste the styles.lua file
5. edit data.lua with a text editor
6. add

Code: Select all

require("styles")
to the end of the file
7. if it has any raw resources (resources that don't have crafting recipes, but are available) go back to galactic trade mod folder (otherwise you are done!)
8. make sure the mod isn't already supported (look below)
8. edit the config.lua file with a text editor
9. look for the line "--add raw resource values here (items which don't have crafting recipes) with their values, see examples below"
10. look at examples and make sure you know what the item name is inside the mod's files, it would look something like "iron-plate"
(there are also some mods which already have support, all you need to do is remove the --[[ and --]] that surrounds the mod you want support for)
11. put the new line in and if it is smelted then also look slightly lower down (it also has instructions)
12. if you have done all of those steps then the items from the mod should show up in the buying trading chest with the correct credit values
13. if you want to help others not do steps 7-12, post to the forum thread and tell me the mod it was, and the lines you added to the files.
Coopmaster you should also be able to fix the bug by renaming data.lua to data-final-fixes.lua. This makes sure that your mod makes styles after all other mods have made their entities.
Waste of bytes : P
Shanix
Inserter
Inserter
Posts: 21
Joined: Tue May 26, 2015 12:52 am
Contact:

Re: [0.12]Galactic Trade

Post by Shanix »

starxplor wrote:At first, I did not realize the steps needed for 'compatibility', and when I used the selling chest, it sold wood(logs from cutting trees) just fine. After I went through and updated all of the mods I have, the initial trade value I had stored was erased, and now wood seems to have no value and doesn't get sold. I have not touched anything in the GT zip file, only copied out the styles.lua and edit other mods' data.lua files.

Where are all the regular items' values defined and are there any known issues with items being removed that were available to sell previously?
This is an error apparently other people are having.
MrSilver2510 wrote:Always the same on load geme - "lose all credits" and "broken chests". That's very sad.

Please, fix this problem, I realy enjoy the idea!
My temporary solution is to store all my selling in liquid assets. So every time the ship comes, I make like 180k credits. And I've got a buy chest set up to buy 180k Alien Artifacts and ship those off into my system. IT's a temporary solution until the save bug is fixed.
coopmaster
Fast Inserter
Fast Inserter
Posts: 109
Joined: Mon May 18, 2015 1:12 am
Contact:

Re: [0.12]Galactic Trade

Post by coopmaster »

keyboardhack wrote:
darkshadow1809 wrote:FreekillX1Alpha wrote:
Found a bug with the Galatic Trade mod, when opening a buying chest i get the error:
Error while running the event handler: __GalacticTrade__/prototypes/scripts/trading-chest.lua:397: Unknown style gas-canister_gt_button_style
coopmaster wrote:So the problem is that you need to follow the steps on the thread about making other mods compatible with my mod,
1. go to galactic trade mod folder
2. copy styles.lua
3. go to mod you want to add support with (if it has extra items)
4. paste the styles.lua file
5. edit data.lua with a text editor
6. add

Code: Select all

require("styles")
to the end of the file
7. if it has any raw resources (resources that don't have crafting recipes, but are available) go back to galactic trade mod folder (otherwise you are done!)
8. make sure the mod isn't already supported (look below)
8. edit the config.lua file with a text editor
9. look for the line "--add raw resource values here (items which don't have crafting recipes) with their values, see examples below"
10. look at examples and make sure you know what the item name is inside the mod's files, it would look something like "iron-plate"
(there are also some mods which already have support, all you need to do is remove the --[[ and --]] that surrounds the mod you want support for)
11. put the new line in and if it is smelted then also look slightly lower down (it also has instructions)
12. if you have done all of those steps then the items from the mod should show up in the buying trading chest with the correct credit values
13. if you want to help others not do steps 7-12, post to the forum thread and tell me the mod it was, and the lines you added to the files.
Coopmaster you should also be able to fix the bug by renaming data.lua to data-final-fixes.lua. This makes sure that your mod makes styles after all other mods have made their entities.

Oh, wow I didn't know about that. Thanks a lot, I'll implement that in the next version.
Creator of the Galactic Trade mod
coopmaster
Fast Inserter
Fast Inserter
Posts: 109
Joined: Mon May 18, 2015 1:12 am
Contact:

Re: [0.12]Galactic Trade

Post by coopmaster »

starxplor wrote:At first, I did not realize the steps needed for 'compatibility', and when I used the selling chest, it sold wood(logs from cutting trees) just fine. After I went through and updated all of the mods I have, the initial trade value I had stored was erased, and now wood seems to have no value and doesn't get sold. I have not touched anything in the GT zip file, only copied out the styles.lua and edit other mods' data.lua files.

Where are all the regular items' values defined and are there any known issues with items being removed that were available to sell previously?
I don't know why it is doing that, but you can try these steps:

EDIT* : I forgot that I actually put an option in the config.lua that reloads the items every time that it loads, so just turn

Code: Select all

gt_glob.gt_reload_item_values_on_load = false
to

Code: Select all

gt_glob.gt_reload_item_values_on_load = true
if that doesn't work, do the steps below. Also after it loads once, you might want to disable it again since it takes more processing power after every load (although it does it over time, but could cause errors when looking in chests after loading immediately). With this option on, make sure you give it time to load the values before opening a chest (just make sure that the loading bar finishes).

1. disable my mod
2. load the save (should prompt you that a mod was removed and if you placed any trading chest they should get removed)
3. save the game
4. if you lost credits you can edit the config.lua in my mod folder to give yourself some starting credits.
5. re-enable the mod and load the save

I hope these steps fix it, if it doesn't let me know.
Last edited by coopmaster on Sat Jul 25, 2015 11:01 pm, edited 2 times in total.
Creator of the Galactic Trade mod
Shanix
Inserter
Inserter
Posts: 21
Joined: Tue May 26, 2015 12:52 am
Contact:

Re: [0.12]Galactic Trade

Post by Shanix »

coopmaster wrote:
keyboardhack wrote: Coopmaster you should also be able to fix the bug by renaming data.lua to data-final-fixes.lua. This makes sure that your mod makes styles after all other mods have made their entities.

Oh, wow I didn't know about that. Thanks a lot, I'll implement that in the next version.
Just a note on this, if you have a world already using Galactic Trade then change data to data-final-fixes, it might cause the save file to be unreadable.
coopmaster
Fast Inserter
Fast Inserter
Posts: 109
Joined: Mon May 18, 2015 1:12 am
Contact:

Re: [0.12]Galactic Trade

Post by coopmaster »

Shanix wrote:
coopmaster wrote:
keyboardhack wrote: Coopmaster you should also be able to fix the bug by renaming data.lua to data-final-fixes.lua. This makes sure that your mod makes styles after all other mods have made their entities.

Oh, wow I didn't know about that. Thanks a lot, I'll implement that in the next version.
Just a note on this, if you have a world already using Galactic Trade then change data to data-final-fixes, it might cause the save file to be unreadable.
I'm doing some testing with it right now and it seems to be working with older saves, do you have any more details of when this might happen?
Creator of the Galactic Trade mod
Shanix
Inserter
Inserter
Posts: 21
Joined: Tue May 26, 2015 12:52 am
Contact:

Re: [0.12]Galactic Trade

Post by Shanix »

coopmaster wrote:
Shanix wrote:
coopmaster wrote:
keyboardhack wrote: Coopmaster you should also be able to fix the bug by renaming data.lua to data-final-fixes.lua. This makes sure that your mod makes styles after all other mods have made their entities.

Oh, wow I didn't know about that. Thanks a lot, I'll implement that in the next version.
Just a note on this, if you have a world already using Galactic Trade then change data to data-final-fixes, it might cause the save file to be unreadable.
I'm doing some testing with it right now and it seems to be working with older saves, do you have any more details of when this might happen?
It's pretty regular for me. data.lua works fine, save loads. data-final-fixes.lua won't load, the error says it is unreadable. Possibly based on how the mods are loaded in?

Might be based on how you process all the items to be loaded in?
mathew995
Manual Inserter
Manual Inserter
Posts: 3
Joined: Sun Jun 08, 2014 12:38 am
Contact:

Re: [0.12]Galactic Trade

Post by mathew995 »

It seems that every time I load my save both chests need to be picked up and placed again to function.
coopmaster
Fast Inserter
Fast Inserter
Posts: 109
Joined: Mon May 18, 2015 1:12 am
Contact:

Re: [0.12]Galactic Trade

Post by coopmaster »

Shanix wrote:
coopmaster wrote:
Shanix wrote:
coopmaster wrote:
keyboardhack wrote: Coopmaster you should also be able to fix the bug by renaming data.lua to data-final-fixes.lua. This makes sure that your mod makes styles after all other mods have made their entities.

Oh, wow I didn't know about that. Thanks a lot, I'll implement that in the next version.
Just a note on this, if you have a world already using Galactic Trade then change data to data-final-fixes, it might cause the save file to be unreadable.
I'm doing some testing with it right now and it seems to be working with older saves, do you have any more details of when this might happen?
It's pretty regular for me. data.lua works fine, save loads. data-final-fixes.lua won't load, the error says it is unreadable. Possibly based on how the mods are loaded in?

Might be based on how you process all the items to be loaded in?

I just posted a new version that implements this, if you could help me bug test it that would be great.
Creator of the Galactic Trade mod
coopmaster
Fast Inserter
Fast Inserter
Posts: 109
Joined: Mon May 18, 2015 1:12 am
Contact:

Re: [0.12]Galactic Trade

Post by coopmaster »

mathew995 wrote:It seems that every time I load my save both chests need to be picked up and placed again to function.
Do you have any mods enabled? Do you get any errors? are you playing on an old save? If you are playing with mods, have you tried disabling all other mods except for mine? if you are getting an error like the other people, you can probably just update my mod to the newest version and it should work.
Creator of the Galactic Trade mod
Shanix
Inserter
Inserter
Posts: 21
Joined: Tue May 26, 2015 12:52 am
Contact:

Re: [0.12]Galactic Trade

Post by Shanix »

coopmaster wrote:
Shanix wrote:It's pretty regular for me. data.lua works fine, save loads. data-final-fixes.lua won't load, the error says it is unreadable. Possibly based on how the mods are loaded in?
Might be based on how you process all the items to be loaded in?
I just posted a new version that implements this, if you could help me bug test it that would be great.
Loaded up, all mods except one have the old compatibility installed. The one mod that didn't, well, nope doesn't work. Also, the bug of the chests needed to be removed and placed again is still present.
coopmaster
Fast Inserter
Fast Inserter
Posts: 109
Joined: Mon May 18, 2015 1:12 am
Contact:

Re: [0.12]Galactic Trade

Post by coopmaster »

Shanix wrote:
coopmaster wrote:
Shanix wrote:It's pretty regular for me. data.lua works fine, save loads. data-final-fixes.lua won't load, the error says it is unreadable. Possibly based on how the mods are loaded in?
Might be based on how you process all the items to be loaded in?
I just posted a new version that implements this, if you could help me bug test it that would be great.
Loaded up, all mods except one have the old compatibility installed. The one mod that didn't, well, nope doesn't work. Also, the bug of the chests needed to be removed and placed again is still present.
What mod is it that isn't working? Also have you tried replacing all of the chests then saving? If it isn't detected when chests are placed down or for some reason it forgets about already placed chests it won't work. If you haven't tried a new save, if could you try and just run the command

Code: Select all

/c game.player.insert({name="trading-chest-buy", count=1})
and place the chest to see if you get any errors or if all the items show up. If not all the items are showing up, are you getting the message about not all items having values? It might just be you need to run through the steps if you are trying to get an old save to work:
coopmaster wrote:1. disable my mod
2. load the save (should prompt you that a mod was removed and if you placed any trading chest they should get removed)
3. save the game
4. if you lost credits you can edit the config.lua in my mod folder to give yourself some starting credits.
5. re-enable the mod and load the save
If this doesn't work, I will need as many details as you can give me.
Creator of the Galactic Trade mod
mathew995
Manual Inserter
Manual Inserter
Posts: 3
Joined: Sun Jun 08, 2014 12:38 am
Contact:

Re: [0.12]Galactic Trade

Post by mathew995 »

coopmaster wrote:
mathew995 wrote:It seems that every time I load my save both chests need to be picked up and placed again to function.
Do you have any mods enabled? Do you get any errors? are you playing on an old save? If you are playing with mods, have you tried disabling all other mods except for mine? if you are getting an error like the other people, you can probably just update my mod to the newest version and it should work.
It gives me no error they just don't work, and I have tried it with only your mod same thing.
Shanix
Inserter
Inserter
Posts: 21
Joined: Tue May 26, 2015 12:52 am
Contact:

Re: [0.12]Galactic Trade

Post by Shanix »

coopmaster wrote:
Shanix wrote:
coopmaster wrote:
Shanix wrote:It's pretty regular for me. data.lua works fine, save loads. data-final-fixes.lua won't load, the error says it is unreadable. Possibly based on how the mods are loaded in?
Might be based on how you process all the items to be loaded in?
I just posted a new version that implements this, if you could help me bug test it that would be great.
Loaded up, all mods except one have the old compatibility installed. The one mod that didn't, well, nope doesn't work. Also, the bug of the chests needed to be removed and placed again is still present.
What mod is it that isn't working? Also have you tried replacing all of the chests then saving? If it isn't detected when chests are placed down or for some reason it forgets about already placed chests it won't work. If you haven't tried a new save, if could you try and just run the command

Code: Select all

/c game.player.insert({name="trading-chest-buy", count=1})
and place the chest to see if you get any errors or if all the items show up. If not all the items are showing up, are you getting the message about not all items having values? It might just be you need to run through the steps if you are trying to get an old save to work:
coopmaster wrote:1. disable my mod
2. load the save (should prompt you that a mod was removed and if you placed any trading chest they should get removed)
3. save the game
4. if you lost credits you can edit the config.lua in my mod folder to give yourself some starting credits.
5. re-enable the mod and load the save
If this doesn't work, I will need as many details as you can give me.
  • Loading a save, replacing all chests, saving and loading does nothing.
  • Starting a new save does allow for the chests to be used, however on save/load it bugs out with the usual bad localised item name.
  • With your mod disabled, I'm unable to load a save - Unknown Modifier type "240"
What I'm going to do right now is run through all of my mods' locale files, make sure the names are correct, then run with your mod again. I'm almost positive that the issue is on load, it doesn't read some name right and goes funky. Here is my personal modpack, everything but Air Filtering has compatibility installed the old way.

EDIT: Would it be possible to ignore some mods?
coopmaster
Fast Inserter
Fast Inserter
Posts: 109
Joined: Mon May 18, 2015 1:12 am
Contact:

Re: [0.12]Galactic Trade

Post by coopmaster »

mathew995 wrote:
coopmaster wrote:
mathew995 wrote:It seems that every time I load my save both chests need to be picked up and placed again to function.
Do you have any mods enabled? Do you get any errors? are you playing on an old save? If you are playing with mods, have you tried disabling all other mods except for mine? if you are getting an error like the other people, you can probably just update my mod to the newest version and it should work.
It gives me no error they just don't work, and I have tried it with only your mod same thing.
What doesn't work? Is it that the gui doesn't show up? Does it not trade resources? Some more details would be helpful.
Creator of the Galactic Trade mod
coopmaster
Fast Inserter
Fast Inserter
Posts: 109
Joined: Mon May 18, 2015 1:12 am
Contact:

Re: [0.12]Galactic Trade

Post by coopmaster »

Shanix wrote:
coopmaster wrote:
Shanix wrote:
coopmaster wrote:
Shanix wrote:It's pretty regular for me. data.lua works fine, save loads. data-final-fixes.lua won't load, the error says it is unreadable. Possibly based on how the mods are loaded in?
Might be based on how you process all the items to be loaded in?
I just posted a new version that implements this, if you could help me bug test it that would be great.
Loaded up, all mods except one have the old compatibility installed. The one mod that didn't, well, nope doesn't work. Also, the bug of the chests needed to be removed and placed again is still present.
What mod is it that isn't working? Also have you tried replacing all of the chests then saving? If it isn't detected when chests are placed down or for some reason it forgets about already placed chests it won't work. If you haven't tried a new save, if could you try and just run the command

Code: Select all

/c game.player.insert({name="trading-chest-buy", count=1})
and place the chest to see if you get any errors or if all the items show up. If not all the items are showing up, are you getting the message about not all items having values? It might just be you need to run through the steps if you are trying to get an old save to work:
coopmaster wrote:1. disable my mod
2. load the save (should prompt you that a mod was removed and if you placed any trading chest they should get removed)
3. save the game
4. if you lost credits you can edit the config.lua in my mod folder to give yourself some starting credits.
5. re-enable the mod and load the save
If this doesn't work, I will need as many details as you can give me.
  • Loading a save, replacing all chests, saving and loading does nothing.
  • Starting a new save does allow for the chests to be used, however on save/load it bugs out with the usual bad localised item name.
  • With your mod disabled, I'm unable to load a save - Unknown Modifier type "240"
What I'm going to do right now is run through all of my mods' locale files, make sure the names are correct, then run with your mod again. I'm almost positive that the issue is on load, it doesn't read some name right and goes funky. Here is my personal modpack, everything but Air Filtering has compatibility installed the old way.

EDIT: Would it be possible to ignore some mods?
My mod shouldn't show an error if there is a missing localised name, it should just have a weird name when you click on it in the buying trading chest. Are you sure it's my mod? Could it be any other mod? I will try your mod pack later and see if I can figure it out but I don't think that those errors are coming from my mod. Again though I will check it out later and see if I can figure out what is wrong.
Creator of the Galactic Trade mod
Post Reply

Return to “Mods”