Fortress Forever

Go Back   Fortress Forever > Editing > Mapping > Lua

Reply
 
Thread Tools Display Modes
Old 12-08-2009, 03:41 PM   #1
Elmo
Gets tickled by FF
Fortress Forever Staff
 
Elmo's Avatar
 
Join Date: Jun 2007
Location: UK
Class/Position: Med Solly HW
Gametype: Any/CTF
Posts Rated Helpful 41 Times
Team based push trigger

Did a quick search..

I want to push players based on team. I know its implemented somewhere already but can't find it.
__________________
Support FF:
Done: ff_monkey
Done: ff_bases
Done: ff_warpath
Forever Doing: ff_medieval (beta#99999999)
Elmo is offline   Reply With Quote


Old 12-08-2009, 05:23 PM   #2
squeek.
Stuff Do-er
Lua Team
Wiki Team
Fortress Forever Staff
 
squeek.'s Avatar
 
Join Date: Mar 2007
Location: Northern California
Class/Position: Rallygun Shooter
Gametype: Conc tag (you just wait)
Affiliations: Mustache Brigade
Posts Rated Helpful 352 Times
Send a message via AIM to squeek.
Code:
team_only = trigger_ff_script:new({ team = Team.kUnassigned })

function team_only:allowed( allowed_entity )
	if IsPlayer( allowed_entity ) then
		local player = CastToPlayer( allowed_entity )
		-- return true if the player is on the right team
		return player:GetTeamId() == self.team 
	end
	return EVENT_DISALLOWED
end

blue_only = team_only:new({ team = Team.kBlue })
red_only = team_only:new({ team = Team.kRed })
__________________
#FF.Pickup ¤ Fortress-Forever pickups

My Non-official Maps
Released FF_DM_Squeek - FF_2Mesa3_Classic - FF_Siege_Classic
Beta FF_Myth - FF_Redlight_Greenlight

Sick of the people on the internet, always moanin'. They just moan.
- Karl Pilkington
squeek. is offline   Reply With Quote


Old 12-08-2009, 06:24 PM   #3
Elmo
Gets tickled by FF
Fortress Forever Staff
 
Elmo's Avatar
 
Join Date: Jun 2007
Location: UK
Class/Position: Med Solly HW
Gametype: Any/CTF
Posts Rated Helpful 41 Times
okay but what line adds the push??
__________________
Support FF:
Done: ff_monkey
Done: ff_bases
Done: ff_warpath
Forever Doing: ff_medieval (beta#99999999)
Elmo is offline   Reply With Quote


Old 12-08-2009, 06:40 PM   #4
Crazycarl
D&A Member
Wiki Team
Fortress Forever Staff
 
Crazycarl's Avatar
 
Join Date: Apr 2007
Posts Rated Helpful 31 Times
You define the push in the trigger_push's properties.
Crazycarl is offline   Reply With Quote


Old 12-08-2009, 06:47 PM   #5
Elmo
Gets tickled by FF
Fortress Forever Staff
 
Elmo's Avatar
 
Join Date: Jun 2007
Location: UK
Class/Position: Med Solly HW
Gametype: Any/CTF
Posts Rated Helpful 41 Times
so you still use the trigger push entity but name it "blue_only"? Despite "trigger_ff_script" in LUA code?

Some inherent casting of types or something? Things like that confuse me
__________________
Support FF:
Done: ff_monkey
Done: ff_bases
Done: ff_warpath
Forever Doing: ff_medieval (beta#99999999)
Elmo is offline   Reply With Quote


Old 12-08-2009, 07:50 PM   #6
squeek.
Stuff Do-er
Lua Team
Wiki Team
Fortress Forever Staff
 
squeek.'s Avatar
 
Join Date: Mar 2007
Location: Northern California
Class/Position: Rallygun Shooter
Gametype: Conc tag (you just wait)
Affiliations: Mustache Brigade
Posts Rated Helpful 352 Times
Send a message via AIM to squeek.
Quote:
Originally Posted by Elmo View Post
so you still use the trigger push entity but name it "blue_only"? Despite "trigger_ff_script" in LUA code?

Some inherent casting of types or something? Things like that confuse me
Yep. Confusion is required when dealing with lua.

trigger_ff_script is used so that the :allowed() function can be used. Other than that, it's confusing.

EDIT: By the way, this thread is a staff-fest.
__________________
#FF.Pickup ¤ Fortress-Forever pickups

My Non-official Maps
Released FF_DM_Squeek - FF_2Mesa3_Classic - FF_Siege_Classic
Beta FF_Myth - FF_Redlight_Greenlight

Sick of the people on the internet, always moanin'. They just moan.
- Karl Pilkington

Last edited by squeek.; 12-08-2009 at 07:51 PM.
squeek. is offline   Reply With Quote


Old 12-08-2009, 08:35 PM   #7
Hawk Eye
Who the fuck is this guy?
D&A Member
Beta Tester
 
Hawk Eye's Avatar
 
Join Date: Mar 2007
Class/Position: O Preferred
Gametype: AvD
Affiliations: [AE] Asseaters
Posts Rated Helpful 2 Times
Combo breaker?
Hawk Eye is offline   Reply With Quote


Old 12-08-2009, 09:04 PM   #8
squeek.
Stuff Do-er
Lua Team
Wiki Team
Fortress Forever Staff
 
squeek.'s Avatar
 
Join Date: Mar 2007
Location: Northern California
Class/Position: Rallygun Shooter
Gametype: Conc tag (you just wait)
Affiliations: Mustache Brigade
Posts Rated Helpful 352 Times
Send a message via AIM to squeek.
Beta-fest.
__________________
#FF.Pickup ¤ Fortress-Forever pickups

My Non-official Maps
Released FF_DM_Squeek - FF_2Mesa3_Classic - FF_Siege_Classic
Beta FF_Myth - FF_Redlight_Greenlight

Sick of the people on the internet, always moanin'. They just moan.
- Karl Pilkington
squeek. is offline   Reply With Quote


Old 12-08-2009, 09:27 PM   #9
Hawk Eye
Who the fuck is this guy?
D&A Member
Beta Tester
 
Hawk Eye's Avatar
 
Join Date: Mar 2007
Class/Position: O Preferred
Gametype: AvD
Affiliations: [AE] Asseaters
Posts Rated Helpful 2 Times
Damn.
Hawk Eye is offline   Reply With Quote


Old 12-08-2009, 09:51 PM   #10
Dr.Satan
Wiki Team
Fortress Forever Staff
 
Dr.Satan's Avatar
 
Join Date: Sep 2007
Location: Greeley, CO
Class/Position: Med / Solly
Gametype: PAYLOAD
Affiliations: DET-
Posts Rated Helpful 19 Times
lol should know better than to try and best squeek!
__________________
(Released) conc_school | hellion_classic | ksour_PAYLOAD | mulch_faf
(Beta) alchimy_b1
(Lua) base_payload_2015
(Models) props_trainyard
Support FF:
Dr.Satan is offline   Reply With Quote


Reply


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

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 12:53 PM.


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