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
> Woratanas Sprite Mover, Well-known on VX, now ported to VXAce
FlipelyFlip
post Jun 27 2012, 10:22 PM
Post #1


Level 2
Group Icon

Group: Member
Posts: 19
Type: Writer
RM Skill: Skilled




Heyey guys,

In my need, I ported woratanas sprite mover to VX Ace. So here you get it (:

What does this script do?
Moving certain events on the map for some pixels up, down, left, right, upper left, upper right, lower left, lower right

How to Use?
In the event page that you want to move sprite, add comment:
MOVE x_plus, y_plus
x_plus: how many pixel you want to move sprite horizontally
(- number: move left | + number: move right)
y_plus: how many pixel you want to move sprite vertically
(- number: move up | + number: move down)

For example, add comment:
MOVE 0, -20
to move sprite up 20 pixel~

Where is the script?
You will get it here:

CODE
#===============================================================
# ? [VX Snippet] ? Sprite Mover ? ?
# * Move sprite in pixel to get right location~ *
#--------------------------------------------------------------
# ? by Woratana [woratana@hotmail.com]
# ? Thaiware RPG Maker Community
# ? Released on: 02/06/2008
# ? Version: 1.0
#--------------------------------------------------------------

#==================================================================
# ** HOW TO USE **
#-----------------------------------------------------------------
# * In the event page that you want to move sprite, add comment:
#  MOVE x_plus, y_plus
# ** x_plus: how many pixel you want to move sprite horizontally
# (- number: move left | + number: move right)
# ** y_plus: how many pixel you want to move sprite vertically
# (- number: move up | + number: move down)

# * For example, add comment:
#  MOVE 0, -20
# ** to move sprite up 20 pixel~
#==================================================================


class Game_Event < Game_Character
  attr_accessor :spr_move
  alias wora_mover_gameve_setup initialize

  def initialize(*args)
    wora_mover_gameve_setup(*args)
    mover = comment?('MOVE', true)
    if !mover[0]
      @spr_move = nil
    else
      @spr_move = @list[mover[1]].parameters[0].clone
      @spr_move.sub!('MOVE','').gsub!(/\s+/){''}
      @spr_move = @spr_move.split(',')
      @spr_move.each_index {|i| @spr_move[i] = @spr_move[i].to_i }
    end
  end

  def comment?(comment, return_index = false )
    if !@list.nil?
      for i in 0...@list.size - 1
        next if @list[i].code != 108
        if @list[i].parameters[0].include?(comment)
          return [true, i] if return_index
          return true
        end
      end
    end
    return [false, nil] if return_index
    return false
  end
end

class Sprite_Character < Sprite_Base
  alias wora_mover_sprcha_upd update

  def update
    wora_mover_sprcha_upd
    if @character.is_a?(Game_Event) and !@character.spr_move.nil?
      self.x = @character.screen_x + @character.spr_move[0]
      self.y = @character.screen_y + @character.spr_move[1]
    end
  end
end


Terms of Use

I'm quoting woratanas terms of use:
QUOTE (woratana)
- All the scripts I wrote in this demo can be use in any free game for free.
As long as you give me a credit in your game.

- For the commercial project, please PM me if you want to use my script, or
e-mail to woratana@hotmail.com and we can talk about it.
- Keep in mind that I'm not expecting for money, but I'm expecting for free copy
of the game.


Credits
credits goes to woratana, I don't need credits because everyone can change a simple setup to initialize (:

~Flip
Go to the top of the page
 
+Quote Post
   
Kaleb Daub
post Jun 28 2012, 05:44 AM
Post #2


Level Up!
Group Icon

Group: Revolutionary
Posts: 300
Type: Artist
RM Skill: Beginner




So like is the more detailed may to get events and characters in a good position instead of moving them over by a whole grid block or something if so that is great, but I can''t test it out though right now because my VX is a bit buggy.


__________________________
My games.
Go to the top of the page
 
+Quote Post
   
FlipelyFlip
post Jun 28 2012, 05:51 AM
Post #3


Level 2
Group Icon

Group: Member
Posts: 19
Type: Writer
RM Skill: Skilled




yeaht it's moving the events per pixel to the right position. You define the at the command Move how many pixels it should be to be moved (: but this is the version for VX Ace for the VX version just change de def initialize(*args) to def setup(*args)
Go to the top of the page
 
+Quote Post
   
Kaleb Daub
post Jun 28 2012, 08:07 AM
Post #4


Level Up!
Group Icon

Group: Revolutionary
Posts: 300
Type: Artist
RM Skill: Beginner




Oh ok I missed the top part about it being ACE. I tried it and boy this is useful for centering things up.


__________________________
My games.
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: 23rd May 2013 - 05:58 PM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker