The RPG Maker Resource Kit

RMRK RPG Maker Creation => VX => VX Scripts Database => Topic started by: worale on February 12, 2008, 12:54:04 AM

Title: +Extra Move Speed+
Post by: worale on February 12, 2008, 12:54:04 AM
Extra Move Speed
Version 1.0
by Woratana
Release Date: 11/02/2008


Introduction
You will allow to change character's speed by decimal point. e.g. +0.5, -1.2

And you can increase speed more than 6, which is the limit of speed that you can change by event command.


Features
Version 1.0
- Increase/Decrease Speed and/or character's Frequency from the original Speed/Frequency.
e.g. speed + 1 or frequency - 2.5
- Set Speed and Frequency to be more than limit.
- Easy setup speed/frequency for event.
- You can set one event's speed to be different in different event pages.


Demo
You can download demo for more understanding in this script's features.
Download Demo Version 1.0 (http://www.mediafire.com/?8dd2ww7jkmc)


Script
Place it above main.

Code: [Select]
#======================================================================
========
# [VX] Extra Move Speed by Woratana
#------------------------------------------------------------------------------
# Version: 1.0
# Released on: 11/02/2008
# by Woratana [woratana@hotmail.com]

# You can edit event's speed and/or frequency to be more than limit,
# by put event command "Comment" in the event page you want to edit.
# (Yes, you can set the different speed for different page in one event)

# Add comment like this:
# [speed(speed you want)][freq(frequncy you want)]
# e.g. [speed8][freq4]
# You can edit only speed by put [speed(speed you want)]
# and edit only frequency by put [freq(frequency you want)]

# You can increase character's Speed and/or Frequency by call script:
# (character).add_speed(speed_plus,frequency_plus)

# To decrease Speed and/or Frequency, you can just put negative number in it:
# e.g. $game_player.add_speed(-1.5)

# To change character's Speed to any number you want:
# (character).fix_speed(speed you want)

# To change character's Frequency to any number you want:
# (character).fix_frequency(frequency you want)

# Frequency shouldn't be more than 5 or 6, but there is no limit for Speed.
# You can use decimal place for speed/frequency,
# To change player's frequency, it will make no diffrent.
# It will make different in speed even though the speed is just 0.5 more.
#==============================================================================

class Game_Character
  attr_accessor :move_speed, :move_frequency
 
  def add_speed(spd = 0,freq = 0)
@move_speed += spd
@move_frequency += freq
  end
 
  def fix_speed(spd = 0)
@move_speed = spd
  end
 
  def fix_freq(freq = 0)
@move_frequency = freq
  end
 
end

class Game_Event < Game_Character
  attr_accessor :event
  alias wor_event_setup setup
 
def setup(new_page)
wor_event_setup(new_page)
  for i in 0...@list.size
next if @list[i].code != 108
if @list[i].parameters[0].include?("[speed")
  list = @list[i].parameters[0].scan(/\[speed([0.0-9.9]+)\]/)
  @move_speed = $1.to_i
end
if @list[i].parameters[0].include?("[freq")
  list = @list[i].parameters[0].scan(/\[freq([0.0-9.9]+)\]/)
  @move_frequency = $1.to_i
end
  end
end
end


Instruction

Quote
# You can edit event's speed and/or frequency to be more than limit,
# by put event command "Comment" in the event page you want to edit.
# (Yes, you can set the different speed for different page in one event)

# Add comment like this:
# [speed(speed you want)][freq(frequncy you want)]
# e.g. [speed8][freq4]
# You can edit only speed by put [speed(speed you want)]
# and edit only frequency by put [freq(frequency you want)]

# You can increase character's Speed and/or Frequency by call script:
# (character).add_speed(speed_plus,frequency_plus)

# To decrease Speed and/or Frequency, you can just put negative number in it:
# e.g. $game_player.add_speed(-1.5)

# To change character's Speed to any number you want:
# (character).fix_speed(speed you want)

# To change character's Frequency to any number you want:
# (character).fix_frequency(frequency you want)

Code: [Select]
# Frequency shouldn't be more than 5 or 6, but there is no limit for Speed.
# You can use decimal place for speed/frequency,
# To change player's frequency, it will make no diffrent.
# It will make different in speed even though the speed is just 0.5 more.

Author's Notes
Free for use in your non-commercial work if credit included. If your project is commercial, please contact me.

Please do not redistribute this script without permission. If you want to post it on any forum, please link to this topic.
Title: Re: +Extra Move Speed+
Post by: BloodyChaos on February 22, 2008, 11:59:25 PM
Demo won't download Every time i click download now it just refreshes the page
Title: Re: +Extra Move Speed+
Post by: worale on February 23, 2008, 06:05:59 AM
Well, I can download it normally.  ;)

