Hi,
just a "stupid" question, because I do not completly understand how it works...
for example, if I want to change the running_speed of the player, I can add in a data.lua :
data.raw.player.player.running_speed = 2
but why can't I put this into a control.lua ?
How can I change the running_speed of my player in the control.lua ?
Is the only solution to create alternate characters predefined in data.lua and to swap from a slow char to a rapid char ?
But admitting that I want to change smootly this value ? Would it be possible (without creating hundredth of alternate characters ?).
I still cannot really figure out why, during the game, I cannot access/change some of the values defined in the protypes of the data.lua...
Infact prototypes in data.lua do not match classes available in control.lua and objects related to these classes ?
For example, there is a Player prototype, and also a LUAPlayer class, but they do not seem to match...
data raw ?
data raw ?
My mods on the Factorio Mod Portal
Re: data raw ?
Between data.lua and control.lua, there is a bunch of C++ magic. The developers don't want to expose this to lua, partly because it is a lot of work, and partly because it would hurt performance. We just have to accept that there are 2 different places we can mod stuff, and they don't work together.
The only ways to change running speed in control.lua are:
1. swap from a slow char to a rapid char
2. add more exoskeletons
You can post in Modding interface requests if you think another way is needed.
The only ways to change running speed in control.lua are:
1. swap from a slow char to a rapid char
2. add more exoskeletons
You can post in Modding interface requests if you think another way is needed.
Re: data raw ?
OK. So I accept it, but it's not always easy to find out if what you're looking for is in the lua classes or hidden in thr prototypes.DaveMcW wrote:Between data.lua and control.lua, there is a bunch of C++ magic. The developers don't want to expose this to lua, partly because it is a lot of work, and partly because it would hurt performance. We just have to accept that there are 2 different places we can mod stuff, and they don't work together.
My mods on the Factorio Mod Portal