Victor Sant

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

zQ6pp21.png


pixel-movement-name.png













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,458
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,458
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,190
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,458
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
zQ6pp21.png


pixel-movement-name.png





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,458
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

Working on a new Visual Novel, it's my first one so I hope people enjoy it! :D
TIL, TP means Tactical Points.
I think those extra pixels did it. ^_^ Now to work on the front and back views.
PlusTest-02.gif
What props/tiles are missing from this scene?

My team recruitment thread is finally online. Please, if you guys are interested in language learning, take a look. Even if you don't join, a word of encouragement is always welcome.

Forum statistics

Threads
116,470
Messages
1,098,916
Members
152,055
Latest member
KeinHexer
Top