Switch weapons without suit

Got problems with your models? Struggling with textures? Get help with your custom assets.

Switch weapons without suit

Postby scojer on Thu Feb 02, 2012 9:30 pm

I'm making a mod for HL2, and there is a brief time when you start the game that you only get two weapons, but when you pick up the second one, you can't switch back to the first one without the HEV suit on. Is there a way around this?

THanks
scojer
Member
Member
 
Joined: Wed Apr 06, 2011 9:50 pm

Re: Switch weapons without suit

Postby nub on Thu Feb 02, 2012 9:54 pm

Are you just trying to keep players from sprinting by not giving them the suit? If so there's an entity that can do that for you.

The suit will of course still say things when the player gets hurt enough.


I'd imagine the only other way to get around this would be to modify some code or something..0
User avatar
nub
Veteran
Veteran
 
Joined: Tue Nov 15, 2005 1:11 am
Location: Charlotte, NC, US

Re: Switch weapons without suit

Postby scojer on Thu Feb 02, 2012 10:27 pm

No, just don't want them to have the suit right away, and I have it at a spot for them to pick it up... but I want them to be able to switch between the two weapons until they get it...
scojer
Member
Member
 
Joined: Wed Apr 06, 2011 9:50 pm

Re: Switch weapons without suit

Postby Major Banter on Thu Feb 02, 2012 11:37 pm

The easiest way is to give the player the suit at the start and have the 'short logon' flag checked. Then use a point_clientcommand to send the command 'cl_drawhud 0', which will hide the player hud from view. Finally, use the entity nub mentioned (I forget the name, somebody remind me) to disable sprint.

Rather than trying to enable weapon switiching without the HEV, which is a chore and as far as I know needs to be done through code, you can simply trick the player. The only issue with this that I've found is that the player will scroll and still hear the HEV sounds. Naturally if this is unacceptable (playtest it with a few people without telling them what you've done and see if they accept it, don't just dismiss it) you're either going to have to code around, have just one weapon for the player to use, or give them the HEV earlier.

Otherwise, as far as I know, you'll have to get coding!
ImageImageImage
Major Banter
Veteran
Veteran
 
Joined: Tue Apr 01, 2008 10:52 pm
Location: UK

Re: Switch weapons without suit

Postby nub on Fri Feb 03, 2012 3:34 am

Tricking the player is the quickest and easiest option, and probably the right choice to be honest. I don't think the weapon switch sound is a big deal really.

And when they get to the point where they're supposed to acquire the suit, you can just use a prop_dynamic version of the suit model, and have it disappear when the player touches it (via a trigger_once brush encompassing the suit model) and make the "item grab" sound play as well, just to simulate that they picked the suit up or whatever. You won't get the little animation of the character looking at his hands though. On second thought, maybe there's an ent_fire command you could use to make that animation play with the trigger_once brush and a command entity?

Oh and if the weapon switch sound bugs you enough, you could always replace it with a silent wav file. This, of course, would make it silent no matter what.

PS: I believe the entity I was referring to in my previous post was env_global or something, and you need a logic_auto to activate it too if I'm correct.
User avatar
nub
Veteran
Veteran
 
Joined: Tue Nov 15, 2005 1:11 am
Location: Charlotte, NC, US

Re: Switch weapons without suit

Postby scojer on Fri Feb 03, 2012 7:04 pm

The trick works perfectly. Thanks! I don't really care about the weapon switch sound, not a big deal to me, as I'll eventually replace the sound. This is going to become a full-blown mod one of these days.
scojer
Member
Member
 
Joined: Wed Apr 06, 2011 9:50 pm

Return to Custom Asset Help

Who is online

Users browsing this forum: No registered users