• Content Count

  • Joined

  • Last visited

 Content Type 




Klei Bug Tracker

Game Updates

Hot Lava Bug Reporter

Everything posted by MrDoge124

  1. That's a very intresting set up. Never seen that before. So this means I could make a wall that's scary to prey so the butterflies get stuck. But I'm not sure this would stop all flying creatures, only flying prey or regular prey.
  2. I didn't know that. So if I trapped a bat in walls would it be possible to make a new type of wall they can't fly over?
  3. Hello, I was thinking about making walls that flying things can't fly over. Does anyone know how I could do this or have any suggestions on what I could do?
  4. 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!
  5. 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.
  6. I've seen mods use those before but I'm not sure how I'd set one up for myself.
  7. 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.
  8. I've looked at other examples and they all seem to use an action handler. I'm going to have to look into this and either figure out how these things work or try to find another way to do it.
  9. 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.
  10. I'm not sure what to do. I've looked at other aoe attacks and they seem to have stuff like "SendRPCToServer" and the code mentions actions. I've attached the code I'm using right now if you need it. green.lua
  11. Sorry to bother you but it doesn't seem to work when I enable caves. I think this might be because I don't have any networking code and I have no idea how to do that... Any help would be appreciated.
  12. Ok I got it to work with some help from a friend. Here is the code Also the keyhandler.lua which goes in a components folder in scripts. Thank you for the help! I'm sorry if i was being a pain.
  13. So I got it to find other things and the basics work Here is what I did to get it to work. (It probably isn't very efficient.) I'm not sure how to get cool downs to work and the effects to the character. (Turning off the light and the sanity penalty.)
  14. 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.
  15. I've been using this code to activate the buff TheInput:AddKeyDownHandler(KEY_Z, function() ApplyBuff(Buffs["stunbuff"], inst) end) However this seems to target me and nothing else. I'm not sure how to target things around me and not myself. I also need a way of adding a cool down so that I can't just use it constantly. Here is what the rest of the code looks like.
  16. So far I have this, inst.lightstunisapplied = false local applybuff = function(inst) -- Apply all your buff stuff here inst.components.locomotor:SetExternalSpeedMultiplier(inst, "lightstunkey", 0) end local removebuff = function(inst) -- Remove all your buff stuff here inst.components.locomotor:RemoveExternalSpeedMultiplier(inst, "lightstunkey") end inst:DoPeriodicTask(0.5, function(inst) if inst == nil or not inst:IsValid() or then -- If the player instance is invalid or they're dead, then we don't want to do anything. return end -- If our buff is applied and our measurements say it should not be applied anymore, we remove it. -- Else, if our buff is not applied and our measurements say it should be, we apply it. if inst.lightstunisapplied and inst.components.sanity:GetPercentWithPenalty() > 0.07 then removebuff(inst) elseif not inst.lightstunisapplied and inst.components.sanity:GetPercentWithPenalty() <= 0.07 then applybuff(inst) end end) This seems to slow him down when on 7% sanity. I'm not sure how to find an entity and slow them down with the inst thing and I am not sure how I would activate this with a key press. I do know however that I'll need a keyhandler.lua as other mods use this when dealing with key inputs.
  17. I had a character that can glow in the dark, I though of an idea where they could use this light to stun enemies. I've looked at examples but I couldn't quite get it right. I wanted to make it so when he activates it his light will be gone for 8 minutes (a day) and he'll get a sanity penalty. (About -10 to -15 maybe?) I was going to make it activated by a key press by I couldn't quite figure it out. Any help would be appreciated.
  18. Sorry for the late reply. Where should I place the ground image and what should be the file's name?
  19. The backpack works fine when you're wearing it but when you put it on the floor it turns invisible and can only be picked up with the space bar. I'm not good at coding so I don't know what i've done wrong. I have attached the entire mod below for people to look at. Green's
  20. I'm going to upload the files for you to have a look at as I'm less experienced in coding.
  21. I put player "= GLOBAL.ThePlayer" in the scripts... [string "../mods/Green's backpack/scripts/prefabs/gr..."]:112: variable 'GLOBAL' is not declared LUA ERROR stack traceback: =[C] in function 'error' scripts/strict.lua(23,1) ../mods/Green's backpack/scripts/prefabs/green_backpack.lua(112,1) in function 'fn' scripts/mainfunctions.lua(93,1) =(tail call) ? It didn't work. I'm not sure whats going on with this one...
  22. Do you mean give the file? if so here it is green_backpack.lua
  23. I tried the code and figured out that I had to put it in modmain.lua and it got to the character select screen which is great! But i got a new error when playing as the character that the back pack is meant for. [string "scripts/components/inventory.lua"]:634: attempt to index local 'inst' (a nil value) LUA ERROR stack traceback: scripts/components/inventory.lua:634 in (method) GiveItem (Lua) <633-766> scripts/prefabs/player_common.lua:1892 in (method) OnNewSpawn (Lua) <1888-1900> scripts/networking.lua:250 in () ? (Lua) <238-256> =[C]:-1 in (method) SendSpawnRequestToServer (C) <-1--1> scripts/mainfunctions.lua:1272 in (local) cb (Lua) <1270-1273> scripts/frontend.lua:531 in (method) DoFadingUpdate (Lua) <495-535> scripts/frontend.lua:583 in (method) Update (Lua) <543-695> scripts/update.lua:92 in () ? (Lua) <33-129> I think it's something to do with the backpack trying to be in the inventory but it normally goes straight on the torso slot. I not really sure.
  24. Where should I put this code? I'm not really sure. in the modmain.lua file right? or green_backpack?