Is it possible to execute a lua script in a freeplay without editing the freeplay.lua?
For example the unlimited ammo mod from the mod-manager thread has its own lua file:
Code: Select all
InfiniteAmmoMod = {}
function InfiniteAmmoMod.onTick()
if game.getplayer().getitemcount("basic-bullet-magazine") < 2 then
game.getplayer().insert{name="basic-bullet-magazine", count=1}
end
end
InfiniteAmmoMod.onTick() in the freeplay.lua
Reason why i ask is that i dont want to change the vanilla files. also if you want to add more than one mod that both changing the freeplay.lua, you have to edit the file by hand so both mods will work correctly.
A solution so far to bypass the vanilla- editing problem i can see is to start a new freeplay, save it and then overwrite the control.lua in the save with the mod script, but that doesnt solve the more then one mod problem.