Hi everyone,
Ive checked the help file wondering if there is a command to slow down the players movements. Looking to have an effect placed on the player to slow them down for a time period. I did try using lockplayer unlockplayer with waits inside a loop but the effect was choppy and not what I wanted. Any advice would be appreciated much thanks in advance.
Page 1 of 1
Slow down player movment command exist? Suggestion
#2
Posted 20 January 2024 - 07:14 AM
Unfortunately there's not. The reason the lockplayer/unlockplayer loop is bad is because the player is controlled with cursor keys and autorepeat, which means the player only moves one tile when a key is pressed, but if you hold it, the player moves multiple tiles. This means the player can be finely controlled with individual keystrokes, but that you can move longer distances in one direction by holding down a key. This is what you want, but in the context of a robot locking and unlocking the player every cycle, these fine motions are lost because around 50% of the time they won't be registered. Ideally, what you would have with a slowed down player is the same precise individual movement, but the hold down movement is slowed.
Here's something hacky that may be more along the lines of the kind of thing you want:
Upon detecting a player movement, we lock the player for a cycle. This means that the player will remain responsive but won't be able to move more than 1 tile in 2 cycles.
Here's something hacky that may be more along the lines of the kind of thing you want:
: "l" set "local2" to "('playerx'x'playery')" wait for 1 if "('playerx'x'playery')" != "local2" then "mov" goto "l" : "mov" lockplayer wait for 1 unlockplayer goto "l"
Upon detecting a player movement, we lock the player for a cycle. This means that the player will remain responsive but won't be able to move more than 1 tile in 2 cycles.
<Malwyn> Yes, yes. Don't worry I'd rather masturbate with broken glass than ask you for help again. :(
#3
Posted 21 January 2024 - 02:09 AM
Thank you for the code suggestion and why it was not working i get it now, lol
#4
Posted 21 January 2024 - 03:04 AM
I just used it and it is working a lot better thank you ... off to coding
This post has been edited by Mr Goof: 21 January 2024 - 03:06 AM
Share this topic:
Page 1 of 1