Help with weapon block?

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
Tazz
Second Lieutenant
Posts: 155
Joined: Fri Feb 16, 2007 1:29 pm
Contact:

Help with weapon block?

Post by Tazz »

ok im going to make another area to where it limited weapons....i have my cover made and my triggers and all set bu there are 2 doors coming into this area that i would like to block nades from being thrown in....can i just use like a weaponclip just like a clip wall?.....the player has to be able to walk thru the door but no nades can come thru.....maybe something like this?

local.weaponclip = spawn script_object
local.weaponclip.origin = ( -2940 2750 274 )
local.weaponclip.angles = ( 0 0 0 )
local.weaponclip setsize ( -225 -450 -5 ) ( 215 450 5 )

end

thx for the help guys
neillomax
Lieutenant General
Posts: 880
Joined: Thu Jun 23, 2005 6:57 am

Post by neillomax »

I never tried it but weapon clip.......... and in the entities window/

key/weapontype
value/grenade

sounds far fetched, but try it.................... ????????????????
User avatar
ViPER
General
Posts: 1058
Joined: Fri Jan 14, 2005 5:48 pm
Location: California
Contact:

Post by ViPER »

If that doesn't work you could use clip all - then script a teleport to pass the player - if done precisely the player will not even know he has been teleported.
Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

Post by Rookie One.pl »

Well, what you're trying to do is extremely tricky. When the game makes a trace for a projectile, it reports collision with BSP surfaces that contain the weaponclip surface or content flag (see article on Wikipedia). The only safe and reliable way would be to use a brush with the correct flag set, and you can't do that by scripting.

I don't think what Neil posted would work, and Viper's solution would be rather dirty and difficult to implement. What I'd suggest is a trigger_multipleall (it works slightly differently than an ordinary trigger_multiple) with the correct spawnflag set (can't remember which one it is, check in radiant, make a trigger_multipleall and check the checkbox to make it react to projectiles in the entity inspector window), calling a thread that would change the grenade's velocity vector direction. However, I'm not sure if you actually can make it move in a different direction, as the game code regarding projectiles is quite messy.
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
Tazz
Second Lieutenant
Posts: 155
Joined: Fri Feb 16, 2007 1:29 pm
Contact:

Post by Tazz »

thx for the replys everyone....i think i would have to do the teleport thing because i dont want to have to redo anything in radiant as then it woulod be a custom map and have to be downloaded....the teleport sounds about the most effecient so the map can remain stock....i guess if all else fails i can make a thin clip wall u have to walk around before going into the door and make the trigger reach there that way u cant just walk around the wall and trhow one.....thx again guys
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

box

Post by tltrude »

Couldn't you just spawn some solid boxes in front of the doors?
Tom Trude,

Image
Post Reply