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.
Snippet Request: Coordinate Adjustment?

0 Members and 1 Guest are viewing this topic.

***
Rep:
Level 82
We learn by living...
I would like to be able to adjust the X & Y coordinates of a stationary event graphic, preferably using the event>script option if that's possible. For example, making a small adjustment to where torches or tiny NPCs appear.

***
Rep:
Level 82
aka DigiDeity
Hay,
I've written something that could help you.
Code: [Select]
class Game_Character
  attr_accessor :adjust_x
  attr_accessor :adjust_y
  alias initialize_adjust initialize unless $@
  def initialize
    initialize_adjust
    @adjust_x = 0
    @adjust_y = 0
  end
end
class Interpreter
  def adjust_graphic_coordinate(x=0,y=0)
    get_character(0).adjust_x = x
    get_character(0).adjust_y = y
  end
end
class Sprite_Character
  alias update_adjustment update unless $@
  def update
    update_adjustment
    self.x += @character.adjust_x
    self.y += @character.adjust_y
  end
end

Just type adjust_graphic_coordinate(x,y) into the Script command of any event and the graphic will change the position.
x and y can be negative too.

Deity
Greetings
DigiDeity

├Work┤
├Contact┤


***
Rep:
Level 82
We learn by living...
That's spiffy actually, though the autorun/parallel process is tricky.