data raw ?
Posted: Mon Mar 07, 2016 10:41 pm
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...
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...