How to change player's speed ?
Quote from gallardo on September 13, 2013, 5:21 pmHi,
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!
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!
Quote from AntiVector on September 13, 2013, 8:19 pmgallardo 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.
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.
Did you know that American English isn't even my first language? It's actually [spoiler]British English[/spoiler]
Released maps of note:
[spoiler]Versatile Diversity
L-Circuts[/spoiler]
Quote from gallardo on September 14, 2013, 6:24 amyes, a player_speedmod does that until active, but once you disable it, the speed of the player returns the same as before.
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.
yes, a player_speedmod does that until active, but once you disable it, the speed of the player returns the same as before.
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.
Quote from FelixGriffin on September 14, 2013, 9:32 am!player RunScriptCode self.SetVelocity(Vector(0,0,0)); will kill the player's velocity instantly, although if you don't use anything else they'll immediately start falling again.
!player RunScriptCode self.SetVelocity(Vector(0,0,0)); will kill the player's velocity instantly, although if you don't use anything else they'll immediately start falling again.
Quote from AntiVector on September 14, 2013, 1:11 pmAaah, killing the player's speed in mid-air is what you want. If you don't want to mess about with scripts, then create a thin trigger_catapult where you want the player to stop. Set the Player Speed and Physics Object Speed to 1. Then, to prevent multiple stops, add two outputs to the trigger:
OnCatapulted [your trigger_catapult name] Disable
OnEndTouch [your trigger_catapult name] EnableThe nice part about this is that it also takes care of physics objects.
Aaah, killing the player's speed in mid-air is what you want. If you don't want to mess about with scripts, then create a thin trigger_catapult where you want the player to stop. Set the Player Speed and Physics Object Speed to 1. Then, to prevent multiple stops, add two outputs to the trigger:
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.
Did you know that American English isn't even my first language? It's actually [spoiler]British English[/spoiler]
Released maps of note:
[spoiler]Versatile Diversity
L-Circuts[/spoiler]

Quote from TeamSpen210 on September 14, 2013, 3:36 pmDon't set it to zero. I was actually experimenting with that, an it crashes the game as soon as the player touches the ground.
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.
[spoiler]- BEE2 Addons | (BEE2)
- Hammer Addons
Maps:
- Crushed Gel
- Gel is Not Always Helpful[/spoiler]
Quote from AntiVector on September 14, 2013, 5:54 pmTeamSpen210 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.
???
I repeated the experiment, I never encountered this problem. In any case, just set it to 1 then.
Did you know that American English isn't even my first language? It's actually [spoiler]British English[/spoiler]
Released maps of note:
[spoiler]Versatile Diversity
L-Circuts[/spoiler]
Quote from gallardo on September 22, 2013, 8:56 amI went for a trigger_vphys (same as trigger_catapult). it's ok even if a dirty solution.
vscript is fine, but I don't know yet if the mod will run of portal2 or previous engine without script support.thanks!
I went for a trigger_vphys (same as trigger_catapult). it's ok even if a dirty solution.
vscript is fine, but I don't know yet if the mod will run of portal2 or previous engine without script support.
thanks!