Changing effect of modules in control.lua

Place to get help with not working mods / modding interface.
sensenmann
Burner Inserter
Burner Inserter
Posts: 13
Joined: Tue Feb 28, 2017 5:04 pm
Contact:

Changing effect of modules in control.lua

Post by sensenmann »

After trying for some while i wonder how it is possible to change the effect of modules while running the game, for example a module that gets stronger with the number of items manufactured. Or a module that gets stronger when enemies are killed.
daniel34
Global Moderator
Global Moderator
Posts: 2761
Joined: Thu Dec 25, 2014 7:30 am
Contact:

Re: Changing effect of modules in control.lua

Post by daniel34 »

The effect of modules is defined in the prototype, which can only be changed in data.lua.

What you can do is creating several identical modules except increasing productivity/speed/... in data.lua and then (invisible to the player) switch them out in control.lua to simulate that the module got better.
quick links: log file | graphical issues | wiki
sensenmann
Burner Inserter
Burner Inserter
Posts: 13
Joined: Tue Feb 28, 2017 5:04 pm
Contact:

Re: Changing effect of modules in control.lua

Post by sensenmann »

Thanks for the hint, but how do i get all the modules i want to switch out that are currently in existence?
Post Reply

Return to “Modding help”