RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
Character speed decreasing and increasing

0 Members and 1 Guest are viewing this topic.

***
Rep:
Level 86
I hate everyone except the ones I don't hate...
As most will probably already know, you can easily change the speed and frequency of characters in the game using simple events, or (I wager) with scripts. However, there are only 6 speeds to choose from. My question is this:

How would I go about using a 4.1 speed for example?
I'd like it for using call scripts, and being able to use it in conditional branches.

(I'm making a minigame where you race against an NPC - speed is of big matter here!)
I wonder how many of my-reps are there for a reason, and not just because some jackass wanted to show off in front of some other jackasses...?
Probably a lot of them - and those people sure as hell don't deserve my pity, let alone my disgust.
That's right, let's see some more -Rep'ing! BOOYEAH!!

*
? ? ? ? ? ? ? ? ? The nice kind of alien~
Rep:
Level 92
Martian - Occasionally kind
First we need a way to access and write to the move speed.
This basically means that you should copy and paste the following code somewhere above main in the script editor.
Code: [Select]
class Game_Character
  attr_accessor :move_speed
end

After this you can set the movement speed through script calls
Code: [Select]
$game_player.move_speed = 4.5 # Set it to 4.5
$game_player.move_speed -= 0.1 # Decrease by 0.1
$game_player.move_speed += 0.1 # Increase by 0.1

For conditional branch you can put something like this in the script part:
Code: [Select]
$game_player.move_speed > 4.5
This will check if the movement speed is above 4.5. If not, then the else branch is run instead (if it exists).

The comparisons you can are:
Code: [Select]
>  # Greater than
>= # Greater than or equals
== # Equals
<= # Less than or equals
<  # Less than
!= # Not equals

I hope this is enough for you to figure out the rest

*hugs*
 - Zeriab

***
Rep:
Level 86
I hate everyone except the ones I don't hate...
GREAT! Thanks! Exactly what I needed. ;D
I wonder how many of my-reps are there for a reason, and not just because some jackass wanted to show off in front of some other jackasses...?
Probably a lot of them - and those people sure as hell don't deserve my pity, let alone my disgust.
That's right, let's see some more -Rep'ing! BOOYEAH!!