Script to change the offset of PCs/NPCs?

AttentionEPIC

Villager
Member
Joined
May 23, 2019
Messages
6
Reaction score
0
First Language
English
Primarily Uses
RMVXA
It's pretty self-explanatory...

A script to change the offset of characters in X and/or Y values - avoiding changing the offset of stationary objects (doors, lights, switches, etc).

For example:
 

Attachments

Last edited:

Heirukichi

Veteran
Veteran
Joined
Sep 24, 2015
Messages
1,388
Reaction score
582
First Language
Italian
Primarily Uses
RMVXA
Here is a little something for you.
Code:
#========================================================
# Author: Heirukichi
# Last update: 05-26-2019 [MM-DD-YYYY]
# License: CC 4.0 BY-SA
#========================================================

module HRK_CHOFS

  #======================================================
  # Set this to false if you want to use the default offset
  #======================================================
  USE_CUSTOM_OFFSET = true
 
  #======================================================
  # Change these to be your character offset
  #======================================================
  OFFSET_FOR_CHARACTERS_X = 12
  OFFSET_FOR_CHARACTERS_Y = 12

  #======================================================
  # - - - WARNING! Do not modify after this point!
  #======================================================
  def self.custom_offset?
    USE_CUSTOM_OFFSET
  end

  def self.shift_y
    OFFSET_FOR_CHARACTERS_Y
  end

  def self.shift_x
    return 0 unless custom_offset?
    OFFSET_FOR_CHARACTERS_X
  end
end

#========================================================
# * Game_CharacterBase class
#========================================================
class Game_CharacterBase
 
  alias hrk_chofs_shift_y_old shift_y
  def shift_y
    if  HRK_CHOFS.custom_offset?
      object_character? ? 0 : HRK_CHOFS.shift_y
    else
      hrk_chofs_shift_y_old
    end
  end

  def shift_x
    object_character? ? 0 : HRK_CHOFS.shift_x
  end

  alias hrk_chofs_screen_x_old screen_x
  def screen_x
    hrk_chofs_screen_x_old - shift_x
  end

end

P.S. I hope this does what you want (the image link is broken).
 
Last edited:

Heirukichi

Veteran
Veteran
Joined
Sep 24, 2015
Messages
1,388
Reaction score
582
First Language
Italian
Primarily Uses
RMVXA
Of course 0,0 probably won't be as I put it but it wasn't a necessity. I will return to see if it works for me. Thank you.
It should be exactly as it is in the picture as long as you set the custom offset to true.
 

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

Latest Threads

Latest Profile Posts

I want to see the Features of the new RPG Maker.. NOW!!
Can't wait for it!
KDS
Check out some gameplay of a game iam working on :)
Me : "Wearing glasses is annoying."
*put out glasses*
Also me : "Keep mistaking 0, 6 and 8."
oh god, a new version of RPG Maker is coming soon already....
So a new RPG Maker has been teased on RPG Maker Web's Twitter. Hmm...

Forum statistics

Threads
98,126
Messages
949,482
Members
129,404
Latest member
alvin23
Top