How to access Vehicle acceleration power?
Posted: Sun Aug 01, 2021 2:50 am
I cannot get this anywhere. Lua entity, lua entity prototype, burner, burner prototype, nothing gives me ability to get information about what's vehicle acceleration power. I'm already looking for it for 4 hours, is it even possible? I'm losing my mind on how hard is to find such information, so I decided to ask isntead.
*thing* that I mean is Vehicle->Acceleration power in game UI, or data.raw['locomotive']['locomotive'].max_power in.. data.lua .
How do I get that information in control.lua? I cannot reach it.
I only know " game.entity_prototypes[locomotive.name] " this way of getting 'any' information about locomotive, but from my knowledge entity doesn't have anything that matches what I need.
I can't find any game.vehicle_prototypes[](?) or anything simmilar.
game.print(game.entity_prototypes[locomotive.type].max_energy_usage) returns 10'000, no matter what "type" of locomotive I enter. It doesn't have any sense, different locomotives should give different values, so it's for sure not value, that I was looking for.
I see this thing : https://wiki.factorio.com/Prototype/Locomotive in API, but I don't know how to access it from LuaTrain.get_something, or from LuaGameScript.get_something(name)
I found out that locomotive inherits from rolling stock, inheriting from vehicle, inheriting from entity with health inheriting from entity. So now I know a bit more.. Looking in "entity" was absolutely counter productive.
Ahh, I think it might be impossible, I will wait for answers and stop banging my head against wall, trying to find solution that might not exist.
*thing* that I mean is Vehicle->Acceleration power in game UI, or data.raw['locomotive']['locomotive'].max_power in.. data.lua .
How do I get that information in control.lua? I cannot reach it.
I only know " game.entity_prototypes[locomotive.name] " this way of getting 'any' information about locomotive, but from my knowledge entity doesn't have anything that matches what I need.
I can't find any game.vehicle_prototypes[](?) or anything simmilar.
game.print(game.entity_prototypes[locomotive.type].max_energy_usage) returns 10'000, no matter what "type" of locomotive I enter. It doesn't have any sense, different locomotives should give different values, so it's for sure not value, that I was looking for.
I see this thing : https://wiki.factorio.com/Prototype/Locomotive in API, but I don't know how to access it from LuaTrain.get_something, or from LuaGameScript.get_something(name)
I found out that locomotive inherits from rolling stock, inheriting from vehicle, inheriting from entity with health inheriting from entity. So now I know a bit more.. Looking in "entity" was absolutely counter productive.
Ahh, I think it might be impossible, I will wait for answers and stop banging my head against wall, trying to find solution that might not exist.