Forum

conditional player movement.

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

conditional player movement.

Postby something » Thu Apr 29, 2010 9:25 am

hey,

does anyone have any ideas on would be the best way to code player movement restrictions that changes depending on conditions, such as

*taking damage
*low health
*mid health
*normal health
*'drunken' view depending on health.

i know i can do something like

if health < 50
stuffcmd(blahblah)

but that means i have to write out conditions for each health bracket and there is no blending between them unless i explicitly code it all health points, eg 1,2,3,4,5,6,7,8, etc,

ive tried generating a value for use in a stuff cmd. but it treats it as 2 separate values or something.

its probably something really obvious that i missed.
but im a dumbdumb so any help is apreciated.

i assume csqc would probably be able to do this but im totally lost in csqc over just slightly lost in qc.
something
 
Posts: 27
Joined: Tue Apr 20, 2010 2:02 pm
Location: Melbourne,Au

Postby Spike » Thu Apr 29, 2010 9:53 am

stuffcmd(self, "v_idlescale ");
stuffcmd(self, ftos(howmuch));
stuffcmd(self, "\n");

?

if you want it tied to damage then it'll be a bit poo, as there's no interpolation, and it'll snap. It'll also fail to respond to the direction damage was taken from.
csqc has full control over the client's angles, yeah. Which can be smoothed and could end up a lot better than spamming idlescale constantly. But changing the player's view angle constantly is more than a little annoying.

.float maxspeed; can be used if you want to slow the player down a little when they're hurt.
Spike
 
Posts: 2892
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Postby something » Thu Apr 29, 2010 9:48 pm

thanks, pretty much what i had. except now i can just have some math work out the values.
something
 
Posts: 27
Joined: Tue Apr 20, 2010 2:02 pm
Location: Melbourne,Au


Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 1 guest