[Code] Grabbable objects (a la Half-Life 2)

Post your example zscripts/ACS scripts/etc here.

[Code] Grabbable objects (a la Half-Life 2)

Postby The Zombie Killer » Sun Jul 07, 2013 6:38 am

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.

Image

-TZK
User avatar
The Zombie Killer
King of the Kangaroos
 
Joined: 14 Jul 2011
Location: Gold Coast, Queensland, Australia
Discord: Zombie#1795

Re: [Code] Grabbable objects (a la Half-Life 2)

Postby LucasGodzilla » Mon Jul 08, 2013 2:29 pm

Huh, could be useful for picking up medkits into a demon battle.
User avatar
LucasGodzilla
 
Joined: 12 May 2013
Location: California

Re: [Code] Grabbable objects (a la Half-Life 2)

Postby amv2k9 » Mon Jul 08, 2013 4:44 pm

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)
Last edited by amv2k9 on Wed Jul 10, 2013 7:33 pm, edited 1 time in total.
User avatar
amv2k9
That Strife Guy
 
Joined: 10 Jan 2010
Location: Southern California

Re: [Code] Grabbable objects (a la Half-Life 2)

Postby The Zombie Killer » Mon Jul 08, 2013 9:52 pm

@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
User avatar
The Zombie Killer
King of the Kangaroos
 
Joined: 14 Jul 2011
Location: Gold Coast, Queensland, Australia
Discord: Zombie#1795

Re: [Code] Grabbable objects (a la Half-Life 2)

Postby cortlong50 » Mon Jul 29, 2013 12:43 am

can i use this? because picking up grenades and tossing them away from you would be awesome.
User avatar
cortlong50
editing my comments ad nauseam
 
Joined: 24 Jun 2013
Location: UT-WA

Re: [Code] Grabbable objects (a la Half-Life 2)

Postby The Zombie Killer » Mon Jul 29, 2013 2:48 am

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? :p

-TZK
User avatar
The Zombie Killer
King of the Kangaroos
 
Joined: 14 Jul 2011
Location: Gold Coast, Queensland, Australia
Discord: Zombie#1795

Re: [Code] Grabbable objects (a la Half-Life 2)

Postby cortlong50 » Wed Jul 31, 2013 3:42 pm

Hahaha thanks dude. Ive been messing with it and its awesome.
User avatar
cortlong50
editing my comments ad nauseam
 
Joined: 24 Jun 2013
Location: UT-WA


Return to Script Library

Who is online

Users browsing this forum: No registered users and 0 guests