Modding Help Moontant Monster Type Doesn't Play Sounds From Active Effect

Discussion in 'Starbound Modding' started by Ecafymtoohs, Sep 29, 2020.

  1. Ecafymtoohs

    Ecafymtoohs Big Damn Hero

    So, I made a gun that applies an effect to a monster hit.

    The effect lasts one second.
    if the target has less than 0 health and we haven't already played the sound, then:
    Play the sound, Send to log "All clean again", Set self.doneTheThing to true.

    Code:
    function init()
        self.doneTheThing = false
    end
    
    function update(dt)
        if status.resource("health") <= 0 and not self.doneTheThing then
            animator.playSound("clean")
            sb.logInfo("All clean again")
            self.doneTheThing = true -- We did the thing. Don't do it again.
        end
    end
    
    function uninit()
    end

    This works for all entities, including players, apart from moontants (the erchius human things from the Erchius Mining thing mission).
    It sends "All clean again" to the log, so I know that it's applying the effect, and that it's passing the check, but the sound simply isn't playing, or cannot be heard.

    Does anyone have any ideas at all as to why the sound isn't playing or can't be heard for this specific monster?
     

Share This Page