-
Content Count
59 -
Joined
-
Last visited
Community Reputation
3 NeutralAbout MrDoge124
-
Rank
Junior Member
Recent Profile Visitors
701 profile views
-
My code doesn't work when caves are enabled.
MrDoge124 replied to MrDoge124's topic in [Don't Starve Together] Mods and Tools
I got it to work. I asked a friend and we fixed it. So while poking around at another character, we discovered differences in the code that allowed us to reverse engineer a solution. With the error message telling us that “Inst” was a null value. Initially we thought that Inst was always in reference to the player whenever it’s called. THIS IS NOT THE CASE. We then found that whenever we declared a function, "Inst" was not declared. AddModRPCHandler(“Green”,"GREEN_STUN", function(---INST IS MISSING HERE---) We changed “Inst” to “player” just to make the code more readable in the future and then changed any reference to Inst into player. In addition to this, several functions were missing declarations which we fixed by adding player. AddModRPCHandler(“Green”,"GREEN_STUN", function(player) Thanks for the help! -
My code doesn't work when caves are enabled.
MrDoge124 replied to MrDoge124's topic in [Don't Starve Together] Mods and Tools
I've tried to add RPC handlers to the code but it doesn't work, I'm not sure what I'm doing. I've found this error in the code. -
My code doesn't work when caves are enabled.
MrDoge124 replied to MrDoge124's topic in [Don't Starve Together] Mods and Tools
I've seen mods use those before but I'm not sure how I'd set one up for myself. -
In this previous post I managed to get a AOE stun attack working. However when I enable caves it doesn't work. Turns out I think I'm missing something. It might be an action handler or some sort of net code which could be why it doesn't work when caves are enabled. It also doesn't crash or print anything to the logs, So I'm not sure why it isn't working. This is the code. It's all contained inside a character lua file. Any help would be appreciated.
-
When I enable caves it does nothing, no errors. Nothing is printed even if I tell it to print something. I think something isn't being triggered properly. My best guess is the "TheInput:AddKeyDownHandler(KEY_Z, function()" part isn't working right as nothing happens when I press Z. I might have to add an action for the attack, but I'm not sure how that works. I've found an example where actions are used and it seems to work fine.
-
I think I'm missing something, because I get this error when I press the key [00:01:43]: [string "../mods/Green/modmain.lua"]:198: attempt to index local 'instToBuff' (a nil value) LUA ERROR stack traceback: ../mods/Green/modmain.lua:198 in (upvalue) ApplyBuff (Lua) <194-234> buffData = table: 4B41C1D0 instToBuff = nil buffUniqueName = stunbuff ../mods/Green/modmain.lua:273 in (field) fn (Lua) <272-274> scripts/events.lua:46 in (method) HandleEvent (Lua) <42-49> self = events = table: 29B1A1C0 event = 122 arg = nil handlers = table: 4B41C2C0 k = table: 4B41C270 v = true scripts/input.lua:187 in (method) OnRawKey (Lua) <184-191> self = onkeyup = table: 29B1A3F0 entitiesundermouse = table: 8E1BCF40 onmousebutton = table: 29B19F40 controllerid_cached = 0 onkey = table: 29B1A3C8 enabledebugtoggle = true ongesture = table: 29B1A418 mouse_enabled = true ontextinput = table: 29B1A648 position = table: 29B1A760 onkeydown = table: 29B1A198 oncontrol = table: 29B1A8C8 key = 122 down = true scripts/input.lua:396 in () ? (Lua) <395-397> key = 122 is_up = true [00:01:43]: [string "../mods/Green/modmain.lua"]:198: attempt to index local 'instToBuff' (a nil value) LUA ERROR stack traceback: ../mods/Green/modmain.lua:198 in (upvalue) ApplyBuff (Lua) <194-234> ../mods/Green/modmain.lua:273 in (field) fn (Lua) <272-274> scripts/events.lua:46 in (method) HandleEvent (Lua) <42-49> scripts/input.lua:187 in (method) OnRawKey (Lua) <184-191> scripts/input.lua:396 in () ? (Lua) <395-397> I think I'm just being stupid here, but I'm not sure what is wrong.