05-31-2010, 09:16 PM | #1 |
WhenNailGrenWillOut?
Beta Tester
Join Date: May 2009
Gametype: mp_prematch Affiliations: [:)] - Frag Happy, babe| Posts Rated Helpful 29 Times
|
Removing concs
Basically what I want to do is that in the map medics and scouts spawn with no concs and when they cap a flag I want them to not gain any concs.
I know nothing about lua so I could use some help.
__________________
[[ ff_hotfudge - bhop_theonlyone ]] "As the the new year approaches I await for it like an case of explosive fecalomania otherwise know as diareha or the massive shits. I am gripping the sides of the toilet as my stomach produces the first hollow thud out of the anus of the year to come." DarkeN_HellspawN |
|
05-31-2010, 09:58 PM | #2 |
Stuff Do-er
Lua Team
Wiki Team Fortress Forever Staff |
Remove concs on spawn:
Code:
function player_spawn( player_entity ) local player = CastToPlayer( player_entity ) player:AddHealth( 400 ) player:AddArmor( 400 ) player:AddAmmo( Ammo.kNails, 400 ) player:AddAmmo( Ammo.kShells, 400 ) player:AddAmmo( Ammo.kRockets, 400 ) player:AddAmmo( Ammo.kCells, 400 ) if player:GetClass() == Player.kScout or player:GetClass() == Player.kMedic then player:RemoveAmmo( Ammo.kGren2, 4 ) end end Code:
local basecap:oncapture_base = basecap:oncapture function basecap:oncapture(player, item) basecap:oncapture_base( player, item ) if player:GetClass() == Player.kScout or player:GetClass() == Player.kMedic then player:RemoveAmmo( Ammo.kGren2, 4 ) 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.; 05-31-2010 at 10:04 PM. |
|
06-01-2010, 06:03 PM | #3 |
WhenNailGrenWillOut?
Beta Tester
Join Date: May 2009
Gametype: mp_prematch Affiliations: [:)] - Frag Happy, babe| Posts Rated Helpful 29 Times
|
It gives me a lua error on this line.
Code:
local basecap:oncapture_base = basecap:oncapture
__________________
[[ ff_hotfudge - bhop_theonlyone ]] "As the the new year approaches I await for it like an case of explosive fecalomania otherwise know as diareha or the massive shits. I am gripping the sides of the toilet as my stomach produces the first hollow thud out of the anus of the year to come." DarkeN_HellspawN |
|
06-01-2010, 09:09 PM | #4 |
Stuff Do-er
Lua Team
Wiki Team Fortress Forever Staff |
Yeah I'm not sure that method will work after all...
Hm.
__________________
#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-01-2010, 10:00 PM | #5 |
WhenNailGrenWillOut?
Beta Tester
Join Date: May 2009
Gametype: mp_prematch Affiliations: [:)] - Frag Happy, babe| Posts Rated Helpful 29 Times
|
Maybe I can do something with triggers? For example scout caps the flag,gets the nades and the trigger takes them away. I would need a specific trigger that would only work for medics and scouts though.
__________________
[[ ff_hotfudge - bhop_theonlyone ]] "As the the new year approaches I await for it like an case of explosive fecalomania otherwise know as diareha or the massive shits. I am gripping the sides of the toilet as my stomach produces the first hollow thud out of the anus of the year to come." DarkeN_HellspawN Last edited by moosh; 06-01-2010 at 10:00 PM. |
|
06-01-2010, 10:27 PM | #6 |
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
|
ya, I was gonna suggest that. Just put a trigger around the cap trigger and when the player stops touching it remove conc's
__________________
(Released) conc_school | hellion_classic | ksour_PAYLOAD | mulch_faf (Beta) alchimy_b1 (Lua) base_payload_2015 (Models) props_trainyard |
|
06-02-2010, 01:24 AM | #7 |
Banned
Join Date: Sep 2008
Class/Position: Soldier Gametype: AVD Affiliations: TALOS Posts Rated Helpful 5 Times
|
Nevermind, I thought you only wanted no concs on Medics or Scouts when they captured. Considering you want no concs at all, that trigger would be fine.
Code:
conc_remover = trigger_ff_script:new({}) function conc_remover:ontrigger(allowed_entity) if IsPlayer(allowed_entity) then local player = CastToPlayer(allowed_entity) if player:GetClass() == Player.kScout or player:GetClass() == Player.kMedic then player:RemoveAmmo(Ammo.kGren2, 4) end end end Last edited by Bridget; 06-02-2010 at 01:28 AM. |
|
06-02-2010, 08:03 PM | #8 | |
WhenNailGrenWillOut?
Beta Tester
Join Date: May 2009
Gametype: mp_prematch Affiliations: [:)] - Frag Happy, babe| Posts Rated Helpful 29 Times
|
Quote:
__________________
[[ ff_hotfudge - bhop_theonlyone ]] "As the the new year approaches I await for it like an case of explosive fecalomania otherwise know as diareha or the massive shits. I am gripping the sides of the toilet as my stomach produces the first hollow thud out of the anus of the year to come." DarkeN_HellspawN |
|
|
06-03-2010, 01:28 AM | #9 |
Banned
Join Date: Sep 2008
Class/Position: Soldier Gametype: AVD Affiliations: TALOS Posts Rated Helpful 5 Times
|
Note OnTrigger() constantly gets called when they're inside the trigger brush. I figured it would be better than OnTouch() or OnEndTouch() because people could still throw a conc outside of the brush while being inside of it, leave the brush, have their concs disappear, but get a boost off the dropped one.
|
|
06-04-2010, 02:21 AM | #10 |
internet user
Fortress Forever Staff
Join Date: Jun 2007
Posts Rated Helpful 42 Times
|
why not just remove all grenade2 on caps? screw spamming them anyway
Code:
yourmap_cap = basecap:new ( { gren2 = 0, }) red_cap = yourmap_cap:new( { team = Team.kRed, item = {"blue_flag","yellow_flag","green_flag"}}) blue_cap = bases_cap:new({team = Team.kBlue, item = {"red_flag","yellow_flag","green_flag"}}) Last edited by Dexter; 06-04-2010 at 02:21 AM. Reason: whitespace wooohonk |
|
06-05-2010, 02:02 AM | #11 | |
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:
__________________
(Released) conc_school | hellion_classic | ksour_PAYLOAD | mulch_faf (Beta) alchimy_b1 (Lua) base_payload_2015 (Models) props_trainyard |
|
|
06-05-2010, 03:26 AM | #12 |
1-800-UNAGIPOWA
|
Somewhere in the LUA controls where and when players get grenades, right?
Why not override that instead of making a trigger?
__________________
" In my opinion the testing team isn't really made for or of public players, it's made for competative players... " ¹ -Scuzzy (post# 462713) Last edited by cjeshjoir™; 06-05-2010 at 03:26 AM. |
|
06-05-2010, 03:27 AM | #13 |
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
|
b/c it's done in like a million seperate places and you would have to code 10x more to counter it than just making the trigger.
__________________
(Released) conc_school | hellion_classic | ksour_PAYLOAD | mulch_faf (Beta) alchimy_b1 (Lua) base_payload_2015 (Models) props_trainyard |
|
06-05-2010, 06:33 AM | #14 |
internet user
Fortress Forever Staff
Join Date: Jun 2007
Posts Rated Helpful 42 Times
|
ya. spawn, bags, caps etc. you would have to check player class too and it'd run on every entity so it'd end up being way more overhead
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|