Try to download again. If it still not work, you may have to wait a little. Because it seems like the server is in maintainance  :)


Thanks for your interest in this script~^^
Title: Re: +Extra Move Speed+
Post by: BloodyChaos on February 23, 2008, 06:12:08 AM
Oh ok thnx I'll try now  :)
Title: Re: +Extra Move Speed+
Post by: BloodyChaos on February 23, 2008, 06:16:56 AM
This Script is Perfect I am definatly using it  :) :) ;D
Title: Re: +Extra Move Speed+
Post by: worale on February 23, 2008, 08:49:54 AM
Thanks  ;)

Anyway, you may like to change edit script a little to make it work properly~
Code: [Select]
@move_speed = $1.to_i
to
Code: [Select]
@move_speed = $1.to_f

and
Code: [Select]
@move_frequency = $1.to_i
to
Code: [Select]
@move_frequency = $1.to_f

It's not require to do,

but if you don't do that, when you set number like [speed9.6], it will change to speed 10 instead of 9.6  :D

Thanks again~^^
Title: Re: +Extra Move Speed+
Post by: BloodyChaos on February 23, 2008, 09:32:13 AM
Oh ok one question I read your directions but where in the script would i change the overall speed lower when you hold shift I know a little RGSS but i couldn't fid the player spot lol maybe im blind
Title: Re: +Extra Move Speed+
Post by: worale on February 23, 2008, 05:26:08 PM
This script cannot do that :P
Title: Re: +Extra Move Speed+
Post by: BloodyChaos on February 23, 2008, 09:29:43 PM
darn lol its ok though I'll get use to it thnx agian its a great script  :)
Title: Re: +Extra Move Speed+
Post by: worale on February 23, 2008, 10:39:46 PM
Quote
Oh ok one question I read your directions but where in the script would i change the overall speed lower when you hold shift I know a little RGSS but i couldn't fid the player spot lol maybe im blind
You may want to do that by using common event with this script  ;)

something like this:
(https://rmrk.net/proxy.php?request=http%3A%2F%2Fworatana.fileave.com%2Fcevent.jpg&hash=88983d33f91675c93174ae7a4d071038ea2c40ab)

this sample image is from XP, you can do the same thing in VX  ;D
Title: Re: +Extra Move Speed+
Post by: BloodyChaos on February 24, 2008, 03:34:32 AM
Oh srry I said it the wrong way I think I meant I whant to still go faster but Just not as fast as you have it lol srry my bad ^-^
Title: Re: +Extra Move Speed+
Post by: worale on February 24, 2008, 04:45:36 AM
I see,

then change (-0.5) to positive speed  ;)
Title: Re: +Extra Move Speed+
Post by: Charbel on October 11, 2008, 01:26:58 PM
I am getting an error at line (  for i in 0...@list.size ) when any event deletes itself
help please
Title: Re: +Extra Move Speed+
Post by: Lysop on March 12, 2011, 10:48:58 PM
Here I have an example for the problem in the last post.

http://www.file-upload.net/download-3279615/Alles-Tester.zip.html

Maybe someone could look after it and correct it?
I am getting an error at line (  for i in 0...@list.size ) when any event deletes itself
help please