Jump to content

Recommended Posts

I'm working on a client-only mod that is trying to observe a variable that is shared via net_tinybyte, specifically "weather._preciptype".

This is what I have:

AddPlayerPostInit(function(inst)
        inst:ListenForEvent("setowner", function(inst)
            if inst == GLOBAL.ThePlayer then

                inst:ListenForEvent("preciptypedirty", OnPrecipDirty)
                inst._preciptype = net_tinybyte(inst.GUID, "weather._preciptype", "preciptypedirty")
                inst.riftActive = inst._preciptype.value() == "acidrain"

                inst:DoTaskInTime(1, function(inst)
                    StartBiomeDetectionUpdate(inst)
                end)
            end
        end)
    end)

Calling net_tinybyte crashes my game, though, claiming that it's nil.

How do I use this for a client mod?

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
×
  • Create New...