05-28-2008, 11:05 PM | #1 |
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
|
Need lua to disallow the conc explosion
Ok here's what I want / need.
I want for a conc to only be able to be fired inside the trigger IF the player is holding it. If they toss it, I want it to either disappear or not be fired. I tired using this code from the no_annoyances and it's not working for some reason: Code:
function noannoyances:onexplode( explode_entity ) if IsGrenade( explode_entity ) then return EVENT_DISALLOWED end return EVENT_ALLOWED end
__________________
(Released) conc_school | hellion_classic | ksour_PAYLOAD | mulch_faf (Beta) alchimy_b1 (Lua) base_payload_2015 (Models) props_trainyard |
|
05-28-2008, 11:42 PM | #2 |
Not choking. Yet.
Lua Team
Wiki Team Fortress Forever Staff Join Date: Jul 2007
Location: Scotland
Class/Position: Demo/Def - Spy/Off Gametype: Anything but yet more fucking CTF Affiliations: FF.AvD [FF AvD/ID guild] Posts Rated Helpful 0 Times
|
Well, this isn't perfect, but it does what you want...
Code:
function player_onthrowgren2(player, prime) return EVENT_DISALLOWED end
__________________
Preferable to death. But only just...
Last edited by Pon; 05-28-2008 at 11:48 PM. |
|
05-29-2008, 12:00 AM | #3 |
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
|
lol not really...as long as they can't toss it down then that's fine by me. Plus this is all I need to run my last compile and release so something that small isn't really going to bug / stop me.
__________________
(Released) conc_school | hellion_classic | ksour_PAYLOAD | mulch_faf (Beta) alchimy_b1 (Lua) base_payload_2015 (Models) props_trainyard |
|
05-29-2008, 12:08 AM | #4 |
Not choking. Yet.
Lua Team
Wiki Team Fortress Forever Staff Join Date: Jul 2007
Location: Scotland
Class/Position: Demo/Def - Spy/Off Gametype: Anything but yet more fucking CTF Affiliations: FF.AvD [FF AvD/ID guild] Posts Rated Helpful 0 Times
|
Thats good 'cos I'm not sure how to remove it :P
__________________
Preferable to death. But only just...
|
|
05-29-2008, 12:26 AM | #5 |
Fortress Forever Staff
Join Date: Sep 2007
Class/Position: O: Scout Affiliations: {NFO} - New Family Order Posts Rated Helpful 0 Times
|
You could just remove their concs when they are out of the area and add them again when they are back?
|
|
05-29-2008, 01:42 AM | #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
|
well I want / need them to be able to HH the conc, but not to toss it.
Also me and pon have been going back and forth trying shit and nothing is working...any other ideas?
__________________
(Released) conc_school | hellion_classic | ksour_PAYLOAD | mulch_faf (Beta) alchimy_b1 (Lua) base_payload_2015 (Models) props_trainyard |
|
05-29-2008, 01:51 AM | #7 |
Fortress Forever Staff
Join Date: Sep 2007
Class/Position: O: Scout Affiliations: {NFO} - New Family Order Posts Rated Helpful 0 Times
|
Something like if the grenade is yours and is not more than 1 unit away, allow blast. Dunno how to code that though.
|
|
05-29-2008, 01:55 AM | #8 |
Stuff Do-er
Lua Team
Wiki Team Fortress Forever Staff |
You could try enabling a trigger_remove that only removes grenades in player_onthrowgren2()
__________________
#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 |
|
05-29-2008, 01:57 AM | #9 |
Fortress Forever Staff
Join Date: Sep 2007
Class/Position: O: Scout Affiliations: {NFO} - New Family Order Posts Rated Helpful 0 Times
|
I think if the whole onthrowgren2 thing was working, the above code from Pon would have fixed it already.
|
|
05-29-2008, 01:59 AM | #10 | |
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 |
|
|
05-29-2008, 02:04 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
|
yeah that seems to be the problem...I can't tie it to a trigger_ff_script b/c it's an entity so it either works all the time or never.
__________________
(Released) conc_school | hellion_classic | ksour_PAYLOAD | mulch_faf (Beta) alchimy_b1 (Lua) base_payload_2015 (Models) props_trainyard |
|
05-29-2008, 02:14 AM | #12 | |
Fortress Forever Staff
Join Date: Sep 2007
Class/Position: O: Scout Affiliations: {NFO} - New Family Order Posts Rated Helpful 0 Times
|
Quote:
|
|
|
05-29-2008, 02:46 AM | #13 |
Not choking. Yet.
Lua Team
Wiki Team Fortress Forever Staff Join Date: Jul 2007
Location: Scotland
Class/Position: Demo/Def - Spy/Off Gametype: Anything but yet more fucking CTF Affiliations: FF.AvD [FF AvD/ID guild] Posts Rated Helpful 0 Times
|
Ok, on the offchance that this might help someone else finish it off, here's what i was trying to do:
Code:
local c = Collection() nonades = trigger_ff_script:new({}) function nonades:ontouch( touch_entity ) if IsPlayer( touch_entity ) then local player = CastToPlayer( touch_entity ) -- Add this player to the collection c:AddItem( player ) end end function nonades:onendtouch( touch_entity ) if IsPlayer( touch_entity ) then local player = CastToPlayer( touch_entity ) -- Remove player from collection c:RemoveItem( player ) end end -- This is fired when everyone has stopped touching "nonades" -- and it goes to its inactive state function nonades:oninactive() -- Clear out the items in the collection c:RemoveAllItems() end function player_onthrowgren2(player, prime) if c:Count() == 0 then return EVENT_ALLOWED end for temp in c.items do local c_player = CastToPlayer( temp ) if c_player == player then return EVENT_DISALLOWED end end return EVENT_ALLOWED end
__________________
Preferable to death. But only just...
|
|
05-29-2008, 04:09 AM | #14 |
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 yeah...I'm an idiot and am very sorry to have wasted everyone's time:
http://developer.valvesoftware.com/wiki/Trigger_push Speed of Push: 2000 Flags: Clients (un-check) Physics Objects (check) FF Grenades (check) Dropping conc sends it flying across the room, problem solved! Again very sorry everyone...
__________________
(Released) conc_school | hellion_classic | ksour_PAYLOAD | mulch_faf (Beta) alchimy_b1 (Lua) base_payload_2015 (Models) props_trainyard |
|
05-29-2008, 04:48 AM | #15 |
Fortress Forever Staff
Join Date: Sep 2007
Class/Position: O: Scout Affiliations: {NFO} - New Family Order Posts Rated Helpful 0 Times
|
Oh good it worked
We are victorious! |
|
05-29-2008, 06:57 AM | #16 |
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
|
yeah I didn't have the map you told me about, but I did remember that concmap_cave had the same thing so I decompiled it and copied what PSF had in there and it worked great!
thanks for your help everyone! I am running the last (hopefully) compile right now and should have this thing released tomorrow.
__________________
(Released) conc_school | hellion_classic | ksour_PAYLOAD | mulch_faf (Beta) alchimy_b1 (Lua) base_payload_2015 (Models) props_trainyard |
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|