Centering larger sprites (Falcao Pearl ABS)

KingHazeel

Veteran
Veteran
Joined
Jul 5, 2018
Messages
125
Reaction score
5
First Language
English
Primarily Uses
RMVXA
I'm hoping this is the right place to post this? If not, I'm sorry. ^^; But basically, I'm using a script, Falcao Pearl ABS and I'm trying to create a projectile that is basically a flame wall. I have the flame wall sprite made, however, when using it as the Tool Graphic for the projectile skill, it's one-sided.

Basically, a projectile for this script is like shooting out an NPC. And in this case, it just treats the flame wall like a very tall NPC, with the bottom of the graphic starting from the bottom not the center. I was wondering if anyone had an idea how I could set things so sprites would shoot from the center.

The sprite in question:

As well as the script:

https://www.rpgmakercentral.com/topic/8809-falcao-pearl-abs-liquid-v3-update/
 

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
5,635
Reaction score
5,116
First Language
English
Primarily Uses
RMVXA
There might be parameters in Pearl for this kind of thing, but have you tried just adding blank space to the edges of the sprite? I think you'd want to add ~16 pixels of blank space to both the top and bottom for the "vertical" sprites, and ~16 pixels to the left and right edges of the "horizontal" sprites, making sure that the additions total 32 pixels (or some multiple of 32) to keep things clean.
 

KingHazeel

Veteran
Veteran
Joined
Jul 5, 2018
Messages
125
Reaction score
5
First Language
English
Primarily Uses
RMVXA
Hmmm, the sprite comes out cleanly from what I can see, it's just the matter of it being "lopsided".
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,430
Reaction score
7,711
First Language
German
Primarily Uses
RMMV
can you give an example of what exactly you mean by "lopsided"?

I can think of only two possible causes at the moment:
Either the sprite itself is not correctly centered (which would have to be corrected in an image program) or you failed to declare it as an object sprite (! at the beginning of the filename) because objects align to the grid, people sprites are shifted to walk inside the grid.
 

gstv87

Veteran
Veteran
Joined
Oct 20, 2015
Messages
2,254
Reaction score
1,254
First Language
Spanish
Primarily Uses
RMVXA
can you post a screenshot of how it looks and how it should look like?
I've helped another used a few days ago with a similar problem.... it shouldn't be hard to just copy that solution.
 

KingHazeel

Veteran
Veteran
Joined
Jul 5, 2018
Messages
125
Reaction score
5
First Language
English
Primarily Uses
RMVXA
This is what I mean:

Rather than shooting from the center, it shoots from the side, starting "feet first" like a really tall NPC.

Here's a halfassed representation MS Paint of what it should look like |,D

 

gstv87

