Read entity definition details in control.lua?
Posted: Fri Sep 16, 2016 6:31 pm
Is it possible to read details from entity definitions (from stock game/other mods) within control.lua?
Specifically, I'm trying to find out the range of radars placed on the map, so my mod can work correctly both with stock radars and modded ones with extended range.
From the stock game:
In control.lua, I've got access to both the name and type of the entity, so I know if it's a radar or not. However, I can't see a way of getting the other details. I also tried to see if I could access the data definitions directly (data.raw.entities.radar), but data isn't available in control.lua
Any suggestions?
Specifically, I'm trying to find out the range of radars placed on the map, so my mod can work correctly both with stock radars and modded ones with extended range.
From the stock game:
Code: Select all
{
type = "radar",
name = "radar",
...
max_distance_of_sector_revealed = 14,
max_distance_of_nearby_sector_revealed = 3,
Any suggestions?