- Joined
- Apr 5, 2014
- Messages
- 16
- Reaction score
- 0
- First Language
- English
- Primarily Uses
I'm using several of the MOG/Atelier RGSS battle scripts for a game I'm working on, basically because I want to keep the standard style of battle system but want it to look snazzier. Anyway I'm trying to customize the interface and I ran into a problem with the Battle Cursor. I want it to display over the top of the enemy battler, as I edited the cursor image to point downward. I tried setting this by just making a high negative value to move the image up higher when it's displayed, but the problem is enemies vary in height, so on some it will be perfect and on others it will be 10 feet above them or on their body even. Is there a script command I can use to make the cursor image appear at or preferably right above the top of the height axis for the enemy battler?
Here is the code for the Battle Cursor, google translated to english:
Note: I use -250 for the the second numerical in CURSOR_POSITION to set it above the head of a person sized enemy, like a zombie or skeleton or bandit. Like I said though that causes problems with bigger or smaller monsters.
Here is the code for the Battle Cursor, google translated to english:
# ================================================= =============================MOG + + + # - Battle Cursor ( 1.2) + + +# ================================================= =============================# By Moghunter# http://www.atelier-rgss.com/# ================================================= =============================# System animated cursor in battle sprites of battlers .# ================================================= =============================# File needed . (Graphics / System)## Battle_Cursor.png## ================================================= =============================# ================================================= =============================# ■ SETTING CURSOR# ================================================= =============================module MOG_BATTLE_CURSOR # Setting the cursor position to the target . CURSOR_POSITION = [ -45 , -16 ] # Definition of the position of the target name . CURSOR_NAME_POSITION = [ -10 , 35] # Enable slide effect . CURSOR_SLIDE_EFFECT = true # Enable Animation levitation . CURSOR_FLOAT_EFFECT = true # Set the priority of the cursor. CURSOR_Z = 0end$ imported = { } if $ imported.nil ?$ imported [ : mog_battle_cursor ] = true# ================================================= =============================■ # Game Season# ================================================= =============================class Game_Temp attr_accessor : battle_cursor # ------------------------------------------------- ------------------------- ● # Initialize # ------------------------------------------------- ------------------------- alias initialize mog_battle_cursor_initialize def initialize @ battle_cursor = [0,0 , false , " " ] mog_battle_cursor_initialize end end# ================================================= =============================# ■ spriteset Battle Cursor# ================================================= =============================class Sprite_Battle_Cursor < Sprite include MOG_BATTLE_CURSOR # ------------------------------------------------- ------------------------- ● # Initialize # ------------------------------------------------- ------------------------- def initialize ( viewport = nil ) super ( viewport ) $ game_temp.battle_cursor = [0,0 , false , " " ] self.bitmap = Cache.system ( " Battle_Cursor " ) self.visible game_temp.battle_cursor = $ [2] self.z = CURSOR_Z self.z = 10 if $ mog_rgss3_battle_hud ! = nil @ cursor_name = Sprite.new @ cursor_name.bitmap Bitmap.new = ( 120.32 ) cursor_name.z @ + = 1 self.z @ 16 = cursor_name.bitmap.font.size = $ @ cursor_name_enemy game_temp.battle_cursor [3] @ cursor_name_position = [ CURSOR_NAME_POSITION [0] , CURSOR_NAME_POSITION [1] ] @ cursor_float = [ 0,0] refresh_cursor_name end # ------------------------------------------------- ------------------------- # ● Dispose Sprite # ------------------------------------------------- ------------------------- def dispose super dispose_sprite_cursor end # ------------------------------------------------- ------------------------- # ● Dispose Sprite Cursor # ------------------------------------------------- ------------------------- dispose_sprite_cursor def if @ cursor_name ! = nil @ cursor_name.bitmap.dispose @ cursor_name.dispose end self.bitmap.dispose end # ------------------------------------------------- ------------------------- # Cursor Name ● Refresh # ------------------------------------------------- ------------------------- def refresh_cursor_name = $ @ cursor_name_enemy game_temp.battle_cursor [3] @ cursor_name.bitmap.clear @ cursor_name.bitmap.draw_text ( 0,0,120,32 , cursor_name_enemy.to_s @ 1 ) end # ------------------------------------------------- ------------------------- # ● Update # ------------------------------------------------- ------------------------- def update super update_sprite_cursor end # ------------------------------------------------- ------------------------- ● Update # Sprite Cursor # ------------------------------------------------- ------------------------- update_sprite_cursor def update_visible update_cursor_float_effect execute_move ( 0, self.x , $ game_temp.battle_cursor [0] ) execute_move (1, self.y , game_temp.battle_cursor $ [1 ] + @ cursor_float [1] ) update_sprite_name end # ------------------------------------------------- ------------------------- ● Update # Visible # ------------------------------------------------- ------------------------- update_visible def self.visible game_temp.battle_cursor = $ [2] if! self.visible self.x = -64 self.y = -64 end end # ------------------------------------------------- ------------------------- ● Update # Sprite Name # ------------------------------------------------- ------------------------- def update_sprite_name return if @ cursor_name == nil refresh_cursor_name if @ cursor_name_enemy ! = $ game_temp.battle_cursor [ 3 ] cursor_name.x @ @ + = self.x cursor_name_position [0] cursor_name.y self.y + = @ @ cursor_name_position [1] @ cursor_name.opacity = self.opacity @ cursor_name.visible = self.visible end # ------------------------------------------------- ------------------------- ● Update Cursor # Float Effect # ------------------------------------------------- ------------------------- update_cursor_float_effect def return if! CURSOR_FLOAT_EFFECT @ cursor_float [0] + = 1 case @ cursor_float [ 0 ] When 0 .. 20 @ cursor_float [1] = 1 + When 21 .. 40 @ cursor_float [1] - = 1 else @ cursor_float [0] = 0 @ cursor_float [1] = 0 end end # ------------------------------------------------- ------------------------- ● Perform Move # # ------------------------------------------------- ------------------------- def execute_move ( type, cp , np ) sp = 5 + ( ( cp - . np ) abs / 5 ) if cp > np cp - sp = cp = cp if np < np elsif cp < np cp = sp + cp = cp if np > np end self.x = cp if type == 0 self.y = cp if type == 1 end end# ================================================= =============================■ Battle # spriteset# ================================================= =============================class Spriteset_Battle # ------------------------------------------------- ------------------------- ● # Initialize # ------------------------------------------------- ------------------------- alias initialize mog_battle_cursor_initialize def initialize mog_battle_cursor_initialize create_cursor end # ------------------------------------------------- ------------------------- ● Dispose # # ------------------------------------------------- ------------------------- alias dispose mog_battle_cursor_dispose def dispose mog_battle_cursor_dispose dispose_cursor end # ------------------------------------------------- ------------------------- # ● Update # ------------------------------------------------- ------------------------- alias update mog_battle_cursor_update def update mog_battle_cursor_update update_battle_cursor end # ------------------------------------------------- ------------------------- # ● Create_Cursor # ------------------------------------------------- ------------------------- create_cursor def return if @ battle_cursor ! = nil @ battle_cursor = Sprite_Battle_Cursor.new end # ------------------------------------------------- ------------------------- # ● Dispose Cursor # ------------------------------------------------- ------------------------- dispose_cursor def return if @ battle_cursor == nil @ battle_cursor.dispose end # ------------------------------------------------- ------------------------- # ● Battle Update Cursor # ------------------------------------------------- ------------------------- update_battle_cursor def return if @ battle_cursor == nil @ battle_cursor.update end end# ================================================= =============================■ Battle # Cursor Index# ================================================= =============================module Battle_Cursor_index include MOG_BATTLE_CURSOR # ------------------------------------------------- ------------------------- # ● Index Check Limit # ------------------------------------------------- ------------------------- check_index_limit def self.index = 0 if self.index > = item_max self.index = ( item_max - 1 ) if self.index < 0 end # ------------------------------------------------- ------------------------- Set Cursor Position # ● Enemy # ------------------------------------------------- ------------------------- set_cursor_position_enemy def return if! self.active $ game_temp.battle_cursor [0] = $ game_troop.alive_members [ self.index ] . screen_x + CURSOR_POSITION [0] rescue nil $ game_temp.battle_cursor [1] = $ game_troop.alive_members [ self.index ] . screen_y + CURSOR_POSITION [1] rescue nil $ game_temp.battle_cursor rescue [ 3 ] = $ game_troop.alive_members [ self.index ] . name nil $ game_temp.battle_cursor = [0,0 , false , 0 ] if $ game_temp.battle_cursor [ 0 ] == nil end # ------------------------------------------------- ------------------------- Set Cursor Position # ● Actor # ------------------------------------------------- ------------------------- def set_cursor_position_actor return if! self.active $ game_temp.battle_cursor [0] = $ game_party.members [ self.index ] . screen_x + CURSOR_POSITION [0] rescue nil $ game_temp.battle_cursor [1] = $ game_party.members [ self.index ] . screen_y + CURSOR_POSITION [1] rescue nil $ game_temp.battle_cursor rescue [ 3 ] = $ game_party.members [ self.index ] . name nil $ game_temp.battle_cursor = [0,0 , false , 0 ] if $ game_temp.battle_cursor [ 0 ] == nil end # ------------------------------------------------- ------------------------- # ● Move Cursor Process # ------------------------------------------------- ------------------------- def process_cursor_move return unless cursor_movable ? last_index = @ index cursor_move_index ( +1 ) if Input.repeat ( : DOWN ) cursor_move_index ( -1 ) if Input.repeat ( : UP ) cursor_move_index ( +1 ) if Input.repeat ( : RIGHT ) cursor_move_index ( -1 ) if Input.repeat ( LEFT ) if @ index ! = last_index Sound.play_cursor end end # ------------------------------------------------- ------------------------- # ● Move Cursor Process Index # ------------------------------------------------- ------------------------- cursor_move_index def ( value = 0 ) self.index + = value check_index_limit endend# ================================================= =============================# ■ Window_BattleActor# ================================================= =============================class Window_BattleActor < Window_BattleStatus include Battle_Cursor_index # ------------------------------------------------- ------------------------- # ● Update # ------------------------------------------------- ------------------------- def update super set_cursor_position_actor end # ------------------------------------------------- ------------------------- # ● Show # ------------------------------------------------- ------------------------- alias mog_battle_cursor_show show def show if @ info_viewport set_cursor_position_actor $ game_temp.battle_cursor [ 2 ] = true end mog_battle_cursor_show end # ------------------------------------------------- ------------------------- # ● Hide # ------------------------------------------------- ------------------------- alias mog_battle_cursor_hide hide def hide if @ info_viewport $ game_temp.battle_cursor [ 2 ] = false end mog_battle_cursor_hide end end# ================================================= =============================# ■ Window_BattleEnemy# ================================================= =============================class Window_BattleEnemy < Window_Selectable include Battle_Cursor_index # ------------------------------------------------- ------------------------- # ● Update # ------------------------------------------------- ------------------------- def update super set_cursor_position_enemy end # ------------------------------------------------- ------------------------- # ● Show # ------------------------------------------------- ------------------------- alias mog_battle_cursor_show show def show if @ info_viewport set_cursor_position_enemy $ game_temp.battle_cursor [ 2 ] = true end mog_battle_cursor_show end # ------------------------------------------------- ------------------------- # ● Hide # ------------------------------------------------- ------------------------- alias mog_battle_cursor_hide hide def hide if @ info_viewport $ game_temp.battle_cursor [ 2 ] = false end mog_battle_cursor_hide end end

