By anything involving "dedicated servers" here, I mean TheNet:IsDedicated() returning true.
In brokentool.lua:
local function fn() local inst = CreateEntity() inst.entity:AddTransform() inst.entity:AddNetwork() --Delay one frame so that we are positioned properly before starting the effect --or in case we are about to be removed inst:DoTaskInTime(0, PlayBrokenAnim) inst.entity:SetPristine() if not TheWorld.ismastersim then return inst end inst.persists = false inst:DoTaskInTime(1, inst.Remove) return inst end
PlayBrokenAnim is scheduled even in dedicated servers.
Is this intended because the non-networked entity created by said function calls MakeInventoryPhysics(inst) and there might be a physics interaction because of it? If that would even happen, since I don't think inventory physics can even affect other things? Or is it an oversight?
On a much bigger note though, in wx78_big_spark.lua:
local function fn() local inst = CreateEntity() inst.entity:AddTransform() inst.entity:AddNetwork() inst:AddTag("FX") if not TheNet:IsDedicated() then inst:DoTaskInTime(0, StartFX) end inst.entity:SetPristine() if not TheWorld.ismastersim then return inst end inst.persists = false inst:DoTaskInTime(1, inst.Remove) inst.AlignToTarget = AlignToTarget return inst end
StartFX isn't scheduled on dedicated servers. This is not good because the FX actually produces a significant amount of light, which can affect gameplay (like by warding off Charlie during the night). It won't do anything if the server is dedicated, but it will work as expected in client hosted servers in comparison.
That dedicated check simply needs to get removed, there's no need to network the local entity because the behavior is consistent (though it's up to you of course), but it has to spawn even on dedicated servers.
Lastly, StartFX already has a check to not use a sound emitter in dedicated servers, which is good. I think that could be further extended to avoid giving the local FX an AnimState too, after all, it won't be seen at all in dedicated server instances and there's no logic affecting it or relying on it (unless it can affect the .Light behavior through C, not sure).
Nothing to add here about brokentool, but regarding wx78_big_spark:
- Host a server with caves or a proper dedicated server.
- Spawn the effect when playing as WX78 (by taking wetness damage, being frozen, etc) or through a console command.
- Notice how the light has no effect on warding off Charlie, because it's only there for clients.
- Repeat the steps on a server without caves.
- Notice how the light will work as expected.
There are no comments to display.
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