• Content Count

  • Joined

  • Last visited

Community Reputation

271 Excellent


About -t-

  • Rank

Recent Profile Visitors

1154 profile views
  1. For that i suggest you look through dynamicmusic.lua. It's a component that manages playing music when working or fighting certain monsters.
  2. Make sure you're not missing the leap attack state and make sure you have the appropriate EventHandler set up for it. From SGspider.lua: EventHandler("doattack", function(inst, data) if not (inst.sg:HasStateTag("busy") or inst.components.health:IsDead()) then --target CAN go invalid because SG events are buffered if inst:HasTag("spider_warrior") then inst.sg:GoToState( data.target:IsValid() and not inst:IsNear(data.target, TUNING.SPIDER_WARRIOR_MELEE_RANGE) -- This checks whether the mob is near its target and "warrior_attack" -- If it's too far away do leap attack or "attack", -- Else, do normal attack data.target ) elseif inst:HasTag("spider_spitter") then -- The rest is for other spider types inst.sg:GoToState( data.target:IsValid() and not inst:IsNear(data.target, TUNING.SPIDER_SPITTER_MELEE_RANGE) and "spitter_attack" --Do spit attack or "attack", data.target ) elseif inst:HasTag("spider_moon") then inst.sg:GoToState( data.target:IsValid() and not inst:IsNear(data.target, TUNING.SPIDER_WARRIOR_MELEE_RANGE) and "spike_attack" or "attack", data.target ) elseif inst:HasTag("spider_healer") then if data.target:IsValid() and (inst.healtime == nil or GetTime() - inst.healtime >= TUNING.SPIDER_HEALING_COOLDOWN) then inst.sg:GoToState("heal", data.target) else inst.sg:GoToState("attack", data.target) end else inst.sg:GoToState("attack", data.target) end end end)
  3. You copied the attack state from SGspider.lua. The SoundPath function that this state uses is local so you need to copy that function and paste it into your stategraph file. local function SoundPath(inst, event) local creature = "spider" if inst:HasTag("spider_healer") then return "webber1/creatures/spider_cannonfodder/" .. event elseif inst:HasTag("spider_moon") then return "turnoftides/creatures/together/spider_moon/" .. event elseif inst:HasTag("spider_warrior") then creature = "spiderwarrior" elseif inst:HasTag("spider_hider") or inst:HasTag("spider_spitter") then creature = "cavespider" else creature = "spider" end return "dontstarve/creatures/" .. creature .. "/" .. event end
  4. Ah, now I see what's the problem. Your mob's stategraph doesn't have an EventHandler for attacking. EventHandler("doattack", function(inst) if not (inst.sg:HasStateTag("busy") or inst.components.health:IsDead()) then inst.sg:GoToState("attack") end end) It should look something like this. You need to put it in the events table.
  5. Send your entire mob file + stategraph and brain files. I'll look through them and see if there's something wrong with them. If i can't find anything then I don't know if I can help you.
  6. Maybe your mobs brain doesn't contain any combat behaviours like ChaseAndAttack?
  7. I see you have the function declared but did you set it up in the combat component like this: inst.components.combat:SetRetargetFunction(period, Retarget)
  8. Did you set the Retarget function in the combat component? inst.components.combat:SetRetargetFunction(period, Retarget)
  9. Tried it with: inst.components.edible.healthvalue = 0 inst.components.edible.hungervalue = 0 inst.components.edible.sanityvalue = 0 And it still worked. There must be something else that causes it to not work
  10. I tested out your code snippet and it worked for me. It's possible the error is somewhere else in the file.
  11. Hmm... Alternatively you could use inst.components.inventory:GetEquippedItem(EQUIPSLOTS.HEAD) to see if your item is equipped.
  12. Does the game crash or just not print the correct string?
  13. When in-game you can open the console by pressing ~ (tilde) and type in c_reset() to reset the world. This will reload your mod and put you right back into the server you were just in after reloading, assuming the changes you made don't crash the game. You can also do this by adding require "debugkeys" to your modmain.lua. This will allow you to reset the game by pressing ctrl + R.
  14. Weird. If the character changes forms properly in should work as intended.
  15. Checking for the full moon can be done like this: TheWorld.state.moonphase == "full" You can also do it using WatchWorldState("moonphase", your_function)