Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

 
Reply to this topicStart new topic
> Decimal Movement Speed, Slow is too slow and Fast is too fast
DaklozeDuif
post Dec 26 2012, 08:30 AM
Post #1



Group Icon

Group: Member
Posts: 2
Type: None
RM Skill: Undisclosed




Skipping the pointless introduction:
I want the player to move faster than 3:Slow but slower than 4:Fast.
Not only that, but I want a certain NPC to mover only slightly slower than the player. (about 5% or 10%)

Is it possible to set a player/event's movement speed to, for example, 3.2 or 3.5? If yes, how?

Thanks in advance. thumbsup.gif
Go to the top of the page
 
+Quote Post
   
Jens of Zanicuud
post Dec 28 2012, 02:53 AM
Post #2


Dark Jentleman
Group Icon

Group: Local Mod
Posts: 904
Type: Scripter
RM Skill: Skilled
Rev Points: 120




That's slighltly easy to do smile.gif

Just add this code snippet in a blank above main:

CODE
class Game_Character
def speed(value)
  @move_speed = [value,0].max
end
end


and then, via move event, use the call script function and call it this way:

CODE
speed([number])


where [number] should be replaced with the desired speed (let's say... 1.2; 3.5; 4.4... or whatever).
Negative numbers are not allowed.

I hope this can help,

Jens


__________________________
"Thorns are the rose's sweetest essence..."
-Jens of Zanicuud


Games I'm working on:
>

official website: TryAdIne eFfeCt

>

Games I worked on (mainly as a scripter):
>
(Warning: it's a 3rr3's project and it's in Italian!)


Awards

Go to the top of the page
 
+Quote Post
   
DaklozeDuif
post Dec 28 2012, 07:29 AM
Post #3



Group Icon

Group: Member
Posts: 2
Type: None
RM Skill: Undisclosed




That was easy. Exactly what I was looking for. Thanks!
Go to the top of the page
 
+Quote Post
   

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 19th May 2013 - 03:25 AM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker