i'm the creator of the mod "wave defense unlimited"
in the last version, i changed it so that the scenario is executed by the mod files instead of the scenario files.
the reason for this was to make it easier to update the mod (before you had to update the control.lua in the savegame, which was a terrible solution)
is it somehow possible to check if a scenario is running or what the ways of transferring data between the scenario and the mod exist?
i tried using a remote interface but that just results in multiplayer problems, at least the way how i did it.
i would even take a solution that doesn't let you migrate existing savegames, but i don't know how i detect a scenario without a remote interface.
https://mods.factorio.com/mod/Wave_Defense_Unlimited
right now i'm pretty much out of ideas.
i would really appreciate your help.
detect if scenario is running / scenario data lifecycle?
detect if scenario is running / scenario data lifecycle?
creator of 55 mods
My api requests/suggestions: ui relative for overlay||Grenade arc||Player Modifiers||textbox::selection||Singleplayer RCON||disable car's ground sounds
My api requests/suggestions: ui relative for overlay||Grenade arc||Player Modifiers||textbox::selection||Singleplayer RCON||disable car's ground sounds
Re: detect if scenario is running / scenario data lifecycle?
Remote interfaces can be defined and called anywhere. Mod files, scenario files, even the console.
You will have to do one more manual save edit to add the interface for exporting though.
control.lua (scenario)
control.lua (mod)
Remember that global can only be accessed inside script events. And global is the only table you should use for storing data.
You will have to do one more manual save edit to add the interface for exporting though.
control.lua (scenario)
Code: Select all
remote.add_interface("scenario files", {
export_global_data = function() return global end,
})
Code: Select all
script.on_init(function()
if remote.interfaces["scenario files"] then
global = remote.call("scenario files", "export_global_data")
end
end)
Re: detect if scenario is running / scenario data lifecycle?
i think i got it now.
it even seems to migrate (after updating the control.lua)
wanna take a look and tell me what you think?
i didn't entirely knew what i was doing
the data lifecycle is pretty messy now.
at least it works i guess..
it even seems to migrate (after updating the control.lua)
wanna take a look and tell me what you think?
i didn't entirely knew what i was doing
the data lifecycle is pretty messy now.
at least it works i guess..
creator of 55 mods
My api requests/suggestions: ui relative for overlay||Grenade arc||Player Modifiers||textbox::selection||Singleplayer RCON||disable car's ground sounds
My api requests/suggestions: ui relative for overlay||Grenade arc||Player Modifiers||textbox::selection||Singleplayer RCON||disable car's ground sounds

