Fortress Forever

Go Back   Fortress Forever > Editing > Mapping > Lua

Reply
 
Thread Tools Display Modes
Old 05-06-2008, 11:53 PM   #1
Green Mushy
Fortress Forever Staff
 
Green Mushy's Avatar
 
Join Date: Nov 2007
Location: Dallas, Texas
Posts Rated Helpful 6 Times
Send a message via AIM to Green Mushy
Flag Return Noise on Base_id.lua

The current IncludeScript("base_id"); has no noise when the flag returns. So nobody hears sounds on flag return on cornfield and palermo right? I tried to code it so it would work on my map, but it didnt work.
-------------------------------------------------
--Flags
----------------------------------------
function base_id_flag: onreturn( ) -- let teams know that the flag was returned
local team = GetTeam(self.team)
SmartTeamMessage(team,"#FF_TEAMRETURN","#FF_OTHERT EAMRETURN")
SmartTeamSound(team, "yourteam.flagreturn","otherteam.flagreturn")
SmartTeamSpeak(team, "CTF_FLAGBACK", "CTF_EFLAGBACK")
local flag = CastToInfoScript( entity )
end

The sounds are precached in the base_id.lua already. What do i do? (since some of the function base_id_flag stuff in in the base_id.lua already, does it have to be put in my lua differently?)
Green Mushy is offline   Reply With Quote


Old 05-07-2008, 01:06 AM   #2
Jester
Fortress Forever Staff
 
Jester's Avatar
 
Join Date: Sep 2007
Class/Position: O: Scout
Affiliations: {NFO} - New Family Order
Posts Rated Helpful 0 Times
Code:
function baseflag:precache()
	PrecacheSound(self.tosssound)
	PrecacheSound("yourteam.flagstolen")
	PrecacheSound("otherteam.flagstolen")
	PrecacheSound("yourteam.drop")
	PrecacheSound("otherteam.drop")
	PrecacheSound("yourteam.flagreturn")
	PrecacheSound("otherteam.flagreturn")
	PrecacheSound("yourteam.flagcap")
	PrecacheSound("otherteam.flagcap")
	info_ff_script.precache(self)
end
Code:
function baseflag:onreturn( )
	-- let the teams know that the flag was returned
	local team = GetTeam( self.team )
	SmartTeamMessage(team, "#FF_TEAMRETURN", "#FF_OTHERTEAMRETURN")
	SmartTeamSound(team, "yourteam.flagreturn", "otherteam.flagreturn")
	SmartTeamSpeak(team, "CTF_FLAGBACK", "CTF_EFLAGBACK")
	local flag = CastToInfoScript( entity )

	RemoveHudItemFromAll( flag:GetName() .. "_d" )
	RemoveHudItemFromAll( flag:GetName() .. "_c" )
	AddHudIconToAll( self.hudstatusiconhome, ( flag:GetName() .. "_h" ), self.hudstatusiconx, self.hudstatusicony, self.hudstatusiconw, self.hudstatusiconh, self.hudstatusiconalign )
	self.status = 0
end
Straight from base_teamplay.lua so it should work. I see you already copy+pasted most of the return code, but you have some spaces in there that shouldn't be there.
Jester is offline   Reply With Quote


Old 05-07-2008, 02:11 AM   #3
Green Mushy
Fortress Forever Staff
 
Green Mushy's Avatar
 
Join Date: Nov 2007
Location: Dallas, Texas
Posts Rated Helpful 6 Times
Send a message via AIM to Green Mushy
i tried that already
Green Mushy is offline   Reply With Quote


Old 06-11-2008, 01:41 AM   #4
Dexter
internet user
Fortress Forever Staff
 
Dexter's Avatar
 
Join Date: Jun 2007
Posts Rated Helpful 42 Times
I have found the problem, it's the baseflag's team, its usually 0 therefor breaking the smart team vox.

so the quick fix is changing your copy of onreturn() from
Code:
local team = GetTeam( self.team )
to
Code:
local team = GetTeam( Team.kBlue )
Of course that breaks shit, the proper way would to set cp1_flag.team, and so on when needed.
Dexter is offline   Reply With Quote


Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:58 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.