——— — Before you ask! Read! ;) —
You must have 30+ Posts to create a topic here!
— Thanks for reading! — ———
|
|
  |
Icons to replace Elements text? [SOLVED], Found one for states but not elements! |
|
|
|
|
Mar 3 2012, 09:02 AM
|

Level 3

Group: Member
Posts: 33
Type: Artist
RM Skill: Undisclosed

|
Anyone know of a script snippet to replace the text for the Elements to icons? This is what I've got for States, if that helps: CODE # Status Effects as Icons # Original Script by Ccoa # Since Falcon didn't have 1337 search skills, he rewrote this
def draw_actor_state(actor, x, y, width = 120) for i in 0...actor.states.length if i < 7 ix = 24 * i bitmap = RPG::Cache.icon($data_states[actor.states[i]].name + ".png" ) self.contents.blt(ix+x, y, bitmap, Rect.new(0, 0, 24, 24)) end end end There was more to the code itself, but I took THIS chunk here that I posted and inserted wherever the States were to be drawn. Maybe the more complicated way, but this way I could adjust them within the battle status and the menu and the menu status since they each needed a slightly different alignment.
This post has been edited by Wonderjosh: Mar 25 2012, 09:33 PM
|
|
|
|
|
|
|
|
|
Mar 5 2012, 05:21 AM
|

Level 50

Group: +Gold Member
Posts: 1,520
Type: Scripter
RM Skill: Undisclosed

|
I've slightly edited your code... well, Ccoa's code... CODE # Status Effects as Icons # Original Script by Ccoa # Since Falcon didn't have 1337 search skills, he rewrote this
class Window_Base def draw_actor_state(actor, x, y, width = 120) for i in 0...actor.states.length if i < 7 # 24 is the width of the icons ix = 24 * i bitmap = RPG::Cache.icon($data_states[actor.states[i]].name) self.contents.blt(ix+x, y, bitmap, Rect.new(0, 0, 24, 24)) end end end end You just need to insert it as a new script, only the once, and it should work for the pause and the battle menu. Just for curiosity, what where the differences you needed to make between the pause and battle menus?
__________________________
K.I.S.S. Want help with your scripting problems? Upload a demo! Or at the very least; provide links to the scripts in question. Most important guide ever: Newbie's Guide to Switches
|
|
|
|
|
|
|
|
|
Mar 9 2012, 01:49 PM
|

Level 3

Group: Member
Posts: 33
Type: Artist
RM Skill: Undisclosed

|
Finally, I've been able to plug the code in and check it out. Works wonderfully in the menu! Something weird in the equip screen though: the icon script doesn't override whatever it was that Ryex came up with in his menu script. Where the weapon/armor/accessory stats are, whatever states are inflicted or guarded against show up as text still. I tried messing around with it, but with no results.
In battle, the icons are aligned so far to the right of the battlestatus windows that you only see the left half of the first icon in the row of states. I thought I knew how to adjust that before, but I can't remember for the life of me where to look now!
I'd love if this works for the system elements, too. So weapon/armor/accessory elemental attributes and defenses will be displayed as icons, too. Looked around for a script, but no luck! I figured there should be something out there, but maybe I just missed it?
I think this could be the last or at least one of the very last scripts required to set up the technical side of my project. After that, it's all graphics and music! W00t!
Hope the bump was an ok thing to do! Sorry if it wasn't!
This post has been edited by Wonderjosh: Mar 9 2012, 01:54 PM
|
|
|
|
|
|
|
|
|
Mar 14 2012, 04:31 AM
|

Level 50

Group: +Gold Member
Posts: 1,520
Type: Scripter
RM Skill: Undisclosed

