Taunts for Deathrun

So, I run a Deathrun and Prophunt server, and was wanting to try and convert the taunt code from Prophunt into Deathrun. I assume it’s not an easy conversion, as the gamemodes use different variables and types of coding (I’m guessing). So I was going to see if someone could possibly help me convert it over. I’ll post the code for the Prophunt taunts and then see if someone can help me out. Any kinds of suggestions would help, if you have an alternative suggestion or idea, please let me know! Thanks!

I believe the following two files are the only files with anything related to taunting in them.

This code is located in the init.lua file:



// Send the required lua files to the client
AddCSLuaFile("cl_init.lua")
AddCSLuaFile("sh_config.lua")
AddCSLuaFile("sh_init.lua")
AddCSLuaFile("sh_player.lua")

// Send the required resources to the client
for _, taunt in pairs(HUNTER_TAUNTS) do resource.AddFile("sound/"..taunt) end
for _, taunt in pairs(PROP_TAUNTS) do resource.AddFile("sound/"..taunt) end

// Called when player presses [F3]. Plays a taunt for their team
function GM:ShowSpare1(pl)
	if GAMEMODE:InRound() && pl:Alive() && (pl:Team() == TEAM_HUNTERS || pl:Team() == TEAM_PROPS) && pl.last_taunt_time + TAUNT_DELAY <= CurTime() && #PROP_TAUNTS > 1 && #HUNTER_TAUNTS > 1 then
		repeat
			if pl:Team() == TEAM_HUNTERS then
				rand_taunt = table.Random(HUNTER_TAUNTS)
			else
				rand_taunt = table.Random(PROP_TAUNTS)
			end
		until rand_taunt != pl.last_taunt
		
		pl.last_taunt_time = CurTime()
		pl.last_taunt = rand_taunt
		
		pl:EmitSound(rand_taunt, 100)
	end	
end

This is the code located in the sh_config file:



// Sound files hunters can taunt with
// You need at least 2 files listed here
HUNTER_TAUNTS = {
  "a bunch of sound files lol"
}


// Sound files props can taunt with
// You need at least 2 files listed here
PROP_TAUNTS = {
  "more sounds"
}


// Seconds a player has to wait before they can taunt again (Default: 5)
TAUNT_DELAY = 3


Fretta has it’s own round systems, so stuff like ‘GAMEMODE:InRound()’ won’t work for Deathrun if it’s not on that base, unless by some change it uses that method to detect if you’re in round.

Find out how DR handles it’s round systems and use that instead.

Ok, thanks for your comment!

I found a few different variables that would have to deal with the round end of Deathrun I believe.



dr_rounds_left
dr_total_rounds
rounds:GetInt()
self:RoundThink()
self:GetRound()
local rounds
SetGlobalInt( "Deathrun_RoundPhase", ROUND_WAITING )


Would I replace ‘GAMEMODE:InRound()’ with any of those by any chance?

I don’t really know the DR gamemode enough to tell you, sorry. ROUND_WAITING sounds like it’s for when there’s not enough players to start, is there anything similar but for in round?

This probably?



if round != ROUND_ACTIVE then return end


Also, where would I put this file? Someone told me to just name it and put it into lua/autorun/client. Is this correct?

Bump. Kind of got buried lol.

If it’s inside the init.lua file of Prop Hunt, you could try placing it in Deathrun’s init.lua

Hmm, I’ll give it a shot. Do you think I need to create a sh_config.lua file then also?

Sounds like a good idea, helps keep things neat

Guess I might have to give up on this. Doesn’t seem to be working very well =/.