how to change zoom_to_world_can_use_nightvision?

Place to get help with not working mods / modding interface.
Post Reply
palmic
Inserter
Inserter
Posts: 22
Joined: Fri Apr 21, 2017 2:44 pm
Contact:

how to change zoom_to_world_can_use_nightvision?

Post by palmic »

Hello,
i would like to create mod specifically to change zoom_to_world_can_use_nightvision=true however no success yet.

Could somebody help me figure out the context?
  • can i set it up in some callback in control.lua etc?
  • is it some game.utils. object?

User avatar
Silari
Filter Inserter
Filter Inserter
Posts: 490
Joined: Sat Jan 27, 2018 10:04 pm
Contact:

Re: how to change zoom_to_world_can_use_nightvision?

Post by Silari »

It's a constant stored in data.raw during the data phase. You need to modify it there. You can't change it in control.lua - that's the control phase and it can't modify constants/prototypes/other startup stuff.

Code: Select all

data.raw["utility-constants"].zoom_to_world_can_use_nightvision = true
in data.lua should work correctly.

You should read up on the stages and how they work: https://lua-api.factorio.com/latest/Data-Lifecycle.html

palmic
Inserter
Inserter
Posts: 22
Joined: Fri Apr 21, 2017 2:44 pm
Contact:

Re: how to change zoom_to_world_can_use_nightvision?

Post by palmic »

Thank you very much that was the missing piece i needed.
It just required a little change:

Code: Select all

data.raw["utility-constants"].default.zoom_to_world_can_use_nightvision = true
Have a nice day.

Post Reply

Return to “Modding help”