TobyKenobi Posted May 16, 2021 Share Posted May 16, 2021 I'd like to run some code every time the clock hits a new segment In clock.lua I found the event "clocksegschanged" local _world = TheWorld function self:OnUpdate(dt) ... _world:PushEvent("clocksegschanged", data) but I don't seem to be able to listen for it. This code never runs: function OnClockSegsChanged(inst) print("OnClockSegsChanged") end AddPlayerPostInit(function(inst) inst:ListenForEvent("clocksegschanged", OnClockSegsChanged) end) Am I doing something wrong, or is this event unavailable to mods? Link to comment Share on other sites More sharing options...
SHI_YE Posted May 17, 2021 Share Posted May 17, 2021 inst:ListenForEvent("clocksegschanged", OnClockSegsChanged, TheWorld) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now