RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
[Question] [ACE] Fixed picture in a script

0 Members and 1 Guest are viewing this topic.

*
Rep: +0/-0Level 39
RMRK Junior
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):
Code: [Select]
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.):
Code: [Select]
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!
« Last Edit: February 05, 2014, 07:30:25 PM by Soliah »

*
Rep: +0/-0Level 39
RMRK Junior
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.

Code: [Select]
class Game_Pictures
  def size
    return @data.size
  end
end
Code: [Select]
current_picture = $game_map.screen.pictures[$game_map.screen.pictures.size]
current_picture.show(filename, 0, pos_x, pos_y, 100, 100, 255, 0)