Hi, I'm trying to lower the speed of the player character.
A few things to note and explain myself better:
1- This change is global for the entire game, and the speed of the player character is never changed.
2- I'm using a Hub map. (I don't think that matters but...)
3- Basically I need to half the player movement speed, (So that now running is like walking).
4- I'm using Doom 2 as the base for my mod.
I found a few different ways to do this:
with ACS and "SetActorProperty"
script 1 ENTER
{
SetActorProperty(0, APROP_SPEED, 0.50);
}
If I understand this correctly that would be more suitable If I wanted to alter the speed during some portions of the map, or to slow down an actor. (like a freezing monster or something)
https://zdoom.org/wiki/SetActorProperty
The other way I think is in MAPINFO under the "Gameinfo" definition
with the "NormSideMove" and "NormForwardMove" properties.
But that doesn't seem to work at all, probably because I need to create a new PlayerClass? I don't know.
https://zdoom.org/wiki/MAPINFO/GameInfo_definition
It's a simple question but I want to know wich option is the best to set this up and encounter the least bugs possible.
Finally, this is vaguely related but I wanted to know a way to freeze the player completely in place,
like for a cutscene, so that movement can be resumed after a certain amount of tics.
Canceling any player input until the "action" is done.
Any help with this would be much appreciated,
Thanks.
Player Speed - Stop input
Moderator: GZDoom Developers
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Re: Player Speed - Stop input
I think it all depends what are you exactly planning to do, and what kind of mod are you making.
Personally speaking, i would avoid using the SetActorProperty for speed - Afaik it can conflict with other mods when everyone is using similar scripts.,
I see two easy methods to slow the player permanently. One is creating a new PlayerClass, with reduced speeds:
Alternatively, you could just give a PowerSpeed item to the player on first entering
For the player freezing you can actually use the [wiki]SetPlayerProperty[/wiki] function to set the TOTALLYFROZEN flag. There is an actual example for that there.
Personally speaking, i would avoid using the SetActorProperty for speed - Afaik it can conflict with other mods when everyone is using similar scripts.,
I see two easy methods to slow the player permanently. One is creating a new PlayerClass, with reduced speeds:
Code: Select all
Actor SlowPlayer : DoomPlayer
{
Player.ForwardMove 0.5,1.0
Player.SideMove 0.5,1.0
}
Code: Select all
ACTOR PowerSpeed : Powerup native
{
Powerup.Duration -999999
Speed 0.5
+POWERSPEED.NOTRAIL
+INVENTORY.HUBPOWER
}
Re: Player Speed - Stop input
That's it, It worked!
I created a new PlayerClass like you suggested, and this way it's implemented throughout the entire game.
The mod is the "Bioshock TC" and if you played the original game you know that the main character moves very slowly,
especially compared to the Doom guy who runs like a cheetah.
For future reference this is how it works (in case someone wants to do this exactly)
1- Create and edit the DECORATE and MAPINFO Lumps respectively.
2- The DECORATE code is:
(I just added the much needed reduced headbob, otherwise you'll get motion sickness)
3- The MAPINFO code is:
I checked the "SetPlayerProperty - TOTALLYFROZEN" and should also do what I need,
Thanks.
I created a new PlayerClass like you suggested, and this way it's implemented throughout the entire game.
The mod is the "Bioshock TC" and if you played the original game you know that the main character moves very slowly,
especially compared to the Doom guy who runs like a cheetah.
For future reference this is how it works (in case someone wants to do this exactly)
1- Create and edit the DECORATE and MAPINFO Lumps respectively.
2- The DECORATE code is:
Code: Select all
Actor SlowPlayer : DoomPlayer
{
Player.ForwardMove 0.5,0.5
Player.SideMove 0.5,0.5
Player.viewbob 0.5
}
3- The MAPINFO code is:
Code: Select all
GameInfo
{
PlayerClasses = "SlowPlayer"
}
Thanks.

-
- Posts: 5043
- Joined: Sun Nov 14, 2010 12:59 am
Re: Player Speed - Stop input
No. They don't need a new player class to be defined. The question is: how were you using them (the code, what did it look like)? You say it doesn't work. Do you get an error or warning in the console on start-up, or do the properties just have no effect? Also, what GZDoom version are you using?Caleb377 wrote:The other way I think is in MAPINFO under the "Gameinfo" definition
with the "NormSideMove" and "NormForwardMove" properties.
But that doesn't seem to work at all, probably because I need to create a new PlayerClass? I don't know.
Re: Player Speed - Stop input
If I remember correctly the code I tried was something like this:
I didn't get any errors, it just didn't slow the player character down.
That's definetly something I missed, since I don't ever mess with those paremeters.
I'm using the latest GZDoom 4.5.0.
But again, it's not an issue with the engine, but my lack of knowledge on these functions.
In any case It's working now, thanks to Virathas solution.
Code: Select all
gameinfo
{
NormSideMove = 14.0,20.0
NormForwardMove = 12.0,25.0
}
That's definetly something I missed, since I don't ever mess with those paremeters.
I'm using the latest GZDoom 4.5.0.
But again, it's not an issue with the engine, but my lack of knowledge on these functions.

In any case It's working now, thanks to Virathas solution.
Re: Player Speed - Stop input
I'm curious, is there a way to creation an options menu where the player can toggle between custom speed and default speed? I've been looking around Doomworld and other Discord servers and could not find an answer. I need guidance please?
-
- Posts: 874
- Joined: Mon May 10, 2021 8:08 pm
- Preferred Pronouns: He/Him
- Operating System Version (Optional): EndeavorOS (basically Arch)
- Graphics Processor: Intel with Vulkan/Metal Support
- Contact:
Re: Player Speed - Stop input
That's "possible" with cl_run and actually possible with ZScript, thanks for variables.