VE - Pixel Movement

Victor Sant

Veteran
Veteran
Joined
Mar 17, 2012
Messages
1,694
Reaction score
1,454
First Language
Portuguese
Primarily Uses
















This script allows to replace the tile based movement where the player walks a whole 32 pixel tile each step with one that he walks only 4 pixels. It also give a better collision system for events.

Download:
Victor Engine - Pixel Movement

Credits:
Author: Victor Sant

Terms of Use
 
Last edited by a moderator:

PK8

I sense there's something in the wind...
Veteran
Joined
Mar 17, 2012
Messages
1,220
Reaction score
152
Primarily Uses
Hey, this script works quite nicely with this project I'm working on! Quick question though because I'm not too sure of it yet but when you're setting up the collision size of the event, is the collision's point of origin at the center of the event or at the top left of it?
 
Last edited by a moderator:

Lord Valdyr

Team BlackHawk Dev
Veteran
Joined
Mar 13, 2012
Messages
159
Reaction score
18
First Language
English
Primarily Uses
I'm really digging this Victor
 

Victor Sant

Veteran
Veteran
Joined
Mar 17, 2012
Messages
1,694
Reaction score
1,454
First Language
Portuguese
Primarily Uses
@PK8

it's centered horizontally, and on the event foot. So the y is basically the height of the box.

Use this code i did to check the boxes.



Code:
if $imported[:ve_pixel_movement]

class Sprite_Character < Sprite_Base
  #--------------------------------------------------------------------------
  # * Definição de bitmap do tile
  #--------------------------------------------------------------------------
  alias :set_bitmap_ve_test :set_bitmap
  def set_bitmap
    set_bitmap_ve_test
    return if @character.follower?
    setup_rect_sprite(@character.bw * 32, @character.bh * 32)
  end

  alias :set_tile_bitmap_ve_test :set_tile_bitmap
  def set_tile_bitmap
    set_tile_bitmap_ve_test
    setup_rect_sprite(32, 32)
  end

  def setup_rect_sprite(w, h)
    @rect_sprite.dispose  if @rect_sprite
    @rect_sprite = Sprite_Base.new(self.viewport)
    @rect_sprite.bitmap = Bitmap.new(w, h)
    rect1 = Rect.new(0, 0, w, h)
    rect2 = Rect.new(1, 1, w - 2, h - 2)
    @rect_sprite.bitmap.fill_rect(rect1, Color.new(255, 64, 64, 255))
    @rect_sprite.bitmap.fill_rect(rect2, Color.new(255, 64, 64, 96))
  end


  alias :update_position_ve_test :update_position
  def update_position
    update_position_ve_test
    if @rect_sprite
	  @rect_sprite.x = @character.screen_x - @character.bw * 32 / 2
	  @rect_sprite.y = @character.screen_y - @character.bh * 32 + @character.shift_y
	  @rect_sprite.z = @character.screen_z + 1
    end
  end

  alias :dispose_ve_test :dispose
  def dispose
    @rect_sprite.dispose if @rect_sprite
    dispose_ve_test
  end
end

end
 

PK8

I sense there's something in the wind...
Veteran
Joined
Mar 17, 2012
Messages
1,220
Reaction score
152
Primarily Uses
Thanks a bunch.

Hey, just got an idea for your script based on that. How about being able to set the collision size of the player, and the collision offset positioning of the player and the events?
 

Victor Sant

Veteran
Veteran
Joined
Mar 17, 2012
Messages
1,694
Reaction score
1,454
First Language
Portuguese
Primarily Uses
I thought of adding a passability for the player, but it would cause some issues. Specially because the tile passability don't take in consideration players collision area. The collision offset fall on the same subject.

If i think a solution for that i might add.
 
Last edited by a moderator:

deilin

Ranger/Elementalist
Veteran
Joined
Mar 13, 2012
Messages
1,188
Reaction score
172
First Language
English
So, in the events, when it has an event move 1 move 1, it only mobes 8 pixels rather then 2 boxes?
 

Victor Sant

Veteran
Veteran
Joined
Mar 17, 2012
Messages
1,694
Reaction score
1,454
First Language
Portuguese
Primarily Uses
So, in the events, when it has an event move 1 move 1, it only mobes 8 pixels rather then 2 boxes?
Yes and no.Although every step is 4 pixel. Every move command for events gives a pre-set number of steps. So, unless you change the default move steps as stated on the instructions, 2 movements will move 2 tiles, because each move will give 8 steps.
 

J_C

Veteran
Veteran
Joined
Jan 21, 2015
Messages
192
Reaction score
45
First Language
Hungarian
Primarily Uses
N/A







This script allows to replace the tile based movement where the player walks a whole 32 pixel tile each step with one that he walks only 4 pixels. It also give a better collision system for events.

Download:

Victor Engine - Pixel Movement

Credits:

Author: Victor Sant

Terms of Use
Victor, is it possible to change the number of pixels my character walks with each move? Right now it is 4 pixels by default, can I change this? There is a "move steps" command in the discription which I thought serves this purpose, but I couldn't get it to work.
 

Victor Sant

Veteran
Veteran
Joined
Mar 17, 2012
Messages
1,694
Reaction score
1,454
First Language
Portuguese
Primarily Uses
Victor, is it possible to change the number of pixels my character walks with each move? Right now it is 4 pixels by default, can I change this? There is a "move steps" command in the discription which I thought serves this purpose, but I couldn't get it to work.
The move steps allows the character to move more than 4 pixels. so with move steps 3 the character will move 12 pixels. You can't change it a lower number than 4 though.
 

J_C

Veteran
Veteran
Joined
Jan 21, 2015
Messages
192
Reaction score
45
First Language
Hungarian
Primarily Uses
N/A
The move steps allows the character to move more than 4 pixels. so with move steps 3 the character will move 12 pixels. You can't change it a lower number than 4 though.
Ok, thanks. 
 

Serranogun

Villager
Member
Joined
Dec 27, 2016
Messages
10
Reaction score
1
First Language
English
Primarily Uses
Text from the script instructions:



#  Events over blocked tiles will not start properly unless the event have
#  the tag <over tile>

i am sorry i must be misunderstanding, you mean putting # tag in the beginning of the event? (As comment or just text?)
 

Latest Threads

Latest Posts

Latest Profile Posts

The self-righteous indignation of family when you expect them to pay back money you've leant to them never ceases to amaze me.
Gamedev for relaxing? yes or no?
I've been having a rough couple of months and as such let down some friends of mine in the RPG Maker community. I still need time to get back to my normal self, but it's nice to be back, to read articles, and to design again (albeit at a slow pace). Hope to give updates on Kid Crescent soon.
Friendly reminder that you don't have to be able to do absolutely everything. It's okay to scale back features or assets if things are too much - especially if you're the only one working on the game! And you can always add things in later. <3
My new cutscene system makes it so much easier to add parallel stuff happening in the background, I can easily fill the whole screen with action.

Forum statistics

Threads
107,734
Messages
1,031,739
Members
139,869
Latest member
Anzi
Top