Desblat Posted February 2, 2017 Share Posted February 2, 2017 I am trying to port my Thrist mod into DST and I am facing troubles doing it. The thing is - thirst rate shoud depend on temperature of player and also player should start to sweat, if he is overheating. I tried to do this using SendModRPCToServer. But for some reason they don't work as intended one RPC works, but other two do not: "Error decoding lua RPC sender". This code from thirst component sends RPC to server: Quote local modname = "Thirst-by-Desblat" function thirst:DoDec(dt, ignore_damage) SendModRPCToServer(MOD_RPC[modname]["thrist_current_temperature"]) -------- THIS RPC#1 WORKS if self.burning then if self.current <= 0 then SendModRPCToServer(MOD_RPC[modname]["thrist_damage"]) -------- THIS RPC#2 DOESN'T WORKS else self:DoDelta(self.burnrate*(-self:GetDelta()*dt), true) if self.current_temperature/100 > 0.55 then SendModRPCToServer(MOD_RPC[modname]["thrist_sweat"]) -------- THIS RPC#3 DOESN'T WORKS end end end Code from modmain that handles RPC sending: Quote AddModRPCHandler(modname, "thrist_current_temperature", function(player) -------- THIS RPC#1 WORKS local temp = player.components.temperature.current player.components.thirst.current_temperature = player.components.temperature.current print("=======---------setting Temp for.."..player.prefab.." to "..temp) end) AddModRPCHandler(modname, "thrist_sweat", function(player) -------- THIS RPC#2 DOESN'T WORKS print("=======------SWEATING---") player.components.moisture:DoDelta(0.3) player.components.temperature:DoDelta(-0.5) end) AddModRPCHandler(modname, "thrist_damage", function(player) -------- RPC#3 THIS DOESN'T WORKS print("=======------DAMAGE---") player.components.health:DoDelta(5) end) Strings from server_log.lua : Quote [00:01:58]: =======---------setting Temp for..wilson to 81.100858167332 -------------------------RPC#1 [00:01:58]: Error decoding lua RPC sender -------------------------RPC#2 [00:01:58]: Error decoding lua RPC sender -------------------------RPC#3 [00:01:59]: =======---------setting Temp for..wilson to 81.042467036682 [00:01:59]: Error decoding lua RPC sender [00:01:59]: Error decoding lua RPC sender [00:02:00]: =======---------setting Temp for..wilson to 80.264511033784 [00:02:00]: Error decoding lua RPC sender What am I doing wrong? How do I fix this? Thanks in advance. in addition code from modmain, that adds thirst component: Quote AddReplicableComponent("thirst") local function GiveThirst(inst) if inst.components.thirst == nil then inst:AddTag("thirst") inst:AddComponent("thirst") inst.maxthirst = GLOBAL.net_ushortint( inst.GUID, "thirstmax", "currentdirty") inst.currentthirst = GLOBAL.net_ushortint( inst.GUID, "thirstcurrent", "currentdirty") inst.penaltythirst = GLOBAL.net_float( inst.GUID, "thirstpenalty", "currentdirty") if not TheWorld.ismastersim then inst:ListenForEvent("currentdirty", function(inst) OnthirstDirty(inst) end) end end end AddPlayerPostInit(GiveThirst) Link to comment https://forums.kleientertainment.com/forums/topic/73770-net-problems-error-decoding-lua-rpc-sender-wtf/ Share on other sites More sharing options...
Quench Posted February 25, 2017 Share Posted February 25, 2017 (edited) [00:47:09]: Error decoding lua RPC sender [00:47:11]: Error decoding lua RPC sender [00:47:11]: Error decoding lua RPC sender [00:47:11]: Error decoding lua RPC sender [00:47:12]: Error decoding lua RPC sender [00:47:13]: 345========== THIRST doesn't exist [00:47:13]: 345========== THIRST doesn't exist [00:47:14]: Error decoding lua RPC sender [00:47:14]: Error decoding lua RPC sender [00:47:14]: Error decoding lua RPC sender [00:47:15]: Error decoding lua RPC sender [00:47:17]: Error decoding lua RPC sender [00:47:17]: Error decoding lua RPC sender [00:47:17]: 345========== THIRST doesn't exist I really wish this would have been resolved before being a public-launch mod. However, I fully support your efforts, because thirst should definitely be a game inclusion in my opinion. It's a crash upon anyone drinking from the bucket rather than the bottles. I have no idea if this helps at all, but it does happen even if this is the only mod running. I'm pretty sure buckets aren't supposed to be drunk from...but even so, it shouldn't be crashing us all. good luck. Edited February 25, 2017 by Quench Link to comment https://forums.kleientertainment.com/forums/topic/73770-net-problems-error-decoding-lua-rpc-sender-wtf/#findComment-873395 Share on other sites More sharing options...
flameleo11 Posted July 4, 2020 Share Posted July 4, 2020 i have same problem: always show error, never working AddModRPCHandler("AAABBBCCC", "fish", function(...) print(">>>>>>>>>>>AAABBBCCC", "fish", ...) end) SendModRPCToServer(MOD_RPC.AAABBBCCC.fish, 11, 22, 33) [08:32:52]: Error encoding lua RPC mod namespace Link to comment https://forums.kleientertainment.com/forums/topic/73770-net-problems-error-decoding-lua-rpc-sender-wtf/#findComment-1350835 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