I have been looking on the internet and forum, but couldn't find a solution for my problem.
For a mod I'm working on, I need to get te value of a modifier used in the base game.
I don't have to use it on a new entity, I just need to read the value (i.e. the bonus given in the mining-drill-productivity-bonus).
Can anyone tell me how to read this value to be usable in the mod?
using modifier values in a mod
- eradicator
- Smart Inserter
- Posts: 5207
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: using modifier values in a mod
LuaForce.mining_drill_productivity_bonus
https://lua-api.factorio.com/latest/LuaForce.html
https://lua-api.factorio.com/latest/LuaForce.html
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Re: using modifier values in a mod
Just tried this one, but it doesn't seem to work.eradicator wrote:LuaForce.mining_drill_productivity_bonus
https://lua-api.factorio.com/latest/LuaForce.html
The game throws an error: "attempt to index global 'LuaForce' (a nil value)"
So how can I read the value of the modifier to make use of it?
- eradicator
- Smart Inserter
- Posts: 5207
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: using modifier values in a mod
A "LuaForce" is what factorio internally calls a team. Technology is per team, so if you want to read that you'll have to know what team you want to read it for. If you're having problems with that you should post some code and describe what you're trying to do instead of what you think the solution is.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.