Hi,
I'm looking at adding compatibility for a mod that adds other ores (specifically IR3). I was trying to use UpdateTemplate, but it doesn't actually seem to do anything. I think I found the issue though. Happy to make a pull request if you have a Github or anything.
-- control_planets.lua
function planets.UpdateTemplate(tbl) -- update a template in the global table
if(not global.templates[tbl.key])then error("Tried to update a template that doesnt exist! : " .. tostring(tbl.key)) end
table.deepmerge(planets.templates[tbl.key],tbl) events.vraise("on_template_updated",{template=tbl}) -- this line should be global.templates, not planets.templates
end
For context, I'm adding compatibility by removing the "nauvis" modifier on most of the planets. I think most people that have done this by changing the code, but we intend to play multiplayer with it, so easiest to do on the mod side.
Thanks!