Frictional Games Forum (read-only)
[SCRIPT] Sprint Questions - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: [SCRIPT] Sprint Questions (/thread-14622.html)



Sprint Questions - JetlinerX - 04-08-2012

Hey all-

First off, is it possible to "disable sprint" and secondly, if the player is crouched, is it possible to kill them if they stand or sprint?



RE: Sprint Questions - Statyk - 04-08-2012

void SetPlayerRunSpeedMul(0);


Then just have a script area above the player so when he's crouching, he doesn't collide with it, then when he stands, he'll collide and set the player's health to 0. or give 100 damage


RE: Sprint Questions - JetlinerX - 04-08-2012

Oh, derp. Thats simple enough. Thanks Statyk. I almost forgot, +1 feedback for you good sir! Big Grin



RE: Sprint Questions - Mackiiboy - 04-09-2012

(04-08-2012, 06:50 PM)JetlinerX Wrote: Hey all-

First off, is it possible to "disable sprint" and secondly, if the player is crouched, is it possible to kill them if they stand or sprint?
.
Ya'll prolly not need this, but maybe you will if you're going to put up a script if the player starts to sprint.
Then you could put up a timer that checks the player's speed. If the player's speed gets bigger than a certain amount, then something will happen.

void speedtimer(string &in asTimer)
{
AddTimer("speedtimer", 0.2f, "speedtimer");
if (GetPlayerSpeed() >=MAX_ALLOWED_SPEED )
{
SOMETHING HAPPENS
}
}









RE: Sprint Questions - Statyk - 04-09-2012

T'anks brah. =P

And Sorry, I missed that "or sprint". Could've cleared that up but Mackiiboy has it taken care of...