Fortress Forever

Go Back   Fortress Forever > Editing > Mapping

Reply
 
Thread Tools Display Modes
Old 06-27-2009, 05:02 AM   #1
mentalERROR
[DGAF]
 
mentalERROR's Avatar
 
Join Date: Apr 2009
Posts Rated Helpful 1 Times
destroy to win??

How to make it where once 1 of 2 objects is destroyed by 1 team against another team determines winner? ex blue destroys reds wall so blue wins a round and map resets without losing score. Thx
mentalERROR is offline   Reply With Quote


Old 06-27-2009, 07:03 AM   #2
Bridget
Banned
 
Bridget's Avatar
 
Join Date: Sep 2008
Class/Position: Soldier
Gametype: AVD
Affiliations: TALOS
Posts Rated Helpful 5 Times
I'm presuming you mean like a detpack wall. There's some lua in the ff_bases (by Squeek?) for the generator at flag location that can be destroyed for points. Here it is edited a bit.

Code:
game_ended = false

function restart_round()
	game_ended = false
	RespawnAllPlayers()
	ResetMap()
end

fr_computer = trigger_ff_script:new({ team = Team.kUnassigned, enemy_team = Team.kUnassigned })

function fr_computer:onexplode( explosion_entity )
	if IsDetpack( explosion_entity ) then
		if game_ended == false then
			local detpack = CastToDetpack(explosion_entity)

			if detpack:GetTeamId() == self.team then return EVENT_ALLOWED end

			local points = 5
			local team = detpack:GetTeam()
			team:AddScore(points)

			local player = detpack:GetOwner()
			player:AddFortPoints(points * 100, "Destroyed Mainframe" )

			SmartMessage(player, "You destroyed the enemy mainframe!", "Your team 

destroyed the enemy mainframe!", "Your mainframe has been destroyed!")
			game_ended = true
			AddSchedule( "restart_round", 5, restart_round )
		end
	end

	return EVENT_ALLOWED
end

blue_computer = fr_computer:new({ team = Team.kBlue, enemy_team = Team.kRed })
red_computer = fr_computer:new({ team = Team.kRed, enemy_team = Team.kBlue })
This is it, edited. I'm not sure how good of a job I did editing it. Essentially, once the detpack area is destroyed (trigger brush named "x_computer", x is color) it sets game_ended to true, which prevents any more detpacks from affecting the same trigger or your team's trigger. Then, after five seconds, the map is renewed and players respawned. You can edit it further from here. You can use outputs to make the ground shake with an env_shake, force sounds to play, or make func_breakables break. I hope it works properly (My test worked fine. But, try it with multiple people.) :s
Bridget is offline   Reply With Quote


Old 06-27-2009, 05:18 PM   #3
GeoKill----->
Community Member
Server Owner
Beta Tester
Forum Moderator
 
GeoKill----->'s Avatar
 
Join Date: Mar 2007
Location: Hawthorne, California
Class/Position: Soldier/Spy/Scout
Gametype: AvD
Affiliations: :e0:Eternal Order Leader
Posts Rated Helpful 12 Times
We need more details on what you mean by destroy... Can anyone class damaged it? detpack only? etc..
__________________

:e0: Will live on Forever
Support FF:
GeoKill-----> is offline   Reply With Quote


Old 06-27-2009, 10:24 PM   #4
mentalERROR
[DGAF]
 
mentalERROR's Avatar
 
Join Date: Apr 2009
Posts Rated Helpful 1 Times
Ok so open map dm style with objects in map that 1 team has to destroy other teams objects to win.
mentalERROR is offline   Reply With Quote


Old 06-27-2009, 10:25 PM   #5
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
lmao...I am mapping something almost exactly like that right now.
__________________
(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


Old 06-28-2009, 01:12 AM   #6
mentalERROR
[DGAF]
 
mentalERROR's Avatar
 
Join Date: Apr 2009
Posts Rated Helpful 1 Times
Well I added that script to the lua and when I load map it will not let me pick a class once I choose team. hrmmmm
mentalERROR is offline   Reply With Quote


Old 06-28-2009, 01:13 AM   #7
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 mentalERROR View Post
Ok so open map dm style with objects in map that 1 team has to destroy other teams objects to win.
Destroy with what? "Destroy" is the most ambiguous term you could possibly use in this situation.
__________________
#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 06-28-2009, 01:17 AM   #8
mentalERROR
[DGAF]
 
mentalERROR's Avatar
 
Join Date: Apr 2009
Posts Rated Helpful 1 Times
satan!! COPYCAT!!! jk What sort of lua scripting are you using?
mentalERROR is offline   Reply With Quote


Old 06-28-2009, 01:21 AM   #9
mentalERROR
[DGAF]
 
mentalERROR's Avatar
 
Join Date: Apr 2009
Posts Rated Helpful 1 Times
Quote:
Originally Posted by squeek. View Post
Destroy with what? "Destroy" is the most ambiguous term you could possibly use in this situation.
Each team having 1 big couch that other team uses rockets, nades, shottys etc to "break" it hence destroying it :P using func_breakable

Last edited by mentalERROR; 06-28-2009 at 01:21 AM.
mentalERROR is offline   Reply With Quote


Old 06-28-2009, 01:22 AM   #10
GeoKill----->
Community Member
Server Owner
Beta Tester
Forum Moderator
 
GeoKill----->'s Avatar
 
Join Date: Mar 2007
Location: Hawthorne, California
Class/Position: Soldier/Spy/Scout
Gametype: AvD
Affiliations: :e0:Eternal Order Leader
Posts Rated Helpful 12 Times
fuck yo couch?
__________________

:e0: Will live on Forever
Support FF:
GeoKill-----> is offline   Reply With Quote


Old 06-28-2009, 01:29 AM   #11
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 mentalERROR View Post
Each team having 1 big couch that other team uses rockets, nades, shottys etc to "break" it hence destroying it :P using func_breakable
Then Bridget's code isn't what you want. You'll either have to wait for 2.4 so you can use a func_breakable and :onbreak() lua, or use a func_button and something like this (this is from a beta version of an AvD "damage to win" type map)

NOTE: The following code will NOT be functional without huge amounts of rewriting or additional code. In short, what you want to do is not trivial by any means, but will become easier once 2.4 is out and :onbreak() is working.

Code:
base_target = func_button:new({})

function base_target:ondamage()
	if gates_open then
		if IsPlayer( GetPlayerByID(info_attacker) ) then
			local player = CastToPlayer( GetPlayerByID(info_attacker) )
			if player:GetTeamId() == attackers then
				local scaled_damage = info_damage / DAMAGE_POINTS_SCALE
				local damage_points = info_damage
				local team = GetTeam( attackers )
				local scaled_damage = 0
				local playerid = player:GetId()
				
				if info_classname == "ff_projectile_nail" then
					playerDamageTable[playerid].nail = playerDamageTable[playerid].nail + 1
					if playerDamageTable[playerid].nail >= POINT_EVERY_X_HITS_NAIL then
						ConsoleToAll( "[script] nail point" )
						scaled_damage = 1
						damage_points = damage_points * POINT_EVERY_X_HITS_NAIL
						playerDamageTable[playerid].nail = 0
						target_damage_outputs()
					end
				elseif info_classname == "ff_weapon_assaultcannon" then
					playerDamageTable[playerid].ac = playerDamageTable[playerid].ac + 1
					if playerDamageTable[playerid].ac >= POINT_EVERY_X_HITS_ASSAULTCANNON then
						ConsoleToAll( "[script] ac point" )
						scaled_damage = 1
						damage_points = damage_points * POINT_EVERY_X_HITS_ASSAULTCANNON
						playerDamageTable[playerid].ac = 0
						target_damage_outputs()
					end
				else
					-- round to the nearest whole number
					scaled_damage = math.floor(( info_damage / DAMAGE_POINTS_SCALE ) + .5)
					target_damage_outputs()
				end
				
				if scaled_damage > 0 then
					team:AddScore( scaled_damage )
					player:AddFortPoints( damage_points, "Damaging the Target" ) 
					
					RemoveSchedule( "shutout" )
					RemoveSchedule( "timer_schedule" )
					RemoveSchedule( "defenders_period_scoring" )
					RemoveSchedule( "init_defenders_period_scoring" )
					RemoveSchedule( "init_defenders_countdown" )
					
					target_status = true
					update_hud_text()
					update_target_status()
					
					AddSchedule( "init_defenders_countdown", DAMAGE_RESET_TIME, init_defender_countdown )
					
					playerDamageTable[playerid].points = playerDamageTable[playerid].points + scaled_damage
				end
			end
		end
	end
end
__________________
#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.; 06-28-2009 at 01:30 AM.
squeek. is offline   Reply With Quote


Old 06-28-2009, 02:51 AM   #12
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
Quote:
Originally Posted by mentalERROR View Post
satan!! COPYCAT!!! jk What sort of lua scripting are you using?
lmao...I was planning on recruiting squeek or pon to make me one once I had a decent working map to test shit on. But I have a few ideas for what might work.
__________________
(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


Old 06-28-2009, 09:50 PM   #13
Crazycarl
D&A Member
Wiki Team
Fortress Forever Staff
 
Crazycarl's Avatar
 
Join Date: Apr 2007
Posts Rated Helpful 31 Times
Here, I just put func_button + lua documentation up on the wiki(squeek look at this stuff I'm putting up and make sure it's correct/complete):
http://www.fortress-forever.com/wiki...ua:func_button
Crazycarl is offline   Reply With Quote


Old 06-28-2009, 11:31 PM   #14
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 Crazycarl View Post
Here, I just put func_button + lua documentation up on the wiki(squeek look at this stuff I'm putting up and make sure it's correct/complete):
http://www.fortress-forever.com/wiki...ua:func_button
Added some corrections and altered the example lua.
__________________
#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 07-10-2009, 09:17 PM   #15
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
so essentially as it stands now, there is no way to check HOW MUCH damage a button receives. There is only a way to check IF a button takes damage...
__________________
(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


Old 07-11-2009, 01:48 AM   #16
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 Dr.Satan View Post
so essentially as it stands now, there is no way to check HOW MUCH damage a button receives. There is only a way to check IF a button takes damage...
No, info_damage is the numerical amount of damage the func_button takes.
__________________
#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 07-11-2009, 03:20 AM   #17
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
Quote:
Originally Posted by squeek. View Post
No, info_damage is the numerical amount of damage the func_button takes.
yeah I know...idk what the hell I did to make my .lua not work, but I messed it up good!

Edit: actually carl might have found it for me...of to test!\
Edit2: yeah it works I was calling a :Collection() when I should have just been using an integer!
__________________
(Released) conc_school | hellion_classic | ksour_PAYLOAD | mulch_faf
(Beta) alchimy_b1
(Lua) base_payload_2015
(Models) props_trainyard
Support FF:

Last edited by Dr.Satan; 07-11-2009 at 05:13 AM.
Dr.Satan 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 01:43 AM.


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