Page 1 of 1
[Code] Grabbable objects (a la Half-Life 2)
Posted: Sun Jul 07, 2013 5:38 am
by The Zombie Killer
This is a neat little bit of code that I'm using in a (yet unannounced) project that I am working on.
I thought I'd share the code because of the possibilities it opens up.
It's based on Linguica's gravity gun, but works vastly different, and the only real similarity is the math used, and even that is slightly changed.
Also, the object held will be affected by the player's pitch too.
Summon the class "pHealthBonus" and press use on it to pick it up.
Download:
Regular version
Multiplayer-compatible version*
* Work-in-progress, this should work exactly as the regular version does, except it should work online too. Currently untested online.
-TZK
Re: [Code] Grabbable objects (a la Half-Life 2)
Posted: Mon Jul 08, 2013 1:29 pm
by LucasGodzilla
Huh, could be useful for picking up medkits into a demon battle.
Re: [Code] Grabbable objects (a la Half-Life 2)
Posted: Mon Jul 08, 2013 3:44 pm
by amv2k9
It gets a little wonky around level geometry, but this is really cool. Certainly better than my bash at this kind of thing (think meleeattack with custom damagetype + A_Warp)
Re: [Code] Grabbable objects (a la Half-Life 2)
Posted: Mon Jul 08, 2013 8:52 pm
by The Zombie Killer
@LucasGodzilla
Huh, could be useful for picking up medkits into a demon battle.
I can imagine someone making a mod that makes medkits grabbable, and then grabbing them at full health and hogging them all in a corner while they're surrounded.
@amv2k9
It gets a little wonky around level geometry, but this is really cool. Certainly better than my bash at this kind of thing (think meleeattack with custom damagetype + A_Orbit)
I guess the wonkiness around level geometry could be fixed with a few little workarounds. The method you mentioned could actually be combined with this to make it Zandronum compatible. The custom meleeattack would cause the actor to use a slightly-edited version of the script that causes the object to be held by the player.
-TZK
Re: [Code] Grabbable objects (a la Half-Life 2)
Posted: Sun Jul 28, 2013 11:43 pm
by cortlong50
can i use this? because picking up grenades and tossing them away from you would be awesome.
Re: [Code] Grabbable objects (a la Half-Life 2)
Posted: Mon Jul 29, 2013 1:48 am
by The Zombie Killer
cortlong50 wrote:can i use this? because picking up grenades and tossing them away from you would be awesome.
Of course! Why do you think I posted this in the resources forum?
-TZK
Re: [Code] Grabbable objects (a la Half-Life 2)
Posted: Wed Jul 31, 2013 2:42 pm
by cortlong50
Hahaha thanks dude. Ive been messing with it and its awesome.