|
I've further edited the code: CODE # Status Effects as Icons # Original Script by Ccoa # Since Falcon didn't have 1337 search skills, he rewrote this
class Window_Base def draw_actor_state(actor, x, y, width = 120) draw_states(actor.states.map { |id| $data_states[id] }, x, y + 12) end def draw_states(states, x, y) for i in 0...states.length if i < 7 # 24 is the width of the icons ix = 26 * i icon_name = states[i].name draw_icon(icon_name, x + ix, y) end end end def draw_icon(icon_name, x, y) bitmap = RPG::Cache.icon(icon_name) self.contents.blt(x, y, bitmap, Rect.new(0, 0, 24, 24)) end end And I've rewritten party of Ryex's Collapsing CMS, line 1424, usually the stat_text = ... becomes CODE states = @item.plus_state_set.map { |i| $data_states[i] } And line 1434, stat_text = ... becomes CODE states = @item.guard_state_set.map { |i| $data_states[i] } And most importantly, line 1458, self.contents.draw_text(.....stat_text) becomes CODE draw_states(states, 126, 160) For the battlestatus window, I've had to printescreen before the battler images loaded, but as you can see here: My icons load properly, along the left hand side. I can't remember, do you have a custom battle system you're using? If the state icons work for you then it should be easy for me to make it work with elements as well, you were just talking about displaying elements icons in the CMS, yeah?
__________________________
K.I.S.S. Want help with your scripting problems? Upload a demo! Or at the very least; provide links to the scripts in question. Most important guide ever: Newbie's Guide to Switches
|
|
|
|
|
|
|
|
|
Mar 14 2012, 01:03 PM
|

Level 3

Group: Member
Posts: 33
Type: Artist
RM Skill: Undisclosed

