Jump to content

Desynchronize seasons and clock


Recommended Posts

https://steamcommunity.com/sharedfiles/filedetails/?id=1396615817 its not working after recent dst patch (outdated)

but i still need, so how can I change it? i trying to code change for working and get some confusing

change to AddComponentPostInit("clock", -> "shard_clock" ?

i wonder what code should I reference clock.lua or shard_clock 

 

in clock.lua 

local OnClockUpdate = _ismastersim and not _ismastershard and function(src, data)
    for i, v in ipairs(_segs) do
        v:set(data.segs[i])
    end
    _cycles:set(data.cycles)
    _phase:set(data.phase)
    _moonphase:set(data.moonphase)
    _mooniswaxing:set(data.mooniswaxing)
    _totaltimeinphase:set(data.totaltimeinphase)
    _remainingtimeinphase:set(data.remainingtimeinphase)
    self:LongUpdate(0)
end or nil

or in shard_clock

local OnClockDirty = not _ismastershard and function()
    local data =
    {
        segs = {},
        cycles = _cycles:value(),
        moonphase = _moonphase:value(),
        mooniswaxing = _mooniswaxing:value(),
        phase = _phase:value(),
        totaltimeinphase = _totaltimeinphase:value(),
        remainingtimeinphase = _remainingtimeinphase:value(),
    }
    for i, v in ipairs(_segs) do
        table.insert(data.segs, v:value())
    end
    _world:PushEvent("secondary_clockupdate", data)
end or nil

 

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
  • Create New...