conditional player movement.
Moderator: InsideQC Admins
3 posts
• Page 1 of 1
conditional player movement.
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.
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
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.
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
3 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest