Mr. Tiddles

  • Content Count

  • Joined

  • Last visited

 Content Type 




Klei Bug Tracker

Game Updates

Hot Lava Bug Reporter

Posts posted by Mr. Tiddles

  1. Another thing is how if you want to implement custom mob/boss music you have to do some whacky voodoo, as explained below:




    Using Fuelweaver as the example, his music is called via:

            ThePlayer:PushEvent("triggeredevent", { name = "stalker", level = level })

    The  "name" data is is referring to a loooong list of songs -- which is a local variable in the dynamic music component. The dynamic component then checks the list for the name and its song. (Just for those who aren't aware. I probably explained it poorly)

     It would be wonderful if there was an "override" data or the likes that let us bypass the list so we could more easily add our own music. So the PushEvent would look more like this:

            ThePlayer:PushEvent("triggeredevent", { override = "dontstarve/music/custom_song"})

    I imagine it would look something roughly like this in dynamic music (Note it's the exact same function with one minor change):

    local function StartTriggeredDanger(player, data)
        local level = math.max(1, math.floor(data ~= nil and data.level or 1))
        if _triggeredlevel == level then
            _extendtime = math.max(_extendtime, GetTime() + (data.duration or 10))
        elseif _isenabled then
     --Just a quick check to see if there's an override down here oughta do the trick. 
            local music = data ~= nil and data.override ~= nil and data.override or TRIGGERED_DANGER_MUSIC[ ~= nil or "default"] or TRIGGERED_DANGER_MUSIC.default
            music = music[level] or music[1]
            if #music > 0 then
                _soundemitter:PlaySound(music, "danger")
            _dangertask = inst:DoTaskInTime(data.duration or 10, StopDanger, true)
            _triggeredlevel = level
            _extendtime = 0

    I hope this was somewhat legible it's like 4am



    btw Klei I will implement all of these suggestions for less than minimum wage plz hire me I lost my job to covid

    • Like 4

  2. On 1/1/2020 at 4:14 AM, thomas4846 said:

    [00:32:47]: [string "scripts/actions.lua"]:962: attempt to index field 'combat' (a nil value)

    The issue is actually in the combat action.


    ACTIONS.ATTACK.fn = function(act)
        if ~= nil then
            if"propattack") then
                --don't do a real attack with prop weapons
                return true
            elseif"thrusting") then
                local weapon = act.doer.components.combat:GetWeapon()
                return weapon ~= nil
                    and weapon.components.multithruster ~= nil
                    and weapon.components.multithruster:StartThrusting(act.doer)
            elseif"helmsplitting") then
                local weapon = act.doer.components.combat:GetWeapon()
                return weapon ~= nil
                    and weapon.components.helmsplitter ~= nil
                    and weapon.components.helmsplitter:StartHelmSplitting(act.doer)
        act.doer.components.combat:DoAttack(  <LINE 962
        return true

    May I see the rest of your mod to see what's up?

  3. 3 hours ago, Hornete said:

    With the previous code (I thought I explained this in my post, but I guess it got deleted somehow)

    The dash would work fine without lag compensation enabled, but when it was enabled. That's when the bug randomly started happening. I removed the useitem part and it just seemed to work 100% of the time.

    Ah- that would explain it! Changing lag compensation causes the ability to be lost as well, as does relogging into the game. Which sadly, it's still happening.

    There's also a strange thing that happens - if I have "inst:AddTag("candash") into the OnSetOwner function, you're able to dash after spawning but not after relogging, but the opposite is true if the "inst:AddTag" is in the common_postinit. Regardless that only makes it more stable as picking grass can randomly break it still, but it gives that initial stability.

    Adding "inst:AddTag("candash")" to both the common_postinit and the OnSetOwner did make it work on both fresh spawns and relogging! Though sustained stability still needs to be adressed. It's an improvement at least. the game was making it seem like it helped to mess with my head.

  4. Like it says on the tin, occasionally performing certain actions (like picking grass) will cause my character Warfarin to be unable to use their dash ability while moving via direct input (holding WASD or mouse 1, clicking to move is fine - only holding the buttons stops it). Relogging also seems to break it. I've noticed Wortox has the same issue even with no mods installed but Warfarin seems to break alot more frequently. Even when I directly copied all of his code into Warfarin's.

    I've spent a good month or so trying to troubleshoot this, and all I've came out with is:

    A) It's not a stategraph issue as it doesn't even trigger the pre-act state;

    B) It doesn't seem to be the test of whether Warf meets the criteria to dash at that moment (IE, doesn't have the "nodash" tag);

    C) Forcing the character to double-check they've abandoned any failed/succeeded actions doesn't work

    D) It's really annoying.


    If any smarter folk than I could pitch any ideas to work around this bug - because it has to be a bug if it's affecting an official character - I'd be much appreciative!

    And of course, the mod will be attached below. Please excuse some of the sloppy remnants to try and fix the issue littered around the place I may have missed during cleanup.

  5. 47 minutes ago, Leonardo Cox said:

    I assume you mean wortox's teleportation iframes? In which case, we did it for both balance and needing to take health away.

    Yes, that! Personally I reckon the iFrames should be reincluded (which as long as the health delta is before the invincibility being applied will still work) because getting hit cancels the animation, which means you've just wasted health if you're trying to make some distance, or even if you could still be hit but it just didn't interrupt it. Could be balanced by upping either the health cost or the cooldown since it seems to be even shorter than Lucy's throw at the moment! 

    Just thought I'd throw it out there since if you land yourself in a sticky situation - especially in smaller parties - the ability becomes more of a liability than helpful. Honestly that's the only gripe I have with it - but you lot have done a terrific job regardless! (Also I was digging through the code, and saw a certain possible feature for my boy Maxwell that made me very excited.)

    EDIT: Somehow never realized Wortox was never invulnerable during the portal_jumpin_pre state. It always felt more generous...maybe just because you're in a less crowded space outside of the Forge.

  6. Right-right. The best I can do is give an example of how I do it:

    I have 2 folders in the same directory as my Krane for ease of access. The IMPORT DIR has the .bins and .tex folders, with the EXPORT DIR being an empty folder.


    I drag Krane into command prompt, followed by the Import Dir  (not just the files inside; the folder itself), then lastly the Export Dir folder.


    It then exports the files contained within the Import Dir into the Export Dir

  7. The solution to this is in the finiteuses component:


    function FiniteUses:SetUses(val)
        local was_positive = self.current > 0
        self.current = val
        self.inst:PushEvent("percentusedchange", {percent = self:GetPercent()}) < This is the important line
        if self.current <= 0 then
            self.current = 0
            if was_positive and self.onfinished ~= nil then
    function FiniteUses:GetPercent()  <This is also important
        return self.current /

    When the item holding the component is used, it pushes an event the item can listen out for. And so all you need is to make it listen:

        inst:ListenForEvent("percentusedchange",  function(inst)
        inst.components.weapon:SetDamage(DAMAGE * inst.components.finiteuses:GetPercent())

    Replace "DAMAGE" with whatever you want. the GetPercent just checks what percent of durability the item has left, and the * multiplies the damage by that percentage. So full durability means a 1x modifier, whereas half is a 0.5x modifier. That function belongs right beneath where you state the weapon's damage in its prefab.