|
Sweet! Yeah that works awesome for the states in the equip screen! Works everywhere else in the CMS perfectly, too. For the battle system, it's pretty much default except I'm using the EarthBound-esque individual battlestatus windows that you were able to work your magic and make for me. The state icons are still aligned off to the extreme right in each battlestatus window, showing only the left half of the left-most icon. But the height of the row where the icons should be looks right, haha. And yep, for the elements, the equip screen is pretty much the only place you'll ever see the icons, I'm thinking. The default shops don't show the weapon and armour details when purchasing, so yeah it'll probably just be the equip screen in the CMS. Here's the individual battlestatus script just so you don't have to go searching for it  CODE #============================================================================== # ** XP: Night_Runner's Individual Battlestatus Windows #------------------------------------------------------------------------------ # History: # Date Created: 19/Feb/2012 # Created for: Wonderjosh # @> http://www.rpgrevolution.com/forums/index.php?showtopic=55412 # # Description: # This script has individual battlestatus windows for each actor, lines # 64 - 75 make the active battler's window move up a bit. # # How to Install: # Copy this entire script. In your game editor select Tools >> Script # Editor. Along the left hand side scroll to the bottom, right click on # 'Main' and select 'Insert'. Past on the right. #==============================================================================
#============================================================================== # ** Customization #==============================================================================
module NR_IndividualBattlestatusWindows WindowWidth = 120 # Width of the individual windows (pixels) WindowHeight = 150 # Height of the individual windows (pixels) WindowDistBottom = 20 # Distance between the bottom of the screen and # individual windows (pixels) MoveUpDist = 20 # Amount to move the active actor's window up # by (pixels) WindowMoveSpeed = 2 # Speed to move up at (pixels/frame) TextDY = 26 # Distance between each line of text (pixels) ShowState = true # Append a Status/Level up line (true/false) end
#============================================================================== # ** Game_Actor #------------------------------------------------------------------------------ # Edited to have the actors match the window positions #==============================================================================
class Game_Actor #-------------------------------------------------------------------------- # * Public Instance Variables #-------------------------------------------------------------------------- attr_accessor :battle_active_y #-------------------------------------------------------------------------- # * Alias Methods #-------------------------------------------------------------------------- alias nr_ibw_initialize initialize unless $@ alias nr_ibw_screen_y screen_y unless $@ #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize(*args) @battle_active_y = 0 return nr_ibw_initialize(*args) end #-------------------------------------------------------------------------- # * Get Battle Screen X-Coordinate #-------------------------------------------------------------------------- def screen_x # Return after calculating x-coordinate by order of members in party if self.index != nil num_actors = $game_party.actors.size ww = NR_IndividualBattlestatusWindows::WindowWidth x = 320 - num_actors * ww / 2 + self.index * ww + ww / 2 return x else return 0 end end #-------------------------------------------------------------------------- # * Get Battle Screen Y-Coordinate #-------------------------------------------------------------------------- def screen_y(*args) return nr_ibw_screen_y(*args) + @battle_active_y end end
#============================================================================== # ** Spriteset_Battle #------------------------------------------------------------------------------ # Edited to allow a fullscreen backdrop. #==============================================================================
class Spriteset_Battle #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize # Make viewports @viewport1 = Viewport.new(0, 0, 640, 480) #NREdit @viewport2 = Viewport.new(0, 0, 640, 480) @viewport3 = Viewport.new(0, 0, 640, 480) @viewport4 = Viewport.new(0, 0, 640, 480) @viewport2.z = 101 @viewport3.z = 200 @viewport4.z = 5000 # Make battleback sprite @battleback_sprite = Sprite.new(@viewport1) # Make enemy sprites @enemy_sprites = [] for enemy in $game_troop.enemies.reverse @enemy_sprites.push(Sprite_Battler.new(@viewport1, enemy)) end # Make actor sprites @actor_sprites = [] @actor_sprites.push(Sprite_Battler.new(@viewport2)) @actor_sprites.push(Sprite_Battler.new(@viewport2)) @actor_sprites.push(Sprite_Battler.new(@viewport2)) @actor_sprites.push(Sprite_Battler.new(@viewport2)) # Make weather @weather = RPG::Weather.new(@viewport1) # Make picture sprites @picture_sprites = [] for i in 51..100 @picture_sprites.push(Sprite_Picture.new(@viewport3, $game_screen.pictures[i])) end # Make timer sprite @timer_sprite = Sprite_Timer.new # Frame update update end #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update # Update actor sprite contents (corresponds with actor switching) @actor_sprites[0].battler = $game_party.actors[0] @actor_sprites[1].battler = $game_party.actors[1] @actor_sprites[2].battler = $game_party.actors[2] @actor_sprites[3].battler = $game_party.actors[3] # If battleback file name is different from current one if @battleback_name != $game_temp.battleback_name @battleback_name = $game_temp.battleback_name if @battleback_sprite.bitmap != nil @battleback_sprite.bitmap.dispose end @battleback_sprite.bitmap = RPG::Cache.battleback(@battleback_name) @battleback_sprite.src_rect.set(0, 0, 640, 480) #NREdit end # Update battler sprites for sprite in @enemy_sprites + @actor_sprites sprite.update end # Update weather graphic @weather.type = $game_screen.weather_type @weather.max = $game_screen.weather_max @weather.update # Update picture sprites for sprite in @picture_sprites sprite.update end # Update timer sprite @timer_sprite.update # Set screen color tone and shake position @viewport1.tone = $game_screen.tone @viewport1.ox = $game_screen.shake # Set screen flash color @viewport4.color = $game_screen.flash_color # Update viewports @viewport1.update @viewport2.update @viewport4.update end end
#============================================================================== # ** Window_IndividualBattleStatus #------------------------------------------------------------------------------ # This window displays the status of each party members on the battle screen. #==============================================================================
class Window_IndividualBattleStatus < Window_Base #-------------------------------------------------------------------------- # * Include Modules #-------------------------------------------------------------------------- include NR_IndividualBattlestatusWindows #-------------------------------------------------------------------------- # * Public Instance Variables #-------------------------------------------------------------------------- attr_accessor :active_battler #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize(actor_index) @actor_index = actor_index num_actors = $game_party.actors.size x = 320 - num_actors * WindowWidth / 2 + @actor_index * WindowWidth y = 480 - WindowHeight - WindowDistBottom super(x, y, WindowWidth, WindowHeight) self.contents = Bitmap.new(width - 32, height - 32) @level_up_flags = false @active_battler = false refresh end #-------------------------------------------------------------------------- # * Set Level Up Flag # actor_index : actor index #-------------------------------------------------------------------------- def level_up @level_up_flags = true end #-------------------------------------------------------------------------- # * Refresh #-------------------------------------------------------------------------- def refresh self.contents.clear actor = $game_party.actors[@actor_index] return if not actor.is_a?(Game_Actor) width = self.contents.width draw_actor_name(actor, 0, 0 * TextDY) draw_actor_hp(actor, 0, 1 * TextDY, width) draw_actor_sp(actor, 0, 2 * TextDY, width) if @level_up_flags self.contents.font.color = normal_color self.contents.draw_text(0, 3 * TextDY, width, 32, "Level Up!") else draw_actor_state(actor, 3 * TextDY, width) end end #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update super # Slightly lower opacity level during main phase if $game_temp.battle_main_phase self.contents_opacity -= 4 if self.contents_opacity > 191 else self.contents_opacity += 4 if self.contents_opacity < 255 end # Move the window upper_y = 480 - WindowDistBottom - WindowHeight if @active_battler == true self.y = [self.y - WindowMoveSpeed, upper_y - MoveUpDist].max else self.y = [self.y + WindowMoveSpeed, upper_y].min end $game_party.actors[@actor_index].battle_active_y = self.y - upper_y end end
#============================================================================== # ** Window_BattleStatus #------------------------------------------------------------------------------ # This array holds each battle window #==============================================================================
class Window_BattleStatus #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize # Create an array of battlestatus windows @battle_windows = [] # Populate the battlestatus windows for i in 0...$game_party.actors.size @battle_windows[i] = Window_IndividualBattleStatus.new(i) end end #-------------------------------------------------------------------------- # * Level Up #-------------------------------------------------------------------------- def level_up(actor_index) # Make sure that the window exists if not @battle_windows[actor_index].is_a?(Window_IndividualBattleStatus) return end # Tell the appropriate window to run the level up algorithm @battle_windows[actor_index].level_up end #-------------------------------------------------------------------------- # * Refresh #-------------------------------------------------------------------------- def refresh # For each window, refresh @battle_windows.each { |window| window.refresh } end #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update # For each window, update @battle_windows.each { |window| window.update } end #-------------------------------------------------------------------------- # * Active Actor Index #-------------------------------------------------------------------------- def active_actor_index=(active_index) # Loop through each window for i in 0...@battle_windows.size # Get the window for this loop window = @battle_windows[i] # If it is active, move up (to 300 pixels form the top) window.active_battler = (i == active_index) end end #-------------------------------------------------------------------------- # * Dispose #-------------------------------------------------------------------------- def dispose # For each window, dispose @battle_windows.each { |window| window.dispose } end end
#============================================================================== # ** Scene_Battle #------------------------------------------------------------------------------ # Edited to tell the status window which actors are acitve #==============================================================================
class Scene_Battle #-------------------------------------------------------------------------- # * Alias Methods #-------------------------------------------------------------------------- alias nr_ibw_phase3_update update unless $@ alias nr_ibw_phase3_setup_command_window phase3_setup_command_window unless $@ #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update(*args) # Run the original update nr_ibw_phase3_update(*args) # If the active battler is an actor, tell the battlestatus windows array # which actor is active if @active_battler.is_a?(Game_Actor) actor_index = $game_party.actors.index(@active_battler) @status_window.active_actor_index = actor_index # If an enemy is active, then set no window as active else @status_window.active_actor_index = -1 end end #-------------------------------------------------------------------------- # * Actor Command Window Setup #-------------------------------------------------------------------------- def phase3_setup_command_window(*args) # Run the original phase3_setup_command_window nr_ibw_phase3_setup_command_window(*args) # Get where to show the window num_actors = $game_party.actors.size ww = NR_IndividualBattlestatusWindows::WindowWidth aw = @actor_command_window.width x = 320 - num_actors * ww / 2 + @actor_index * ww + (ww - aw) / 2 wh = NR_IndividualBattlestatusWindows::WindowHeight wdb = NR_IndividualBattlestatusWindows::WindowDistBottom muh = NR_IndividualBattlestatusWindows::MoveUpDist y = 480 - wh - wdb - muh - @actor_command_window.height # Set actor command window position @actor_command_window.x = x @actor_command_window.y = y end end
#============================================================================== # ** End of Script. #============================================================================== Man, thanks a lot, again! Truly appreciate it.
This post has been edited by Wonderjosh: Mar 14 2012, 02:56 PM
|
|
|
|
|
|
|
|
|
Mar 24 2012, 10:18 PM
|

