[Solved] Need help with data.lua

Place to get help with not working mods / modding interface.
Post Reply
ClayC
Inserter
Inserter
Posts: 24
Joined: Fri Nov 21, 2014 8:01 am
Contact:

[Solved] Need help with data.lua

Post by ClayC »

Hello everyone, I just started using lua scripting as I am a fan of DyTech mod and I did spend some days looking at their code etc and since the 0.12.0 was released the mod is not able to run on it so I was wondering to keep atleast 1 thing from the mod until they update the mod, which may take them a while since the mod is huge.

now I have to say that in the dytech mod I found this line
data.raw["player"]["player"].inventory_size = 100

and I intend to use this just to have something going on quickly and it should do what I want exactly. So I created a new folder named it "inventory-mod_0.1.1" and I created a file "info.json" with these contents

{
"name": "inventory-mod",
"version": "0.1.1",
"title": "Inventory Mod",
"author": "ClayC",
"contact": "http://www.factorio.com",
"homepage": "http://www.factorio.com",
"description": "Get a bigger inventory"
}

I created a control.lua and a data.lua and a prototypes folder which is empty as I saw this as a requirement on a tutorial I followed.
inside the control.lua I pasted the above mentioned line for the inventory size and I left the data.lua empty as I am not sure what to include.

I tried opening the game to see if the mod was recognized and it doesn't show up in the list, I also wasn't able to find any errors what-so-ever

What am I missing?
Any help and information is welcome,

Thanks,
ClayC
Last edited by ClayC on Thu Jul 30, 2015 12:35 pm, edited 1 time in total.

SirRichie
Fast Inserter
Fast Inserter
Posts: 244
Joined: Wed Feb 25, 2015 4:50 pm
Contact:

Re: Need help with data.lua

Post by SirRichie »

Any data.raw related changes (new recipies, items, changes to inventory size) need to go to data.lua (or it's variants).

control.lua is for reacting to game events (like... a chunk has been generated) and cannot modify data.raw values, as the game has already read them upon startup (so technically speaking, it can modify them, but without any effect).

orzelek
Smart Inserter
Smart Inserter
Posts: 3911
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: Need help with data.lua

Post by orzelek »

There is an inventory mod already that does just this.

It's here: https://forums.factorio.com/forum/vie ... =91&t=5891

ClayC
Inserter
Inserter
Posts: 24
Joined: Fri Nov 21, 2014 8:01 am
Contact:

Re: Need help with data.lua

Post by ClayC »

SirRichie wrote:Any data.raw related changes (new recipies, items, changes to inventory size) need to go to data.lua (or it's variants).

control.lua is for reacting to game events (like... a chunk has been generated) and cannot modify data.raw values, as the game has already read them upon startup (so technically speaking, it can modify them, but without any effect).
Then how is it achievable like what DyTech did? I am asking for learning purposes maybe I come up with some new ideas to add to the game who knows :D
orzelek wrote:There is an inventory mod already that does just this.

It's here: https://forums.factorio.com/forum/vie ... =91&t=5891
Thanks, I'll look at the way this was handled and learn from it as the inventory seems to be the easiest mode to do on this game :)

ClayC
Inserter
Inserter
Posts: 24
Joined: Fri Nov 21, 2014 8:01 am
Contact:

Re: Need help with data.lua

Post by ClayC »

I found the issue after uninstalling and re-installing the game and adding the mod files back in it worked like magic hehe, there was something wrong with my game, thanks to those that tried to help :)

Post Reply

Return to “Modding help”