Veteran
Veteran
Joined
Oct 20, 2015
Messages
2,254
Reaction score
1,254
First Language
Spanish
Primarily Uses
RMVXA
Code:
class Sprite_Character < Sprite_Base
 alias set_character_bitmap_orig set_character_bitmap
 def set_character_bitmap
  fx = nil
  set_character_bitmap_orig
  array = ["name1", "name2", "name3", "nameN"]
  fx = array.any?{|name| @character_name[/#{name.to_s.downcase}/i]}
  if fx != nil
   self.oy = @ch / 2
  end
 end
end
try this.
replace the "nameX" names in the array, with whatever name you gave to that sheet, or sheets if there's more than one, it should handle multiple sheets.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,430
Reaction score
7,711
First Language
German
Primarily Uses
RMMV
Sprites are always centered bottom by default - NOT absolutely centered. The reason is that because otherwise, larger people-sprites will not look as if they are walking on the roads while being bigger.
To change that you'll need to modify the engine itself - and that always has a risk of breaking other parts of the engine, especially with a script that already changes the engine to an ABS. I hope the solution above will work for you because there are no real alternatives.
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
2,674
Reaction score
566
First Language
English
Primarily Uses
RMVXA
The code works but it causes all graphics to be adjusted down half way. My map had the character not able to reach the top and gets cut off at the bottom.
The better way would be to put the event for the graphic at the top of the trees. then it will show as you intended.
 

KingHazeel

Veteran
Veteran
Joined
Jul 5, 2018
Messages
125
Reaction score
5
First Language
English
Primarily Uses
RMVXA
The code works but it causes all graphics to be adjusted down half way. My map had the character not able to reach the top and gets cut off at the bottom.
The better way would be to put the event for the graphic at the top of the trees. then it will show as you intended.
That's, uh...not how it works. ^^; I don't set the event location. It shoots from the player like a projectile. You are basically shooting an event. You could even shoot NPCs if you wanted to. Because the sprite comes from the player, I don't get decide where it goes. All I can (hopefully) do is center it.

EDIT: Although maybe this is the answer after all? Maybe instead of centering the sprite, perhaps there's a way to alter the script so the event itself shoots out from a different spot. I.e. 4 tiles below the player? And perhaps I could add a comment tag that determines this number. I would need to make sure that only the sprite is moved and not the projectile itself.

Sprites are always centered bottom by default - NOT absolutely centered. The reason is that because otherwise, larger people-sprites will not look as if they are walking on the roads while being bigger.
To change that you'll need to modify the engine itself - and that always has a risk of breaking other parts of the engine, especially with a script that already changes the engine to an ABS. I hope the solution above will work for you because there are no real alternatives.
I'm aware. gstv's solution does do what I want...but unfortunately it effects all NPCs. I'm hoping it's possible to have this effect only occur with projectiles. I don't know enough about Ruby or scripting to know if it's possible. Maybe when I get home I can monkey around, figure out how the projectile script works and maybe jury-rig something involving gstv's solution.
 
Last edited:

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
2,674
Reaction score
566
First Language
English
Primarily Uses
RMVXA
Sorry, forgot it's the pearl abs script.
 

gstv87

Veteran
Veteran
Joined
Oct 20, 2015
Messages
2,254
Reaction score
1,254
First Language
Spanish
Primarily Uses
RMVXA
it will only affect the sprites you specify in the array, by name.
make sure your custom sprites have unique names.
 

KingHazeel

Veteran
Veteran
Joined
Jul 5, 2018
Messages
125
Reaction score
5
First Language
English
Primarily Uses
RMVXA
Maybe I'm misunderstanding something then. ^^;

Code:
class Sprite_Character < Sprite_Base
 alias set_character_bitmap_orig set_character_bitmap
 def set_character_bitmap
  fx = nil
  set_character_bitmap_orig
  array = ["$FireWall"]
  fx = array.any?{|name| @character_name[/#{name.to_s.downcase}/i]}
  if fx != nil
   self.oy = @ch / 2
  end
 end
end
This is how I'm using the code, with $FireWall being the name of the sprite the projectile is using.



The wall of flames are centered...but...so is the door....and the sign. XD
 

gstv87

Veteran
Veteran
Joined
Oct 20, 2015
Messages
2,254
Reaction score
1,254
First Language
Spanish
Primarily Uses
RMVXA
try replacing the IF statement.
Code:
if array.any?{|name| @character_name[/#{name.to_s.downcase}/i]}
remove fx = array....
I was thinking it would return the actual string, but maybe it's returning true to the .any?, so fx is true, and indeed not-nil, and the condition is validating every time.
 
Last edited:

KingHazeel

Veteran
Veteran
Joined
Jul 5, 2018
Messages
125
Reaction score
5
First Language
English
Primarily Uses
RMVXA
Code:
class Sprite_Character < Sprite_Base
 alias set_character_bitmap_orig set_character_bitmap
 def set_character_bitmap
  fx = nil
  set_character_bitmap_orig
  array = ["FireWall"]
  if array.any?{|name| @character_name[/#{name.to_s.downcase}/i]}
   self.oy = @ch / 2
  end
 end
end
It works. Posting the full code in case anyone else wants to use it. Thanks for the help!
 

gstv87

Veteran
Veteran
Joined
Oct 20, 2015
Messages
2,254
Reaction score
1,254
First Language
Spanish
Primarily Uses
RMVXA
fx = nil => array = nil

or, remove it altogether, it's not needed anymore
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!
one bad plugin combo later and one of my followers is moonwalking off the screen on his own... I didn't even more yet on the new map lol.

Forum statistics

Threads
106,034
Messages
1,018,447
Members
137,820
Latest member
georg09byron
Top