Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #===============================================================================
- # * [ACE] Custom Offsets
- #===============================================================================
- # * Made by: Sixth (www.rpgmakervxace.net, www.forums.rpgmakerweb.com)
- # * Version: 1.1
- # * Updated: 09/06/2016
- # * Requires: -------
- #-------------------------------------------------------------------------------
- # * < Change Log >
- #-------------------------------------------------------------------------------
- # * Version 1.0 (25/02/2016)
- # - Initial release.
- # * Version 1.1 (09/06/2016)
- # - Added compatibility with my Action Notification Popups script.
- #-------------------------------------------------------------------------------
- # * < Description >
- #-------------------------------------------------------------------------------
- # * This script will enable you to fine tune the position of the character
- # sprites on the map.
- # * Will not change the actual X and Y position of the characters on the map
- # grid, only their graphic's position!
- #-------------------------------------------------------------------------------
- # * < Installation >
- #-------------------------------------------------------------------------------
- # * Place this script below Materials but above Main!
- #-------------------------------------------------------------------------------
- # * < Compatibility Info >
- #-------------------------------------------------------------------------------
- # * No known incompatibilities.
- #-------------------------------------------------------------------------------
- # * < Known Issues >
- #-------------------------------------------------------------------------------
- # * No known issues.
- #-------------------------------------------------------------------------------
- # * < Terms of Use >
- #-------------------------------------------------------------------------------
- # * Free to use for whatever purposes you want.
- # * Credit me (Sixth) in your game, pretty please! :P
- # * Posting modified versions of this script is allowed as long as you notice me
- # about it with a link to it!
- #===============================================================================
- $imported = {} if $imported.nil?
- $imported["SixthCustomOffsets"] = true
- #===============================================================================
- # Settings:
- #===============================================================================
- module CustomOffsets
- #-----------------------------------------------------------------------------
- # Offset Settings:
- #-----------------------------------------------------------------------------
- # Because the character sprites can be changed during the game anytime, I
- # found it best to make the offset settings dependent on the image used rather
- # than reading it from a note-tag or event comment.
- # This way, the offsets will be correct even if you change the character's
- # graphic during the game, which you will most probably do more or less.
- #
- # Format:
- #
- # "image_name" => {
- # 2 => [x_offset,y_offset], # Offset when the character is facing down
- # 4 => [x_offset,y_offset], # Offset when the character is facing left
- # 6 => [x_offset,y_offset], # Offset when the character is facing right
- # 8 => [x_offset,y_offset], # Offset when the character is facing up
- # },
- #
- # So, use the file name of the images for your settings' key.
- # And you can set up different offsets for all directional cases.
- # Sometimes you would like to move that sprite 2 pixels up, but only if the
- # event is facing left, for example. Well, you can do that now.
- #
- # Setting the X offset to a positive number will make the image move to the
- # right, while a negative setting will make it move to the left.
- # Setting the Y offset to a positive number will make the image move down,
- # while a negative setting will make it move up.
- #
- # Make sure to enter the settings for all directions!
- # If you just want to set up an offset for one direction, for example, set
- # that one up how you want, and set the rest to [0,0].
- #
- # Images without a setting here will not have any offset in the game, they
- # will use the default positioning!
- #-----------------------------------------------------------------------------
- Offsets = {
- "$48x48_enemy" => {
- 2 => [0,16], 4 => [0,26], 6 => [0,36], 8 => [0,46],
- },
- "$Larve" => {
- 2 => [0,18], 4 => [0,18], 6 => [0,18], 8 => [0,18],
- },
- # Add more offset settings here!
- }
- end
- #===============================================================================
- # End of settings! Editing anything below may lead to... you know it, right? o.o
- #===============================================================================
- class Sprite_Character < Sprite_Base
- alias set_offsets7643 set_character_bitmap
- def set_character_bitmap
- set_offsets7643
- @off_dir = 0
- @notif_offset = [0,0]
- end
- alias add_offsets9975 update
- def update
- add_offsets9975
- if @off_dir != @character.direction
- if CustomOffsets::Offsets.include?(@character.character_name)
- off = CustomOffsets::Offsets[@character.character_name][@character.direction]
- @notif_offset = off
- self.ox = @cw / 2 - off[0] if @cw
- self.oy = @ch - off[1] if @ch
- end
- @off_dir = @character.direction
- end
- end
- end
- #==============================================================================
- # !!END OF SCRIPT - OHH, NOES!!
- #==============================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement