Hi everyone. This is my first script request here, and I'll do my best not to seem ignorant. Let me preface my request by saying that I've searched with no luck for something with a similar function. I don't know of any video game antecedents for what I'm proposing, as the idea came to me as a way of solving a problem related to my particular project. Also, I'm no scripter, so perhaps my request won't even be possible. Please let me know if this turns out to be the case. :)
The requestType of scriptAdd-on to the RMXP Default Skill Menu, involving the display of two new windows, one of which should contain information called up from a database of text and icons contained in the script. Although I would like this to apply eventually in battle as well, let's start only with a modification of the default skill menu system.
Custom scripts I am usingNothing that should affect the Skill Windows as far as I know. However, just in case, here is a list of what I'm using to date:
tons by blizzard
threat system v1.0 by Fantasist
item categorization by albertfish
multi-slot equipment by guillaume 777
skill recovery time by Fomar0153
icons in battle commands by Juan
character biography by ItalianStal1ion
tax script by Falcon
animated save files by sandgolem
unequip all by sandgolem
This list will soon include a pared-down version of Sephiroth Spawn's Materia System and the UMS.
Anything else that I add later will be my fault should it prove incompatible.
I am NOT using the SDK and do not plan on using it.
How the script should workThe player opens the skill window as usual and moves the cursor to a skill. Everything is identical to the default system except for the addition of an instruction window at the bottom. This window tells the player that pressing 'Z' (or whatever I choose as the key) will bring up a new window. Please note that this is only a [bad] mock-up with paint and not the result of any scripting I've done.
(http://images.yuku.com/image/png/ab115a522be6d2b0619936833d1f8a310a3f6e6.png)
If the player presses 'Z', a new window appears at the side of the screen. In my screenshot, it contains relevant information about the skill that is too long and cumbersome to display in the top skill description:
(http://images.yuku.com/image/png/d6d1545e22e1d1bfbafc6b501778faeee37e765.png)[
At this point, the help window at the bottom changes to instruct the player that pressing 'B' (or whatever) will return to the general list of skills.
How this might be doneThe pop-up window does not need to be connected to any in-game system information about the skill. Its only purpose is to show 5 lines of text and icons, which I would have the ability to establish in the script database of descriptions. Of course, the descriptions should correspond correctly to the skills. My scripting knowledge is still practically zero, but in layman's terms it would be something like:
For skill number [34]
"Elemental Attack: icon for fire icon for water"
"Status Inflicted: icon for sleep"
"Charge Time: 1 turn (or icon of 1 turn)"
"Recovery Time: n/a (or icon)"
"Threat Rating: 6 (or icon"
This would be a very large database, covering approximately 150 skills in total.
Could something like this be done? Please let me know if I can provide additional information or clear up any doubts.
Thanks in advance for your time! :)
I might take this request if I wanna get back into RGSS... which might not be likely :x
It's not too too hard though.
Just letting you know XP
made it but 1 question did you want it to return with the back button or B right now it returns with the back button
now to add the info see
module Skill_Info
def self.skill(id)
case id
when 1
elemental_attack = ['043-Item12','044-Skill01']
status_inflicted = '046-Skill03'
charge_time = '1'
recovery_time = '2'
threat_rating = '3'
else
elemental_attack = ['','']
status_inflicted = ''
charge_time = ''
recovery_time = ''
threat_rating = ''
end
return [elemental_attack,status_inflicted,charge_time,recovery_time,
threat_rating]
end
end
that has setup for skill 1 in the database to add another 1 just do this
case id
when skill id
info
when skill id
info
else
elemental_attack = ['','']
status_inflicted = ''
charge_time = ''
recovery_time = ''
threat_rating = ''
end
return [elemental_attack,status_inflicted,charge_time,recovery_time,
threat_rating]
end
module Skill_Info
def self.skill(id)
case id
when 1
elemental_attack = ['043-Item12','044-Skill01']
status_inflicted = '046-Skill03'
charge_time = '1'
recovery_time = '2'
threat_rating = '3'
else
elemental_attack = ['','']
status_inflicted = ''
charge_time = ''
recovery_time = ''
threat_rating = ''
end
return [elemental_attack,status_inflicted,charge_time,recovery_time,
threat_rating]
end
end
#==============================================================================
# ** Scene_Skill
#------------------------------------------------------------------------------
# This class performs skill screen processing.
#==============================================================================
class Scene_Skill
#--------------------------------------------------------------------------
# * Object Initialization
# actor_index : actor index
#--------------------------------------------------------------------------
def initialize(actor_index = 0, equip_index = 0)
@actor_index = actor_index
end
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def main
# Get actor
@actor = $game_party.actors[@actor_index]
# Make help window, status window, and skill window
@help_window = Window_Help.new
@info_window = Window_Help.new
@info_window.y = 416
@info_window.set_text("Press 'Z' for aditional skill information")
@status_window = Window_SkillStatus.new(@actor)
@skill_window = Window_Skill.new(@actor)
# Associate help window
@skill_window.help_window = @help_window
# Make target window (set to invisible / inactive)
@target_window = Window_Target.new
@target_window.visible = false
@target_window.active = false
# Execute transition
Graphics.transition
# Main loop
loop do
# Update game screen
Graphics.update
# Update input information
Input.update
# Frame update
update
# Abort loop if screen is changed
if $scene != self
break
end
end
# Prepare for transition
Graphics.freeze
# Dispose of windows
@help_window.dispose
@status_window.dispose
@skill_window.dispose
@target_window.dispose
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
# Update windows
@help_window.update
@status_window.update
@skill_window.update
@target_window.update
# If skill window is active: call update_skill
if @skill_window.active
update_skill
return
# If skill target is active: call update_target
elsif @target_window.active
update_target
return
elsif @stat_window.visible
update_stat
return
end
end
#--------------------------------------------------------------------------
# * Frame Update (if skill window is active)
#--------------------------------------------------------------------------
def update_skill
# If B button was pressed
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Switch to menu screen
$scene = Scene_Menu.new(1)
return
end
# If C button was pressed
if Input.trigger?(Input::C)
# Get currently selected data on the skill window
@skill = @skill_window.skill
# If unable to use
if @skill == nil or not @actor.skill_can_use?(@skill.id)
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
# Play decision SE
$game_system.se_play($data_system.decision_se)
# If effect scope is ally
if @skill.scope >= 3
# Activate target window
@skill_window.active = false
@target_window.x = (@skill_window.index + 1) % 2 * 304
@target_window.visible = true
@target_window.active = true
# Set cursor position to effect scope (single / all)
if @skill.scope == 4 || @skill.scope == 6
@target_window.index = -1
elsif @skill.scope == 7
@target_window.index = @actor_index - 10
else
@target_window.index = 0
end
# If effect scope is other than ally
else
# If common event ID is valid
if @skill.common_event_id > 0
# Common event call reservation
$game_temp.common_event_id = @skill.common_event_id
# Play use skill SE
$game_system.se_play(@skill.menu_se)
# Use up SP
@actor.sp -= @skill.sp_cost
# Remake each window content
@status_window.refresh
@skill_window.refresh
@target_window.refresh
# Switch to map screen
$scene = Scene_Map.new
return
end
end
return
end
# If R button was pressed
if Input.trigger?(Input::R)
# Play cursor SE
$game_system.se_play($data_system.cursor_se)
# To next actor
@actor_index += 1
@actor_index %= $game_party.actors.size
# Switch to different skill screen
$scene = Scene_Skill.new(@actor_index)
return
end
# If L button was pressed
if Input.trigger?(Input::L)
# Play cursor SE
$game_system.se_play($data_system.cursor_se)
# To previous actor
@actor_index += $game_party.actors.size - 1
@actor_index %= $game_party.actors.size
# Switch to different skill screen
$scene = Scene_Skill.new(@actor_index)
return
end
if Input.trigger?(Input::Key['Z'])
$game_system.se_play($data_system.cursor_se)
@skill_window.active = false
@skill = @skill_window.skill
@stat_window = Window_Stat.new(@skill.id)
@info_window.set_text("Press 'B' to return to the general list of skills")
end
end
#--------------------------------------------------------------------------
# * Frame Update (when target window is active)
#--------------------------------------------------------------------------
def update_target
# If B button was pressed
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Erase target window
@skill_window.active = true
@target_window.visible = false
@target_window.active = false
return
end
# If C button was pressed
if Input.trigger?(Input::C)
# If unable to use because SP ran out
unless @actor.skill_can_use?(@skill.id)
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
# If target is all
if @target_window.index == -1
# Apply skill use effects to entire party
used = false
for i in $game_party.actors
used |= i.skill_effect(@actor, @skill)
end
end
# If target is user
if @target_window.index <= -2
# Apply skill use effects to target actor
target = $game_party.actors[@target_window.index + 10]
used = target.skill_effect(@actor, @skill)
end
# If single target
if @target_window.index >= 0
# Apply skill use effects to target actor
target = $game_party.actors[@target_window.index]
used = target.skill_effect(@actor, @skill)
end
# If skill was used
if used
# Play skill use SE
$game_system.se_play(@skill.menu_se)
# Use up SP
@actor.sp -= @skill.sp_cost
# Remake each window content
@status_window.refresh
@skill_window.refresh
@target_window.refresh
# If entire party is dead
if $game_party.all_dead?
# Switch to game over screen
$scene = Scene_Gameover.new
return
end
# If command event ID is valid
if @skill.common_event_id > 0
# Command event call reservation
$game_temp.common_event_id = @skill.common_event_id
# Switch to map screen
$scene = Scene_Map.new
return
end
end
# If skill wasn't used
unless used
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
end
return
end
end
def update_stat
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
@skill_window.active = true
@stat_window.dispose
@info_window.set_text("Press 'Z' for aditional skill information")
return
end
end
end
#==============================================================================
# ** Window_Skill
#------------------------------------------------------------------------------
# This window displays usable skills on the skill and battle screens.
#==============================================================================
class Window_Skill < Window_Selectable
#--------------------------------------------------------------------------
# * Object Initialization
# actor : actor
#--------------------------------------------------------------------------
def initialize(actor)
super(0, 128, 640, 288)
@actor = actor
@column_max = 2
refresh
self.index = 0
# If in battle, move window to center of screen
# and make it semi-transparent
if $game_temp.in_battle
self.y = 64
self.height = 256
self.back_opacity = 160
end
end
#--------------------------------------------------------------------------
# * Acquiring Skill
#--------------------------------------------------------------------------
def skill
return @data[self.index]
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@data = []
for i in 0...@actor.skills.size
skill = $data_skills[@actor.skills[i]]
if skill != nil
@data.push(skill)
end
end
# If item count is not 0, make a bit map and draw all items
@item_max = @data.size
if @item_max > 0
self.contents = Bitmap.new(width - 32, row_max * 32)
for i in 0...@item_max
draw_item(i)
end
end
end
#--------------------------------------------------------------------------
# * Draw Item
# index : item number
#--------------------------------------------------------------------------
def draw_item(index)
skill = @data[index]
if @actor.skill_can_use?(skill.id)
self.contents.font.color = normal_color
else
self.contents.font.color = disabled_color
end
x = 4 + index % 2 * (288 + 32)
y = index / 2 * 32
rect = Rect.new(x, y, self.width / @column_max - 32, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
bitmap = RPG::Cache.icon(skill.icon_name)
opacity = self.contents.font.color == normal_color ? 255 : 128
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
self.contents.draw_text(x + 28, y, 204, 32, skill.name, 0)
self.contents.draw_text(x + 232, y, 48, 32, skill.sp_cost.to_s, 2)
end
#--------------------------------------------------------------------------
# * Help Text Update
#--------------------------------------------------------------------------
def update_help
@help_window.set_text(self.skill == nil ? "" : self.skill.description)
end
end
#==============================================================================
# ** Window_Stat
#------------------------------------------------------------------------------
# This window displays usable skills on the skill and battle screens.
#==============================================================================
class Window_Stat < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
# actor : actor
#--------------------------------------------------------------------------
def initialize(skill_id)
super(320, 128, 320, 200)
@skill_id = skill_id
self.contents = Bitmap.new(width - 32, height - 32)
self.z = 1000
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
info = Skill_Info.skill(@skill_id)
self.contents.clear
self.contents.draw_text(4,0,150,32,'Elemental Attack')
bitmap = RPG::Cache.icon(info[0][0])
self.contents.blt(160,0,bitmap,Rect.new(0, 0, bitmap.width, bitmap.height))
bitmap = RPG::Cache.icon(info[0][1])
self.contents.blt(202,0,bitmap,Rect.new(0, 0, bitmap.width, bitmap.height))
self.contents.draw_text(4,32,150,32,'Status Inflicted')
bitmap = RPG::Cache.icon(info[1])
self.contents.blt(160,32,bitmap,Rect.new(0, 0, bitmap.width, bitmap.height))
self.contents.draw_text(4,64,150,32,'Charge Time')
self.contents.draw_text(160,64,150,32,info[2].to_s)
self.contents.draw_text(4,96,150,32,'Recovery Time')
self.contents.draw_text(160,96,150,32,info[3].to_s)
self.contents.draw_text(4,128,150,32,'Threat Rating')
self.contents.draw_text(160,128,150,32,info[4].to_s)
end
end
Shouldn't the status_inflicted also be an array?
Wow! Not even a day has passed and already someone has made a script? This place is excellent indeed. :haha:
Many, many thanks for your efforts and for the explanation that even I was able to understand. I think that this is exactly what I was looking for.
The "back" button is fine for returning to the general list, thanks!
One question: when I enter the skill menu, it gives me this error:
Script "Item Info" line 183: NameError occurred.
uninitialized constant Input::Key
He has Blizz-ABS/Tons Input on his mind.
Input::Z will fix the error, but I'm not sure what the default Z key is in RMXP XP
Ah! Of course. My fault for not specifying better in my request. After making the change that you suggested, Aqua, it works perfectly! And nathmatt, I am in your debt. :)
Out of curiosity: did this take very long? Would it be complicated to make this apply to the battle menu?
QuoteShouldn't the status_inflicted also be an array?
Would that be possible? Could it hold up to 5 options?
Um...
Nath's coding is flawed.
With his, you MUST have 2 elements and 1 status infliction per skill or else it'd bug out.
Can't have more; can't have less.
Edit:
It's very possible to have 5 options, but it's not practical for the way Nath did his coding...
I don't know why he didn't use loops *shrug*
didn't think about it here fixed
module Skill_Info
def self.skill(id)
case id
when 1
elemental_attack = ['043-Item12','044-Skill01']
status_inflicted = ['046-Skill03']
charge_time = '1'
recovery_time = '2'
threat_rating = '3'
else
elemental_attack = ['','']
status_inflicted = ['']
charge_time = ''
recovery_time = ''
threat_rating = ''
end
return [elemental_attack,status_inflicted,charge_time,recovery_time,
threat_rating]
end
end
#==============================================================================
# ** Scene_Skill
#------------------------------------------------------------------------------
# This class performs skill screen processing.
#==============================================================================
class Scene_Skill
#--------------------------------------------------------------------------
# * Object Initialization
# actor_index : actor index
#--------------------------------------------------------------------------
def initialize(actor_index = 0, equip_index = 0)
@actor_index = actor_index
end
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def main
# Get actor
@actor = $game_party.actors[@actor_index]
# Make help window, status window, and skill window
@help_window = Window_Help.new
@info_window = Window_Help.new
@info_window.y = 416
@info_window.set_text("Press 'Z' for aditional skill information")
@status_window = Window_SkillStatus.new(@actor)
@skill_window = Window_Skill.new(@actor)
# Associate help window
@skill_window.help_window = @help_window
# Make target window (set to invisible / inactive)
@target_window = Window_Target.new
@target_window.visible = false
@target_window.active = false
# Execute transition
Graphics.transition
# Main loop
loop do
# Update game screen
Graphics.update
# Update input information
Input.update
# Frame update
update
# Abort loop if screen is changed
if $scene != self
break
end
end
# Prepare for transition
Graphics.freeze
# Dispose of windows
@help_window.dispose
@status_window.dispose
@skill_window.dispose
@target_window.dispose
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
# Update windows
@help_window.update
@status_window.update
@skill_window.update
@target_window.update
# If skill window is active: call update_skill
if @skill_window.active
update_skill
return
# If skill target is active: call update_target
elsif @target_window.active
update_target
return
elsif @stat_window.visible
update_stat
return
end
end
#--------------------------------------------------------------------------
# * Frame Update (if skill window is active)
#--------------------------------------------------------------------------
def update_skill
# If B button was pressed
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Switch to menu screen
$scene = Scene_Menu.new(1)
return
end
# If C button was pressed
if Input.trigger?(Input::C)
# Get currently selected data on the skill window
@skill = @skill_window.skill
# If unable to use
if @skill == nil or not @actor.skill_can_use?(@skill.id)
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
# Play decision SE
$game_system.se_play($data_system.decision_se)
# If effect scope is ally
if @skill.scope >= 3
# Activate target window
@skill_window.active = false
@target_window.x = (@skill_window.index + 1) % 2 * 304
@target_window.visible = true
@target_window.active = true
# Set cursor position to effect scope (single / all)
if @skill.scope == 4 || @skill.scope == 6
@target_window.index = -1
elsif @skill.scope == 7
@target_window.index = @actor_index - 10
else
@target_window.index = 0
end
# If effect scope is other than ally
else
# If common event ID is valid
if @skill.common_event_id > 0
# Common event call reservation
$game_temp.common_event_id = @skill.common_event_id
# Play use skill SE
$game_system.se_play(@skill.menu_se)
# Use up SP
@actor.sp -= @skill.sp_cost
# Remake each window content
@status_window.refresh
@skill_window.refresh
@target_window.refresh
# Switch to map screen
$scene = Scene_Map.new
return
end
end
return
end
# If R button was pressed
if Input.trigger?(Input::R)
# Play cursor SE
$game_system.se_play($data_system.cursor_se)
# To next actor
@actor_index += 1
@actor_index %= $game_party.actors.size
# Switch to different skill screen
$scene = Scene_Skill.new(@actor_index)
return
end
# If L button was pressed
if Input.trigger?(Input::L)
# Play cursor SE
$game_system.se_play($data_system.cursor_se)
# To previous actor
@actor_index += $game_party.actors.size - 1
@actor_index %= $game_party.actors.size
# Switch to different skill screen
$scene = Scene_Skill.new(@actor_index)
return
end
if Input.trigger?(Input::A)
$game_system.se_play($data_system.cursor_se)
@skill_window.active = false
@skill = @skill_window.skill
@stat_window = Window_Stat.new(@skill.id)
@info_window.set_text("Press 'B' to return to the general list of skills")
end
end
#--------------------------------------------------------------------------
# * Frame Update (when target window is active)
#--------------------------------------------------------------------------
def update_target
# If B button was pressed
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Erase target window
@skill_window.active = true
@target_window.visible = false
@target_window.active = false
return
end
# If C button was pressed
if Input.trigger?(Input::C)
# If unable to use because SP ran out
unless @actor.skill_can_use?(@skill.id)
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
# If target is all
if @target_window.index == -1
# Apply skill use effects to entire party
used = false
for i in $game_party.actors
used |= i.skill_effect(@actor, @skill)
end
end
# If target is user
if @target_window.index <= -2
# Apply skill use effects to target actor
target = $game_party.actors[@target_window.index + 10]
used = target.skill_effect(@actor, @skill)
end
# If single target
if @target_window.index >= 0
# Apply skill use effects to target actor
target = $game_party.actors[@target_window.index]
used = target.skill_effect(@actor, @skill)
end
# If skill was used
if used
# Play skill use SE
$game_system.se_play(@skill.menu_se)
# Use up SP
@actor.sp -= @skill.sp_cost
# Remake each window content
@status_window.refresh
@skill_window.refresh
@target_window.refresh
# If entire party is dead
if $game_party.all_dead?
# Switch to game over screen
$scene = Scene_Gameover.new
return
end
# If command event ID is valid
if @skill.common_event_id > 0
# Command event call reservation
$game_temp.common_event_id = @skill.common_event_id
# Switch to map screen
$scene = Scene_Map.new
return
end
end
# If skill wasn't used
unless used
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
end
return
end
end
def update_stat
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
@skill_window.active = true
@stat_window.dispose
@info_window.set_text("Press 'Z' for aditional skill information")
return
end
end
end
#==============================================================================
# ** Window_Skill
#------------------------------------------------------------------------------
# This window displays usable skills on the skill and battle screens.
#==============================================================================
class Window_Skill < Window_Selectable
#--------------------------------------------------------------------------
# * Object Initialization
# actor : actor
#--------------------------------------------------------------------------
def initialize(actor)
super(0, 128, 640, 288)
@actor = actor
@column_max = 2
refresh
self.index = 0
# If in battle, move window to center of screen
# and make it semi-transparent
if $game_temp.in_battle
self.y = 64
self.height = 256
self.back_opacity = 160
end
end
#--------------------------------------------------------------------------
# * Acquiring Skill
#--------------------------------------------------------------------------
def skill
return @data[self.index]
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@data = []
for i in 0...@actor.skills.size
skill = $data_skills[@actor.skills[i]]
if skill != nil
@data.push(skill)
end
end
# If item count is not 0, make a bit map and draw all items
@item_max = @data.size
if @item_max > 0
self.contents = Bitmap.new(width - 32, row_max * 32)
for i in 0...@item_max
draw_item(i)
end
end
end
#--------------------------------------------------------------------------
# * Draw Item
# index : item number
#--------------------------------------------------------------------------
def draw_item(index)
skill = @data[index]
if @actor.skill_can_use?(skill.id)
self.contents.font.color = normal_color
else
self.contents.font.color = disabled_color
end
x = 4 + index % 2 * (288 + 32)
y = index / 2 * 32
rect = Rect.new(x, y, self.width / @column_max - 32, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
bitmap = RPG::Cache.icon(skill.icon_name)
opacity = self.contents.font.color == normal_color ? 255 : 128
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
self.contents.draw_text(x + 28, y, 204, 32, skill.name, 0)
self.contents.draw_text(x + 232, y, 48, 32, skill.sp_cost.to_s, 2)
end
#--------------------------------------------------------------------------
# * Help Text Update
#--------------------------------------------------------------------------
def update_help
@help_window.set_text(self.skill == nil ? "" : self.skill.description)
end
end
#==============================================================================
# ** Window_Stat
#------------------------------------------------------------------------------
# This window displays usable skills on the skill and battle screens.
#==============================================================================
class Window_Stat < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
# actor : actor
#--------------------------------------------------------------------------
def initialize(skill_id)
super(320, 128, 320, 200)
@skill_id = skill_id
self.contents = Bitmap.new(width - 32, height - 32)
self.z = 1000
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
info = Skill_Info.skill(@skill_id)
self.contents.clear
self.contents.draw_text(4,0,150,32,'Elemental Attack')
info[0].each_index{|i|
bitmap = RPG::Cache.icon(info[0][i])
self.contents.blt(160+(i*32),0,
bitmap,Rect.new(0, 0, bitmap.width, bitmap.height))}
self.contents.draw_text(4,32,150,32,'Status Inflicted')
info[1].each_index{|i|
bitmap = RPG::Cache.icon(info[1][i])
self.contents.blt(160+(i*32),32,
bitmap,Rect.new(0, 0, bitmap.width, bitmap.height))}
self.contents.draw_text(4,64,150,32,'Charge Time')
self.contents.draw_text(160,64,150,32,info[2].to_s)
self.contents.draw_text(4,96,150,32,'Recovery Time')
self.contents.draw_text(160,96,150,32,info[3].to_s)
self.contents.draw_text(4,128,150,32,'Threat Rating')
self.contents.draw_text(160,128,150,32,info[4].to_s)
end
end
Thanks again, nath! With that new code I've been able to add additional slots without any problems. I see also how I have the ability to change the other fields to images if I want. Very nice job!
The only issue I've found is that the help window doesn't appear once you've left the skill menu:
(http://images.yuku.com/image/png/16f257d5ed22ee06d0cb1cc741eae59109edc78.png)
i forgot to dispose it noticed you wanted it added to the battle scene if you using the default battle system should work now
module Skill_Info
def self.skill(id)
case id
when 1
elemental_attack = ['043-Item12','044-Skill01']
status_inflicted = ['046-Skill03']
charge_time = '1'
recovery_time = '2'
threat_rating = '3'
else
elemental_attack = ['','']
status_inflicted = ['']
charge_time = ''
recovery_time = ''
threat_rating = ''
end
return [elemental_attack,status_inflicted,charge_time,recovery_time,
threat_rating]
end
end
#==============================================================================
# Scene_Skill
#==============================================================================
class Scene_Skill
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
alias info_menu main
def main
@info_window = Window_Help.new
@info_window.y = 416
@info_window.set_text("Press 'Z' for aditional skill information")
info_menu
@info_window.dispose
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
alias info_update update
def update
@status_window.update
info_update
if @stat_window != nil && @stat_window.visible
update_stat
return
end
end
#--------------------------------------------------------------------------
# * Frame Update (if skill window is active)
#--------------------------------------------------------------------------
alias info_update_skill update_skill
def update_skill
info_update_skill
if Input.trigger?(Input::A)
$game_system.se_play($data_system.cursor_se)
@skill_window.active = false
@skill = @skill_window.skill
@stat_window = Window_Stat.new(@skill.id)
@info_window.set_text("Press 'B' to return to the general list of skills")
end
end
#--------------------------------------------------------------------------
# * Update Stat(if stat window is active)
#--------------------------------------------------------------------------
def update_stat
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
@skill_window.active = true
@stat_window.dispose
@stat_window = nil
@info_window.set_text("Press 'Z' for aditional skill information")
return
end
end
end
#==============================================================================
# Scene Battle
#==============================================================================
class Scene_Battle
def start_skill_select
# Make skill window
@skill_window = Window_Skill.new(@active_battler)
# Associate help window
@skill_window.help_window = @help_window
@info_window = Window_Help.new
@info_window.y = 256
@info_window.set_text("Press 'Z' for aditional skill information")
# Disable actor command window
@actor_command_window.active = false
@actor_command_window.visible = false
end
def update_phase3
# If enemy arrow is enabled
if @enemy_arrow != nil
update_phase3_enemy_select
# If actor arrow is enabled
elsif @actor_arrow != nil
update_phase3_actor_select
# If skill window is enabled
elsif @skill_window != nil && @skill_window.active
update_phase3_skill_select
# If item window is enabled
elsif @item_window != nil
update_phase3_item_select
# If actor command window is enabled
elsif @actor_command_window.active
update_phase3_basic_command
end
end
alias info_update_phase3_skill_select update_phase3_skill_select
def update_phase3_skill_select
info_update_phase3_skill_select
if Input.trigger?(Input::A)
$game_system.se_play($data_system.cursor_se)
@skill_window.active = false
@skill = @skill_window.skill
@stat_window = Window_Stat.new(@skill.id)
@info_window.set_text("Press 'B' to return to the general list of skills")
end
end
alias info_update update
def update
@status_window.update
info_update
if @stat_window != nil && @stat_window.visible
update_stat
return
end
end
def update_stat
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
@skill_window.active = true
@stat_window.dispose
@stat_window = nil
@info_window.set_text("Press 'Z' for aditional skill information")
return
end
end
alias info_end_skill_select end_skill_select
def end_skill_select
@info_window.dispose
info_end_skill_select
end
end
#==============================================================================
# ** Window_Skill
#------------------------------------------------------------------------------
# This window displays usable skills on the skill and battle screens.
#==============================================================================
class Window_Skill < Window_Selectable
#--------------------------------------------------------------------------
# * Object Initialization
# actor : actor
#--------------------------------------------------------------------------
def initialize(actor)
super(0, 128, 640, 288)
@actor = actor
@column_max = 2
refresh
self.index = 0
# If in battle, move window to center of screen
# and make it semi-transparent
if $game_temp.in_battle
self.y = 64
self.height = 192
self.back_opacity = 160
end
end
end
#==============================================================================
# ** Window_Stat
#------------------------------------------------------------------------------
# This window displays usable skills on the skill and battle screens.
#==============================================================================
class Window_Stat < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
# actor : actor
#--------------------------------------------------------------------------
def initialize(skill_id)
super(320, 128, 320, 192)
@skill_id = skill_id
self.contents = Bitmap.new(width - 32, height - 32)
self.z = 1000
if $game_temp.in_battle
self.y = 64
self.height = 192
self.back_opacity = 160
end
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
info = Skill_Info.skill(@skill_id)
self.contents.clear
self.contents.draw_text(4,0,150,32,'Elemental Attack')
info[0].each_index{|i|
bitmap = RPG::Cache.icon(info[0][i])
self.contents.blt(160+(i*32),0,
bitmap,Rect.new(0, 0, bitmap.width, bitmap.height))}
self.contents.draw_text(4,32,150,32,'Status Inflicted')
info[1].each_index{|i|
bitmap = RPG::Cache.icon(info[1][i])
self.contents.blt(160+(i*32),32,
bitmap,Rect.new(0, 0, bitmap.width, bitmap.height))}
self.contents.draw_text(4,64,150,32,'Charge Time')
self.contents.draw_text(160,64,150,32,info[2].to_s)
self.contents.draw_text(4,96,150,32,'Recovery Time')
self.contents.draw_text(160,96,150,32,info[3].to_s)
self.contents.draw_text(4,128,150,32,'Threat Rating')
self.contents.draw_text(160,128,150,32,info[4].to_s)
end
end
Simply amazing. Works like a charm. :D
Thanks again for the swift response, your excellent work, and for your patience with me!