Level 50

Group: +Gold Member
Posts: 1,520
Type: Scripter
RM Skill: Undisclosed

|
You've pointed out a nice mistake I made in my individual battlestatus windows script. CODE #============================================================================== # ** XP: Night_Runner's Individual Battlestatus Windows #------------------------------------------------------------------------------ # History: # Date Created: 19/Feb/2012 # Last Edited: 25/Mar.2012 # Created for: Wonderjosh # @> http://www.rpgrevolution.com/forums/index.php?showtopic=55412 # # Description: # This script has individual battlestatus windows for each actor, lines # 64 - 75 make the active battler's window move up a bit. # # How to Install: # Copy this entire script. In your game editor select Tools >> Script # Editor. Along the left hand side scroll to the bottom, right click on # 'Main' and select 'Insert'. Past on the right. #==============================================================================
#============================================================================== # ** Customization #==============================================================================
module NR_IndividualBattlestatusWindows WindowWidth = 120 # Width of the individual windows (pixels) WindowHeight = 150 # Height of the individual windows (pixels) WindowDistBottom = 20 # Distance between the bottom of the screen and # individual windows (pixels) MoveUpDist = 20 # Amount to move the active actor's window up # by (pixels) WindowMoveSpeed = 2 # Speed to move up at (pixels/frame) TextDY = 26 # Distance between each line of text (pixels) ShowState = true # Append a Status/Level up line (true/false) end
#============================================================================== # ** Game_Actor #------------------------------------------------------------------------------ # Edited to have the actors match the window positions #==============================================================================
class Game_Actor #-------------------------------------------------------------------------- # * Public Instance Variables #-------------------------------------------------------------------------- attr_accessor :battle_active_y #-------------------------------------------------------------------------- # * Alias Methods #-------------------------------------------------------------------------- alias nr_ibw_initialize initialize unless $@ alias nr_ibw_screen_y screen_y unless $@ #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize(*args) @battle_active_y = 0 return nr_ibw_initialize(*args) end #-------------------------------------------------------------------------- # * Get Battle Screen X-Coordinate #-------------------------------------------------------------------------- def screen_x # Return after calculating x-coordinate by order of members in party if self.index != nil num_actors = $game_party.actors.size ww = NR_IndividualBattlestatusWindows::WindowWidth x = 320 - num_actors * ww / 2 + self.index * ww + ww / 2 return x else return 0 end end #-------------------------------------------------------------------------- # * Get Battle Screen Y-Coordinate #-------------------------------------------------------------------------- def screen_y(*args) return nr_ibw_screen_y(*args) + @battle_active_y end end
#============================================================================== # ** Spriteset_Battle #------------------------------------------------------------------------------ # Edited to allow a fullscreen backdrop. #==============================================================================
class Spriteset_Battle #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize # Make viewports @viewport1 = Viewport.new(0, 0, 640, 480) #NREdit @viewport2 = Viewport.new(0, 0, 640, 480) @viewport3 = Viewport.new(0, 0, 640, 480) @viewport4 = Viewport.new(0, 0, 640, 480) @viewport2.z = 101 @viewport3.z = 200 @viewport4.z = 5000 # Make battleback sprite @battleback_sprite = Sprite.new(@viewport1) # Make enemy sprites @enemy_sprites = [] for enemy in $game_troop.enemies.reverse @enemy_sprites.push(Sprite_Battler.new(@viewport1, enemy)) end # Make actor sprites @actor_sprites = [] @actor_sprites.push(Sprite_Battler.new(@viewport2)) @actor_sprites.push(Sprite_Battler.new(@viewport2)) @actor_sprites.push(Sprite_Battler.new(@viewport2)) @actor_sprites.push(Sprite_Battler.new(@viewport2)) # Make weather @weather = RPG::Weather.new(@viewport1) # Make picture sprites @picture_sprites = [] for i in 51..100 @picture_sprites.push(Sprite_Picture.new(@viewport3, $game_screen.pictures[i])) end # Make timer sprite @timer_sprite = Sprite_Timer.new # Frame update update end #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update # Update actor sprite contents (corresponds with actor switching) @actor_sprites[0].battler = $game_party.actors[0] @actor_sprites[1].battler = $game_party.actors[1] @actor_sprites[2].battler = $game_party.actors[2] @actor_sprites[3].battler = $game_party.actors[3] # If battleback file name is different from current one if @battleback_name != $game_temp.battleback_name @battleback_name = $game_temp.battleback_name if @battleback_sprite.bitmap != nil @battleback_sprite.bitmap.dispose end @battleback_sprite.bitmap = RPG::Cache.battleback(@battleback_name) @battleback_sprite.src_rect.set(0, 0, 640, 480) #NREdit end # Update battler sprites for sprite in @enemy_sprites + @actor_sprites sprite.update end # Update weather graphic @weather.type = $game_screen.weather_type @weather.max = $game_screen.weather_max @weather.update # Update picture sprites for sprite in @picture_sprites sprite.update end # Update timer sprite @timer_sprite.update # Set screen color tone and shake position @viewport1.tone = $game_screen.tone @viewport1.ox = $game_screen.shake # Set screen flash color @viewport4.color = $game_screen.flash_color # Update viewports @viewport1.update @viewport2.update @viewport4.update end end
#============================================================================== # ** Window_IndividualBattleStatus #------------------------------------------------------------------------------ # This window displays the status of each party members on the battle screen. #==============================================================================
class Window_IndividualBattleStatus < Window_Base #-------------------------------------------------------------------------- # * Include Modules #-------------------------------------------------------------------------- include NR_IndividualBattlestatusWindows #-------------------------------------------------------------------------- # * Public Instance Variables #-------------------------------------------------------------------------- attr_accessor :active_battler #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize(actor_index) @actor_index = actor_index num_actors = $game_party.actors.size x = 320 - num_actors * WindowWidth / 2 + @actor_index * WindowWidth y = 480 - WindowHeight - WindowDistBottom super(x, y, WindowWidth, WindowHeight) self.contents = Bitmap.new(width - 32, height - 32) @level_up_flags = false @active_battler = false refresh end #-------------------------------------------------------------------------- # * Set Level Up Flag # actor_index : actor index #-------------------------------------------------------------------------- def level_up @level_up_flags = true end #-------------------------------------------------------------------------- # * Refresh #-------------------------------------------------------------------------- def refresh self.contents.clear actor = $game_party.actors[@actor_index] return if not actor.is_a?(Game_Actor) width = self.contents.width draw_actor_name(actor, 0, 0 * TextDY) draw_actor_hp(actor, 0, 1 * TextDY, width) draw_actor_sp(actor, 0, 2 * TextDY, width) if @level_up_flags self.contents.font.color = normal_color self.contents.draw_text(0, 3 * TextDY, width, 32, "Level Up!") else draw_actor_state(actor, 0, 3 * TextDY, width) end end #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update super # Slightly lower opacity level during main phase if $game_temp.battle_main_phase self.contents_opacity -= 4 if self.contents_opacity > 191 else self.contents_opacity += 4 if self.contents_opacity < 255 end # Move the window upper_y = 480 - WindowDistBottom - WindowHeight if @active_battler == true self.y = [self.y - WindowMoveSpeed, upper_y - MoveUpDist].max else self.y = [self.y + WindowMoveSpeed, upper_y].min end $game_party.actors[@actor_index].battle_active_y = self.y - upper_y end end
#============================================================================== # ** Window_BattleStatus #------------------------------------------------------------------------------ # This array holds each battle window #==============================================================================
class Window_BattleStatus #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize # Create an array of battlestatus windows @battle_windows = [] # Populate the battlestatus windows for i in 0...$game_party.actors.size @battle_windows[i] = Window_IndividualBattleStatus.new(i) end end #-------------------------------------------------------------------------- # * Level Up #-------------------------------------------------------------------------- def level_up(actor_index) # Make sure that the window exists if not @battle_windows[actor_index].is_a?(Window_IndividualBattleStatus) return end # Tell the appropriate window to run the level up algorithm @battle_windows[actor_index].level_up end #-------------------------------------------------------------------------- # * Refresh #-------------------------------------------------------------------------- def refresh # For each window, refresh @battle_windows.each { |window| window.refresh } end #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update # For each window, update @battle_windows.each { |window| window.update } end #-------------------------------------------------------------------------- # * Active Actor Index #-------------------------------------------------------------------------- def active_actor_index=(active_index) # Loop through each window for i in 0...@battle_windows.size # Get the window for this loop window = @battle_windows[i] # If it is active, move up (to 300 pixels form the top) window.active_battler = (i == active_index) end end #-------------------------------------------------------------------------- # * Dispose #-------------------------------------------------------------------------- def dispose # For each window, dispose @battle_windows.each { |window| window.dispose } end end
#============================================================================== # ** Scene_Battle #------------------------------------------------------------------------------ # Edited to tell the status window which actors are acitve #==============================================================================
class Scene_Battle #-------------------------------------------------------------------------- # * Alias Methods #-------------------------------------------------------------------------- alias nr_ibw_phase3_update update unless $@ alias nr_ibw_phase3_setup_command_window phase3_setup_command_window unless $@ #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update(*args) # Run the original update nr_ibw_phase3_update(*args) # If the active battler is an actor, tell the battlestatus windows array # which actor is active if @active_battler.is_a?(Game_Actor) actor_index = $game_party.actors.index(@active_battler) @status_window.active_actor_index = actor_index # If an enemy is active, then set no window as active else @status_window.active_actor_index = -1 end end #-------------------------------------------------------------------------- # * Actor Command Window Setup #-------------------------------------------------------------------------- def phase3_setup_command_window(*args) # Run the original phase3_setup_command_window nr_ibw_phase3_setup_command_window(*args) # Get where to show the window num_actors = $game_party.actors.size ww = NR_IndividualBattlestatusWindows::WindowWidth aw = @actor_command_window.width x = 320 - num_actors * ww / 2 + @actor_index * ww + (ww - aw) / 2 wh = NR_IndividualBattlestatusWindows::WindowHeight wdb = NR_IndividualBattlestatusWindows::WindowDistBottom muh = NR_IndividualBattlestatusWindows::MoveUpDist y = 480 - wh - wdb - muh - @actor_command_window.height # Set actor command window position @actor_command_window.x = x @actor_command_window.y = y end end
#============================================================================== # ** End of Script. #============================================================================== I forgot to put 1 digit in there, amazing how much something like that propagates... I've gone back to your original topic asking for that script and fixed it, in case anyone else tries using it from there. I've also got a working version of the elemental states scirpt working CODE # Elemental Effects as Icons # Original Script by Ccoa # Only works with Ryex's collapsing menu script
class Window_Base def draw_elements(elements, x, y) for i in 0...elements.length if i < 7 # 24 is the width of the icons ix = 26 * i icon_name = elements[i] draw_icon(icon_name, x + ix, y) end end end def draw_icon(icon_name, x, y) bitmap = RPG::Cache.icon(icon_name) self.contents.blt(x, y, bitmap, Rect.new(0, 0, 24, 24)) end end
if $RyexCOLCMS == true
#============================================================================== # ** Window_Item_Info #------------------------------------------------------------------------------ # This Class makes a Window that displays an Items Statistics #==============================================================================
class Window_Item_Info alias nr_elementalIcons_refresh refresh unless $@ def refresh if @item != nil case @item when RPG::Weapon elems = @item.element_set.map { |id| $data_system.elements[id] } when RPG::Armor elems = @item.guard_element_set.map { |id| $data_system.elements[id] } end blank = Bitmap.new(200, 32) self.contents.blt(123, 92, blank, blank.rect) draw_elements(elems, 123, 92) end end end
end And the demo I've been using: http://min.us/mi1z1Ro1A
__________________________
K.I.S.S. Want help with your scripting problems? Upload a demo! Or at the very least; provide links to the scripts in question. Most important guide ever: Newbie's Guide to Switches
|
|
|
|
|
|
|
|
  |
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:
RPG RPG Revolution is an Privacy
Policy and Legal
|
|