RMRK is retiring.
Server is paid up for the rest of 2026, but the forum may go after that. See here for more information. Please archive or save anything you would like to keep before 2027.
Main Menu
  • Welcome to The RPG Maker Resource Kit.

[Question] [ACE] Fixed picture in a script

Started by Soliah, February 05, 2014, 06:49:47 PM

0 Members and 1 Guest are viewing this topic.

Soliah

Hi!
I'm new here, and I don't know how everything works around, so please tell me if I'm mistaken somehow! (and I'm french, so I'll probably use a weird english... ;))

Well, I have a problem with a script I'm trying to create for a puzzle game, working on ACE.
I want to create a picture over an event which is moving thanks to the script. I mean: the event is created, the script is called, the event move thanks to the script (not "move route" nor "autonomous movement"), and everytime the script moves, I want to create a picture over it.
But, I want this picture to be fixed from the map point of view. So, I've tried to use the script of modern algebra http://rmrk.net/index.php?topic=39052.0, which is wonderful, but doesn't work with my piece of code (the event is calling this code):
class Game_Character < Game_CharacterBase
# some codes
  sprite = Sprite.new($spriteset_vp1)
  sprite.bitmap = Cache.picture(filename)
  sprite.x = @x * 32
  sprite.y = @y * 32
# some codes
end


I've also tried something like that, inspired from another script (and I have renamed the file.):
class Sprite_Character < Sprite_Base
  def update
    super
    update_bitmap
    update_src_rect
    if @character.character_name.include?("[FIXED]")
      self.x -= $game_map.display_x * 32
      self.y -= $game_map.display_y * 32
    else
      update_position
    end
    update_other
    update_balloon
    setup_new_effect
  end
end


Everything seems to be allright, his script is above mine. But it just doesn't work :(
If anybody know how I can't fix that, I would be eternally thankful! And If you need anything else, just tell me!

Soliah

If someone wonders, you just have to add the Game_Picture (called "current_picture" in my code) to the always existing Game_Pictures "$game_map.screen.pictures" array. Then you show it. I also overcharged the class Game_Pictures to get its current size, I don't know if you can get this somehow else.

class Game_Pictures
  def size
    return @data.size
  end
end

current_picture = $game_map.screen.pictures[$game_map.screen.pictures.size]
current_picture.show(filename, 0, pos_x, pos_y, 100, 100, 255, 0)