Sign in to follow this  

Modder's QoL Suggestion Thread

Recommended Posts

Mr. Tiddles    1125

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

Edited by Mr. Tiddles
  • Like 4

Share this post

Link to post
Share on other sites
--- -.-    4041

i would like mod characters images able to show up in the world save area instead of a shadow wilson with a paper smiley face, like pls klei the images are even included in almost every mod :-(



  • Like 3

Share this post

Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this