Jump to content

How do I use inst.talksoundoverride to change the character's voice?


Recommended Posts

Now, what I am trying to do is change the character's voice when he is just talking. What I want to change the voice to when talking is "angry_LP," but I can't seem to get it to work. For Wolfgang, this is possible. Do I have to put something in modmain.lua for it to work?

 

 
	local function beangrycage(inst)
    if TheWorld.ismastersim then
        inst.isangrycage:set(true)
        inst.components.locomotor:SetExternalSpeedMultiplier(inst, "ethan_speed_mod", 1.25)
        inst.components.combat.damagemultiplier = 2
	        if TheNet:GetServerGameMode() == "lavaarena" then
            inst.components.health.absorb = -0.3
        end
	        if not inst:HasTag("playerghost") then
            inst.components.skinner:SetSkinMode("angry_skin", "ethan_angry")
        end
    end
	    inst.talksoundoverride = "dontstarve/characters/ethan/angry_LP"
	

Link to comment
Share on other sites

RemapSoundEvent( "dontstarve/characters/ethan/talk_LP", "ethan/ethan/angry_LP" )

 

That would go in your modmain and would only change the talking sounds

make sure in your assets you have
Asset("SOUNDPACKAGE", "sound/ethan.fev") and Asset("SOUND", "sound/ethan.fsb")

Link to comment
Share on other sites

Alright, now how do I change it back to normal? It is still the voice when he goes back to neutral.

	local function beneutralcage(inst)
    if TheWorld.ismastersim then
        inst.isangrycage:set(false)
	        inst.components.combat.damagemultiplier = 1
	        if TheNet:GetServerGameMode() == "lavaarena" then
            inst.components.health.absorb = 0
        end
	        inst:RemoveTag("insomniac")
	        inst.talksoundoverride = "dontstarve/characters/ethan/talk_LP"
        
        if not inst:HasTag("playerghost") then
            inst.components.skinner:SetSkinMode("normal_skin", "ethan")
        end
    end
	

Link to comment
Share on other sites

local assets =
{
    Asset("SCRIPT", "scripts/prefabs/player_common.lua"),
    Asset("ANIM", "anim/ethan.zip"),
    Asset("SOUND", "sound/ethan.fsb"),
}

If that doesn't work, try adding in Asset("SOUND", "sound/ethan.fev") as well

Link to comment
Share on other sites

That didn't work. What I am trying to do is this in modmain.lua:

RemapSoundEvent( "dontstarve/characters/ethan/angry_LP","ethan/ethan/angry_LP")
	

In ethan.lua:

 
	local function beangrycage(inst)
    if TheWorld.ismastersim then
        inst.isangrycage:set(true)
        inst.components.locomotor:SetExternalSpeedMultiplier(inst, "ethan_speed_mod", 1.25)
        inst.components.combat.damagemultiplier = 2
	        if TheNet:GetServerGameMode() == "lavaarena" then
            inst.components.health.absorb = -0.3
        end
	        if not inst:HasTag("playerghost") then
            inst.components.skinner:SetSkinMode("angry_skin", "ethan_angry")
        end
    end
	    inst.talksoundoverride = "dontstarve/characters/ethan/angry_LP"
	

Link to comment
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
 Share

×
  • Create New...