RPG Maker Forums

When trying to set an event's sprite through a custom script call, I have a bitmap loaded and prepared based on what the arguments for the method are. However, even though I know the bitmap is good, setting it as a pre-existing Sprite's bitmap causes it to disappear. The bitmap works perfectly fine, however in a new sprite. I do not understand why it does not work with an existing event's sprite. The code I'm using is

class Spriteset_Map attr_accessor :character_spritesendclass Scene_Map attr_accessor :spritesetendclass Game_Interpreter def get_shop_pedistal_bitmap(name, id) bitmap = Cache.character(name) id -= 1 row = id / 12 col = id % 12 puts "Bitmap Name: #{name}" sign = name[/^[\!\$]./] sign = sign.nil? ? false : sign.include?("$") sprite_width = bitmap.width / (sign ? 3 : 12) sprite_height = bitmap.height / (sign ? 4 : 8 ) btm = Bitmap.new(sprite_width, sprite_height) rect = Rect.new(row * sprite_width, col * sprite_height, sprite_width, sprite_height) btm.blt(0, 0, bitmap, rect) return btm end def swop_event_graphic(eid, gname, gid) SceneManager.scene.spriteset.character_sprites.each{|spr| if spr.character.class == Game_Event if spr.character.id == eid spr.bitmap = get_shop_pedistal_bitmap(gname, gid) end end } endend (method names have been altered for simplicity)
Any help on this bizarre issue is appreciated.

Latest Threads

Latest Profile Posts

Don't forget, aspiring writers: Personality isn't what your characters do, it is WHY they do it.
Hello! I would like to know if there are any pluggings or any way to customize how battles look?
I was thinking that when you start the battle for it to appear the eyes of your characters and opponents sorta like Ace Attorney.
Sadly I don't know how that would be possible so I would be needing help! If you can help me in any way I would really apreciate it!
The biggest debate we need to complete on which is better, Waffles or Pancakes?
rux
How is it going? :D
Day 9 of giveaways! 8 prizes today :D

Forum statistics

Threads
106,051
Messages
1,018,551
Members
137,837
Latest member
Dabi
Top