How to change player's speed ?
I'm searching for a way to counter the speed of the player, like when he's falling.
I know there's a critical speed threshold (hardcoded btw ??), but I'd like to know if I can change it at runtime via console command in some way.
Example: I teleport the player after a high fall and so when it reappears he obviously maintain his previous speed. Ho to change it?
What I tried is using speedmod and it can stop it also, but when re-enable, the speed returns the one before.
another solution could be using a trigger_vphys, but seems cheap.
Any idea?
Thanks!
gallardo wrote:
Hi,
I'm searching for a way to counter the speed of the player, like when he's falling.
I know there's a critical speed threshold (hardcoded btw ??), but I'd like to know if I can change it at runtime via console command in some way.Example: I teleport the player after a high fall and so when it reappears he obviously maintain his previous speed. Ho to change it?
What I tried is using speedmod and it can stop it also, but when re-enable, the speed returns the one before.
another solution could be using a trigger_vphys, but seems cheap.
Any idea?
Thanks!
I'm not really sure what you mean here. Are you looking to slow the player's falling speed? Because a player_speedmod that's on all the time will do that. If you want to reduce the player's max speed throughout the map, then by all means create omnipresent trigger_vphyses that reduce the player's max velocity.
example: player is falling at 3000 "speed", I activate speedmod 0 to completely stop the player in mid-air, I deactivate speedmod (value=1), the player return to fall at speed = 3000.
I can use a vphys but I wanted toknow if there's a more refined and practical solution before.
OnCatapulted [your trigger_catapult name] Disable
OnEndTouch [your trigger_catapult name] Enable
The nice part about this is that it also takes care of physics objects.
TeamSpen210 wrote:
Don't set it to zero. I was actually experimenting with that, an it crashes the game as soon as the player touches the ground.
???
I repeated the experiment, I never encountered this problem. In any case, just set it to 1 then.
vscript is fine, but I don't know yet if the mod will run of portal2 or previous engine without script support.
thanks!