emrextreme Posted April 14, 2024 Share Posted April 14, 2024 Quote local _G = GLOBAL local TUNING = _G.TUNING local APPI = AddPrefabPostInit APPI("world", function(world) world:ListenForEvent("fullmoon", function() print("full moon, setting leif chances to 1/5") local LEIF_MIN_DAY = TUNING.LEIF_MIN_DAY local LEIF_PERCENT_CHANCE = TUNING.LEIF_PERCENT_CHANCE TUNING.LEIF_MIN_DAY = 0 TUNING.LEIF_PERCENT_CHANCE = 1/5 local function clocktick() local clock = _G.GetClock() if clock:IsNight() and clock:GetMoonPhase() == "full" then return end print("exiting full moon, setting leif chances back") TUNING.LEIF_MIN_DAY = LEIF_MIN_DAY TUNING.LEIF_PERCENT_CHANCE = LEIF_PERCENT_CHANCE world:RemoveEventCallback("clocktick", clocktick) end world:ListenForEvent("clocktick", clocktick) end) end) Why does the game says it's out of date? Link to comment https://forums.kleientertainment.com/forums/topic/155613-would-this-code-work-for-modding/ Share on other sites More sharing options...
_zwb Posted April 15, 2024 Share Posted April 15, 2024 The out of date warning is only related to the API version in modinfo. Put this line in your modinfo.lua and it'll be fine: api_version = 6 Link to comment https://forums.kleientertainment.com/forums/topic/155613-would-this-code-work-for-modding/#findComment-1710349 Share on other sites More sharing options...
emrextreme Posted April 15, 2024 Author Share Posted April 15, 2024 Thank you that did fix the out of date problem, sadly the mod didn't work. It couldn't even be enabled. Link to comment https://forums.kleientertainment.com/forums/topic/155613-would-this-code-work-for-modding/#findComment-1710368 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.
Please be aware that the content of this thread may be outdated and no longer applicable.