06-27-2009, 05:02 AM | #1 |
[DGAF]
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
|
|
06-27-2009, 07:03 AM | #2 |
Banned
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 }) |
|
06-27-2009, 05:18 PM | #3 |
Community Member
Server Owner
Beta Tester Forum Moderator 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..
__________________
|
|
06-27-2009, 10:24 PM | #4 |
[DGAF]
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.
|
|
06-27-2009, 10:25 PM | #5 |
Wiki Team
Fortress Forever Staff 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 |
|
06-28-2009, 01:12 AM | #6 |
[DGAF]
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
|
|
06-28-2009, 01:13 AM | #7 |
Stuff Do-er
Lua Team
Wiki Team Fortress Forever Staff |
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 |
|
06-28-2009, 01:17 AM | #8 |
[DGAF]
Join Date: Apr 2009
Posts Rated Helpful 1 Times
|
satan!! COPYCAT!!! jk What sort of lua scripting are you using?
|
|
06-28-2009, 01:21 AM | #9 |
[DGAF]
Join Date: Apr 2009
Posts Rated Helpful 1 Times
|
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. |
|
06-28-2009, 01:22 AM | #10 |
Community Member
Server Owner
Beta Tester Forum Moderator 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?
__________________
|
|
06-28-2009, 01:29 AM | #11 | |
Stuff Do-er
Lua Team
Wiki Team Fortress Forever Staff |
Quote:
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. |
|
|
06-28-2009, 02:51 AM | #12 |
Wiki Team
Fortress Forever Staff Join Date: Sep 2007
Location: Greeley, CO
Class/Position: Med / Solly Gametype: PAYLOAD Affiliations: DET- Posts Rated Helpful 19 Times
|
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 |
|
06-28-2009, 09:50 PM | #13 |
D&A Member
Wiki Team Fortress Forever Staff 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 |
|
06-28-2009, 11:31 PM | #14 | |
Stuff Do-er
Lua Team
Wiki Team Fortress Forever Staff |
Quote:
__________________
#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 |
|
|
07-10-2009, 09:17 PM | #15 |
Wiki Team
Fortress Forever Staff 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 |
|
07-11-2009, 01:48 AM | #16 |
Stuff Do-er
Lua Team
Wiki Team Fortress Forever Staff |
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 |
|
07-11-2009, 03:20 AM | #17 | |
Wiki Team
Fortress Forever Staff Join Date: Sep 2007
Location: Greeley, CO
Class/Position: Med / Solly Gametype: PAYLOAD Affiliations: DET- Posts Rated Helpful 19 Times
|
Quote:
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 Last edited by Dr.Satan; 07-11-2009 at 05:13 AM. |
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|