Skill Equipment System
Authors: game_guy & KK20
Version: 1.4
Type: Skill Equipping
Key Term: Custom Skill System
IntroductionOkay well its a system that makes it so you can't use all of your skills at once while in battle. Instead you have to equip them. Now here's the catch. Every skill has its own "ap" so when its equipped it takes some of the actor's ap. That way you can't use all of your skills and it adds some uniqueness to the game.
Features
- Equip Skills Strategically
- Only Equip Limited Amount of Skills Using Ap
- Have Different Starting Ap for Each Actor
- Have Different Ap Gain for Each Actor per Level Up
- Have Different Ap for Each Skill
- Have an Exit Scene for When the Skill Equipment Closes
- Permanently Learn Skills (Thanks KK20)
- Certain skills cannot be equipped together at the same time (Thanks KK20)
Screenshots(http://i678.photobucket.com/albums/vv143/GameGuysProjects/skill.png)
DemoUpdating Demo
Script
#===============================================================================
# Skill Equipment System
# Author game_guy
# Editted by KK20
# Version 1.4
#-------------------------------------------------------------------------------
# Intro:
# Okay well its a system that makes it so you can't use all of your skills at
# once while in battle. Instead you have to equip them. Now here's the catch.
# Every skill has its own "ap" so when its equipped it takes some of the actor's
# ap. That way you can't use all of your skills and it adds some uniqueness to
# the game.
#
# Features:
# Equip Skills Strategically
# Only Equip Limited Amount of Skills Using Ap
# Have Different Starting Ap for Each Actor
# Have Different Ap Gain for Each Actor per Level Up
# Have Different Ap for Each Skill
# Have an Exit Scene for When the Skill Equipment Closes
#
# Instructions:
# Okay so these could be confusing but lets try and get through this.
# Okay they're not that confusing. Okay so go down where it says
# # Begin Config
# And do all of you're configuration there.
#
# Now theres some stuff you need to know.
#
# When adding a skill it does not automatically equip it. So to equip a
# skill use this
# $game_actors[actor_id].equip_skill(skill_id)
# To unequip a skill use this
# $game_actors[id].remove_skill(skill_id)
#
# Now it will not equip it unless there's enough ap left. So you can either do
# this $game_actors[id].add_map(amount) to add to max ap or you can do this
# $game_actors[id].clear_skills to unequip all skills and give all ap back.
# Just to make it a bit easier.
#
# You can always remove max ap to by doing this
# $game_actors[id].remove_map(amount) but note that doing that clears the
# equipped skills as well to avoid any problems.
#
# To open the skill equipment scene use this.
# $scene = $scene = Scene_SkillEquip.new(actor_id)
# To tell if a skill is equipped or not you'll notice the text is greyed out.
# That means it equipped. If its white it means it can be equipped.
# In the scene though to equip/unequip things just press the action button.
#
# Well thats about it.
# Credits:
# game_guy ~ for making it
# Ethan ~ for the idea of it
# Branden ~ beta testing
#
# Enjoy and give credits.
#===============================================================================
# [ KK20's change notes ]
#
# V 1.4
# - Cleaned up and modified a bit of the existing methods in Game_Actor
# - Fixed the AP display in the window
# - Allow user to show the skill's AP cost instead of its SP cost in the scene
# - Added new feature: Permanent Skills
# + Skills can be permanently equipped
# + Script call for this is as follows:
# $game_actors[id].learn_skill(skill_id, true)
# - Added new feature: Skill Limitations
# + Certain skills cannot be equipped together at the same time
#===============================================================================
module GameGuy
#---------------------------------------------------------------------------
# ApWord = This is the word that displays when showing the ap the actor
# has.
#---------------------------------------------------------------------------
ApWord = "AP"
#---------------------------------------------------------------------------
# StartingAp = The starting ap for every actor. Different amounts can be
# defined below at # Config Starting Ap.
#---------------------------------------------------------------------------
StartingAp = 5
#---------------------------------------------------------------------------
# ApCost = The default ap cost for all skills. Different amounts can be
# defined below at # Config Ap Costs.
#---------------------------------------------------------------------------
ApCost = 1
#---------------------------------------------------------------------------
# ApGain = The max ap gained when an actor levels up. Different amounts
# can be defined below at # Config Sp Gain
#---------------------------------------------------------------------------
ApGain = 2
#---------------------------------------------------------------------------
# DisplayAP = Will display AP costs instead of SP in the scene.
# Set to true if you wish to use this. Use false otherwise.
#---------------------------------------------------------------------------
DisplayAP = true
#---------------------------------------------------------------------------
# ExitScene = The scene it goes to when the Skill Equipment closes.
#
#---------------------------------------------------------------------------
ExitScene = Scene_Menu.new
#---------------------------------------------------------------------------
# SkillLimit = A series of arrays that represent what skills cannot
# be equipped at the same time.
# Examples: [[2,3]]
# >> Greater Heal and Mass Heal cannot be equipped together
#
# [[7,10],[7,11],[7,12],[8,10],[8,11],[8,12],[9,10],[9,11],[9,12]]
# >> Cannot equip any type of fire spell along with an ice spell
#
# [[53,54,55,56]]
# >> Can only equip one: Sharp, Barrier, Resist, Blink
#---------------------------------------------------------------------------
SkillLimit = [[7,10],[7,11],[7,12],[8,10],[8,11],[8,12],[9,10],[9,11],[9,12]]
# SkillLimit = [] # <--If you do not wish to use this feature, do this
def self.start_ap(id)
case id
#-------------------------------------------------------------------------
# Config Starting Ap
# Use this when configuring
# when actor_id then return starting_ap
#-------------------------------------------------------------------------
when 1 then return 10 # Actor 1 : Aluxes
when 2 then return 8 # Actor 2 : Basil
end
return StartingAp
end
def self.skill_ap(id)
case id
#-------------------------------------------------------------------------
# Config Ap Costs
# Use this when configuring
# when skill_id then return ap_cost
#-------------------------------------------------------------------------
when 1 then return 2 # Skill Id 1 : Heal
when 7 then return 3 # Skill Id 7 : Fire
when 57 then return 6
end
return ApCost
end
def self.ap_gain(id)
case id
#-------------------------------------------------------------------------
# Config Ap gain
# Use this when configuring
# when actor_id then return ap_gain
#-------------------------------------------------------------------------
when 1 then return 4 # Actor 1 : Aluxes
end
return ApGain
end
end
#==============================================================================
# Game_Actor
#------------------------------------------------------------------------------
# Added stuff for Skill Equipping.
#==============================================================================
class Game_Actor < Game_Battler
attr_accessor :eskills
attr_accessor :skills
attr_accessor :skillap
attr_accessor :skillmaxap
alias gg_add_stuff_lat_ap setup
def setup(actor_id)
@actor = $data_actors[actor_id]
@skillap = GameGuy.start_ap(actor_id)
@skillmaxap = GameGuy.start_ap(actor_id)
@eskills = []
return gg_add_stuff_lat_ap(actor_id)
end
def skill_learn?(skill_id)
return @skills.include?(skill_id) || @eskills.include?(skill_id)
end
def learn_skill(skill_id, perm = false)
if perm and skill_id > 0
remove_skill(skill_id) if @skills.include?(skill_id)
@eskills.delete(skill_id)
@skills.push(skill_id)
@skills.sort!
elsif skill_id > 0 and not skill_learn?(skill_id)
@eskills.push(skill_id)
@eskills.sort!
end
end
def forget_skill(skill_id)
remove_skill(skill_id)
@eskills.delete(skill_id)
end
def equip_skill(skill_id)
return unless skill_id > 0 && @eskills.include?(skill_id)
potential_ap = @skillap
removal_list = []
GameGuy::SkillLimit.each{|set|
if set.include?(skill_id)
set.each{|id|
if @skills.include?(id) && @eskills.include?(id) && !removal_list.include?(id)
potential_ap += GameGuy.skill_ap(id)
removal_list.push(id)
end
}
end
}
if potential_ap >= GameGuy.skill_ap(skill_id)
removal_list.each{|id| remove_skill(id)}
@skillap -= GameGuy.skill_ap(skill_id)
@skills.push(skill_id)
@skills.sort!
return true
else
return false
end
end
def remove_skill(id)
@skillap += GameGuy.skill_ap(id) if (@skills.include?(id) and @eskills.include?(id))
@skills.delete(id)
end
def add_map(n)
@skillmaxap += n
clear_skills
@skillap = @skillmaxap
end
def remove_map(n)
@skillmaxap -= n
if @skillmaxap < 0
@skillmaxap = 0
end
if @skillap > @skillmaxap
@skillap = @skillmaxap
end
clear_skills
end
def exp=(exp)
@exp = [[exp, 9999999].min, 0].max
while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0
@level += 1
@skillap += GameGuy.ap_gain(@id)
@skillmaxap += GameGuy.ap_gain(@id)
for j in $data_classes[@class_id].learnings
if j.level == @level
learn_skill(j.skill_id)
end
end
end
while @exp < @exp_list[@level]
@level -= 1
end
@hp = [@hp, self.maxhp].min
@sp = [@sp, self.maxsp].min
end
def clear_skills
deleting_these = @skills.clone
deleting_these.each{|id| @skills.delete(id) if @eskills.include?(id) }
@skillap = @skillmaxap
end
end
#==============================================================================
# Window_GGAPSkill
#------------------------------------------------------------------------------
# Copy of Window_Skill but just slightly different.
#==============================================================================
class Window_GGAPSkill < Window_Selectable
def initialize(actor)
super(0, 128, 640, 352)
@actor = actor
@column_max = 2
refresh
self.index = 0
end
def skill
return @data[self.index]
end
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@data = []
for i in 0...@actor.eskills.size
skill = $data_skills[@actor.eskills[i]]
if skill != nil
@data.push(skill)
end
end
@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
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
def update_help
@help_window.set_text(self.skill == nil ? "" : self.skill.description)
end
end
#==============================================================================
# Window_GGAPSkillEquip
#------------------------------------------------------------------------------
# Window uses for equipping skills.
#==============================================================================
class Window_GGAPSkillEquip < Window_Selectable
def initialize(actor)
super(0, 128, 640, 352)
@actor = actor
@column_max = 2
refresh
self.index = 0
end
def skill
return @data[self.index]
end
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@data = []
for i in 0...@actor.eskills.size
skill = $data_skills[@actor.eskills[i]]
if skill != nil
@data.push(skill)
end
end
@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
def draw_item(index)
skill = @data[index]
if @actor.skills.include?(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)
if GameGuy::DisplayAP
self.contents.draw_text(x + 232, y, 48, 32, GameGuy.skill_ap(skill.id).to_s, 2)
else
self.contents.draw_text(x + 232, y, 48, 32, skill.sp_cost.to_s, 2)
end
end
def update_help
@help_window.set_text(self.skill == nil ? "" : self.skill.description)
end
end
#==============================================================================
# Window_GGActorAp
#------------------------------------------------------------------------------
# Window used to display AP and Actor name.
#==============================================================================
class Window_GGActorAp < Window_Base
def initialize(actor)
super(0,64,640,64)
self.contents = Bitmap.new(width-32,height-32)
@actor = $game_actors[actor]
refresh
end
def refresh
self.contents.clear
ap = GameGuy::ApWord
self.contents.draw_text(0, 0, 640, 32, "#{@actor.name}")
self.contents.draw_text(0, 0, 640-32, 32, "#{ap} #{@actor.skillap} / " +
"#{@actor.skillmaxap}", 2)
end
end
#==============================================================================
# Scene_Skill
#------------------------------------------------------------------------------
# Just slightly modded the main method.
#==============================================================================
#==============================================================================
# Scene_SkillEquip
#------------------------------------------------------------------------------
# The scene that deals with equipping skills.
#==============================================================================
class Scene_SkillEquip
def initialize(actor_id=1)
@id = actor_id
end
def main
@actor = $game_actors[@id]
@help_window = Window_Help.new
@skill_window = Window_GGAPSkillEquip.new(@actor)
@skill_window.help_window = @help_window
@status_window = Window_GGActorAp.new(@actor.id)
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
@help_window.dispose
@skill_window.dispose
@status_window.dispose
end
def update
@help_window.update
@skill_window.update
@status_window.update
if @skill_window.active
update_skill
return
end
end
def update_skill
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = GameGuy::ExitScene
return
end
if Input.trigger?(Input::C)
skill = @skill_window.skill
if @actor.skills.include?(skill.id)
$game_system.se_play($data_system.decision_se)
@actor.remove_skill(skill.id)
else
result = @actor.equip_skill(skill.id)
if result
$game_system.se_play($data_system.decision_se)
else
$game_system.se_play($data_system.buzzer_se)
end
end
@status_window.refresh
@skill_window.refresh
return
end
end
end
InstructionsIn the script.
CompatibilityNot tested with SDK.
The Skill Equipment System is not compatible with the "Materia-System"(from "SepirothSpawn" and the translated/modified ones)
The Skills, which are added by a materia aren`t appended in the Skill Equipment Screen.
Credits and Thanks
- game_guy ~ for making it
- KK20 ~ For adding new features and optimizing the script
- Ethan ~ for making the idea of it
- Branden ~ beta testing
Author's NotesGive credits and enjoy!
Nice, don't know about uniqueness though :P Does it work with Blizz ABS?
Shouldn't white be equipped and greyed out be non-equipped? :P
I'm going to test it with Blizz-Abs and aqua I'll switch it real fast
EDIT:
Switched the colors aqua need to update the demo tho
EDIT 2:
Updated demo
EDIT 3:
Works with Blizz-Abs
Lol...I could have told you that it was compatible with Blizz-ABS just by looking at the script... :P
I wouldn't call it AP, just because of the EQUAP skills in Tons of Addons.
well it is changable and I named the actors variabls differently so its ok.
Sounds still like EQUAP. ._.
Yea but this doesnt use equipment for skills, you literally equip skills to the actor not using weapons or armor that way you actor doesnt have a crap load of spells to use in battle. It was my friends idea but yea you equip the spells to teh actor not through equipment
Ah, then I misunderstood the concept. Nice script. :D
Quote from: game_guy on September 27, 2009, 02:30:08 pm
well it is changable and I named the actors variabls differently so its ok.
yeah I noticed when I put it in my game.
Quote from: Blizzard on September 27, 2009, 02:58:50 pm
Ah, then I misunderstood the concept. Nice script. :D
Thanks :)
Anyways yea this didnt take long to make but I feel there should still be something added...its probably just me but anyone have any suggestions?
found a bug.
when you call the equip skill from the map it doesn't update ap
because you only have ap update during the equip scene.
solution: move ap change to the equip_skill method.
doing that right now
EDIT: Updated demo and script, fixed minor bug....
I downloaded the demo and got this error when tried to equip a skill
Script 'Skill Equipment System' line 151 nomethoderror ocurred
undefined method 'skillap' for nil:Nilclass
updated, try it now
now it says, in the same line
undefined method 'skillap' for #<RPG::Actor:0x14c0c70> :(
now try it I think I fixed it for sure.
Sounds fantastic!!
I'll have to try it out!!
*updates yet again* Fixed another small bug
Have you thought about making an identical script that utilizes a cap rather than AP?? Like, I have played games where you have all your skills, but you don't have to have a certain AP / SP to equip them. You can just equip so many. Like, you have learned 16skills, but you can only equip 4at a time.
It would keep it's strategic nature, as you would be strategically equipping your skills for specific boss battles and what not.
It would parallel this system beautifully.
This can be that way, name the Ap to Caps, make every skill only cost 1.
EDIT:
Change this
to 1 then below in the Config Ap Cost change it to this
def self.skill_ap(id)
case id
#-------------------------------------------------------------------------
# Config Ap Costs
# Use this when configuring
# when skill_id then return ap_cost
#-------------------------------------------------------------------------
when 0 then return 1
end
return ApCost
end
-slaps himself in the face and walks away (tail between his legs)-
I tried the script in a fresh new project, just in cas and y must say that god has something against me or this scritpt :evil:,
now the error is in line 152, NameError ocurred
undefined local variable or method 'skill' for <#gameactor:0x15d7e50>
now try sorry I'm making such noob scripting mistakes I'm just off today lol
It works fine now, thank you
EDIT: I didn't notice this before but now i can't go to the normal Skill menu
Then its gotta be your scripts, this script in no way messes with Scene_Skill is there an error or what? And are you using the modded menu I placed in the demo? if so then dont use it, the menu's probably bugged
No, i tried in a new project and still get this:
Script Window Base line 23 nomethoderror
undefined method name for nil:class
I'll look into it later....I'm busy right now but I'll be sure to fix it.
Oh, naughty Game_Guy releasing buggy scripts!! O.o
*updates yet again*
Okay I for sure fixed it this time I even tested it this time :P
Sorry for all the bugs like I said I usually have people test it. I had one person is all.
EDIT:
Frick dude I made tons of mistakes in this one, anyways updated again!
Mistakes don't matter so long as you're willing to fix them. =D.
Now it really works but i found a small bug :^_^': : if your charcter doen's have a skill and you go to the skill equip window, you can equip an 'invicible' skill wich cannot be removed and will take up your AP!
I know it can be easily avoided,there is no need to fix that, just wanted to let you know ;)
Sorry for the double post but i got an idea: force some skills to be always equipped or hide them from the skillequip window.
Nice idea, I might implement it later.
I'm sorry for bringing up thi topic, but I'm getting an error:
Script "Skill Equipment System" line 194 NoMethodError occurred.
Undefined method `+' for nil:NilClass
It happens when I use a call script to increase max ap of a character.
This is the call script: "$game_actors[1].add_map(1)"
Could somebody help me? :(
Updated and fix. Thanks for reporting the bug. :)
The error is fixed :D and pretty quickly too! ;)
...sadly... I think I found another bug :(
If I use a call script to increase max AP, the AP doesn't get updated...
Take a look at the image:
(http://img689.imageshack.us/img689/928/94581392.jpg)
In case you're wondering, the max AP is 4, and I have no skills equiped...
However the available AP is just 3 :huh:
Sorry if this is a bit confusing; basically what I'm trying to say is:
If I use a call script to increase max AP, the max AP increases; but I can only use the AP I had before. Not sure if it's just me :???:
Updated again. I think I fixed it for sure.
Totally working! :haha:
Thank you SO very much!
I luved yanfly's vx one, but unfortunately, I think this one needs the different types that are visible in hers, such as offensive, defensive, healing, and "BADASS ULTRA MEGA SUPER-DUPER EXTREMELY ULTIMATELY ETERNALLY THE VERY BEST OF ANY F*CKING THING EVAAAAAAAAARHHHH". And Status-Altering.
see example below. Note that the badass thingamabob is "Ultimate"
(http://pockethouse.files.wordpress.com/2009/05/ess_title1.jpg?w=450&h=363)
You'll want to look at the part with the different circles with colours in them. If you look closely, you can see red, blue, green, yellow, black, and grey! PLUS you can see a weird circle with a crazeh line running through it in what's supposed to be gold, and a paralelogram/rectangle with a shadow (commonly known as a 'card') in a purple colour. Next to each of the colours, you can see a name and a number, the name being the name of the icon or type of type (...), and the number being how many you can have of that type of type (... - again) equipped at any given time. Of course, different classes/actor (/ maybe even races, to get some other use of your new script?) should have different limitations.
An example for THAT could be that a 'Badass Dark Warrior of the Extremely Dead and Also Pie' shouldn't be able to use five 'Healing Spells That Always Crits and That ALWAYS Heal 500% Of Every Actor and Enemy's Health!!', but instead have more of the badass thingamabob spells.
If you follow me, good for you! If you don't I really couldn't care less. Except for the fact that you're sliiiightly dumb. And former presidents aren't excused for being dumb here. Nor those that aren't former, but are actually president.
EDIT: Just hit me that I don't think I've replied to any of your scripts with a 100% nice comment :\ I never knew I was that mean :(
-Peace out
This isn't madness...
This... is... SPARTAAAAAAAAAAAAAA! (I just had to. :3)
@Blizz: LOL Nice
@Eternal: I'm not going to add different AP types. I'm keeping the script as is. I want to keep this script simple so it stays as is. Its a very nice idea though but I don't want to implement it.
Well, im using it anyway :P
any chance you could make it so we can select which abilities must be equipped like this and which are always available?
that would really help, since I want my game to have augment abilities that need to be equipped like this, but I still want the normal command skills to be accessible at all times. I don't even want them to appear in the 'equip skill' menu.
...please?
Sorry I'm not gonna do it. I made the script the way I wanted it. That idea occurred to me but I like it this way.
Cool definitely using this
How could I edit this so that if an actor learns a new skill while there is enough ap to learn it, it is automatically equipped? Say during a battle I have an actor learn a skill and I want him to be able to use it that battle.
Oh, well, as far as suggestions go, why not add a "passive skills" factor to this as well? Whether it be in conjunction to the 'passive skills' from TONs, or its your own, it would add to this simple yet ingenious system, if you could equip a skill called "STR + 20%" or "DEX + 40" and it did as the name suggested.
On that note of passive skills, you could really dive into a whole new field including dual-wielding passives, critical bonus, etc.
Passive skills in combination with skill equipping really adds customization to a game.
And I try to utilize them to some degree in in games I dawdle with, so if yu need further details or suggestions for passive skill ideas, jus ask :D
--JeR
I was thinking about making my own passive skills script that does all that and more.
Well... :D
I think the community of Chaos Project could appreciate it.
Quote from: jragyn00 on May 14, 2010, 11:19:04 pm
Well... :D
I think the community of Chaos Project would appreciate it.
Fix'd.
Haha thanks. In that case I may get started on it tonight. Maybe not, I just got done throwing up. Think I'm gonna go rest for a little.
Sorry for bringing up this topic, but it's an awesome idea.
I have :
Script "Skill" line 289 nomethod error
undefined "size" for nilclass
This seems to happen for ID characters beyond 2
$scene = $scene =
Scene_SkillEquip.new(4)
Also, what's this eskills and eeskills?
----------------------------------------
Can anyone help, thank you.
EDIT: I believe this conflicts with Tankentai SBS, if that's the case, then maybe I'll make an event version
I´ve got a similar problem like FuriKuri.
When my characters level up, there comes a error:
QuoteScript ´Skill Equip´ line 194: NoMethodError occurred.
undefined method `+´ for nil:NilClass
I also used a clean project, so it shoudn`t be a problem with the compatibility with other scripts.
I'll take a look at it.
Its been almost a year G_G, hows that passive skill's script coming? haha.
Wohoo, I think I fixed it.
It isn`t a big change, but well, this is the first time I believe, that I understand a script.
In line 186(default), change:
Quote@ap += GameGuy.ap_gain(@id)
to:
Quote@skillap += GameGuy.ap_gain(@id)
@skillmaxap += GameGuy.ap_gain(@id)
Hope this is right, but it works in my game ;)
Notification:
The Skill Equipment System is not compatible with the "Materia-System"(from "SepirothSpawn"
and the translated/modified ones)
The Skills, which are added by a materia aren`t appended in the Skill Equipment Screen.
*adds materia to compatibility issues, goes to fix script*
EDIT:
*posted fix*
*adds to "List of Scripts to Improve" list*
Is there a way to add this as a command in the menu. I mean so that I can call the scene from the menu?
I have a lot of characters in my game and find it hard to find a way to call the skill equip scene for a certain character without using a lot of conditional branches and events...
(I hope you understand what I mean, my english isn't very good after all...)
http://forum.chaos-project.com/index.php/topic,164.0.html
Read number 6.a.
Thanks :)
Hmm, I added it to the menu. But it only opens the first characters Skill Equip scene... I used:
when 5 #Skillequip
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to Skill Equip
$scene = Scene_SkillEquip.new
And it opens the character with the first ID's skillequip.
if I use this:
when 5 #Skillequip
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to Skill Equip
$scene = Scene_SkillEquip.new(@status_window.index)
I get an error.
I want to be able to choose the character as in Status, Equip and so on. Is that possible with this script?
Thank you^^
Are you using the default menu?
Yes, I am:O
See if this works.
#==============================================================================
# ** Scene_Menu
#------------------------------------------------------------------------------
# This class performs menu screen processing.
#==============================================================================
class Scene_Menu
#--------------------------------------------------------------------------
# * Object Initialization
# menu_index : command cursor's initial position
#--------------------------------------------------------------------------
def initialize(menu_index = 0)
@menu_index = menu_index
end
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def main
# Make command window
s1 = $data_system.words.item
s2 = $data_system.words.skill
s3 = $data_system.words.equip
s4 = "Status"
s5 = "Skill Equip"
s6 = "Save"
s7 = "End Game"
@command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6, s7])
@command_window.index = @menu_index
# If number of party members is 0
if $game_party.actors.size == 0
# Disable items, skills, equipment, and status
@command_window.disable_item(0)
@command_window.disable_item(1)
@command_window.disable_item(2)
@command_window.disable_item(3)
end
# If save is forbidden
if $game_system.save_disabled
# Disable save
@command_window.disable_item(4)
end
# Make play time window
@playtime_window = Window_PlayTime.new
@playtime_window.x = 0
@playtime_window.y = 224
# Make steps window
@steps_window = Window_Steps.new
@steps_window.x = 0
@steps_window.y = 320
# Make gold window
@gold_window = Window_Gold.new
@gold_window.x = 0
@gold_window.y = 416
# Make status window
@status_window = Window_MenuStatus.new
@status_window.x = 160
@status_window.y = 0
# 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
@command_window.dispose
@playtime_window.dispose
@steps_window.dispose
@gold_window.dispose
@status_window.dispose
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
# Update windows
@command_window.update
@playtime_window.update
@steps_window.update
@gold_window.update
@status_window.update
# If command window is active: call update_command
if @command_window.active
update_command
return
end
# If status window is active: call update_status
if @status_window.active
update_status
return
end
end
#--------------------------------------------------------------------------
# * Frame Update (when command window is active)
#--------------------------------------------------------------------------
def update_command
# If B button was pressed
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Switch to map screen
$scene = Scene_Map.new
return
end
# If C button was pressed
if Input.trigger?(Input::C)
# If command other than save or end game, and party members = 0
if $game_party.actors.size == 0 and @command_window.index < 4
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
# Branch by command window cursor position
case @command_window.index
when 0 # item
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to item screen
$scene = Scene_Item.new
when 1 # skill
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Make status window active
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 2 # equipment
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Make status window active
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 3, 4 # status
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Make status window active
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 5 # save
# If saving is forbidden
if $game_system.save_disabled
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to save screen
$scene = Scene_Save.new
when 6 # end game
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to end game screen
$scene = Scene_End.new
end
return
end
end
#--------------------------------------------------------------------------
# * Frame Update (when status window is active)
#--------------------------------------------------------------------------
def update_status
# If B button was pressed
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Make command window active
@command_window.active = true
@status_window.active = false
@status_window.index = -1
return
end
# If C button was pressed
if Input.trigger?(Input::C)
# Branch by command window cursor position
case @command_window.index
when 1 # skill
# If this actor's action limit is 2 or more
if $game_party.actors[@status_window.index].restriction >= 2
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to skill screen
$scene = Scene_Skill.new(@status_window.index)
when 2 # equipment
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to equipment screen
$scene = Scene_Equip.new(@status_window.index)
when 3 # status
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to status screen
$scene = Scene_Status.new(@status_window.index)
when 3
$game_system.se_play($data_system.decision_se)
actor_id = $game_party.actors[@status_window.index].id
$scene = Scene_SkillEquip.new(actor_id)
end
return
end
end
end
:D Ah, it worked!
Thank you very much;)
Hey, I have no technical problems with the script, but for some reason, when I equip the skill I want in the menu, it doesn't stay equipped. Like right after I equip it and go to the skills menu, it's visible, but the second I move, and I look back into my skills menu, it's gone. Any ideas? Or am I just a noob haha
Hey guys :)
This script is REALLY awesome and a great idea, it's all working fine for me (I'm using it as an additional choice
in the custom menu) except for one little thing:
(http://s14.directupload.net/images/120914/wdqm6izp.jpg)
The SP (or 'AP', I changed the name) on the right side are not being shown properly !!
The text needs to be a little more on the left ... I'm sorry but I'm a total noob regarding RubyScript :(
What line are the right 'coordinates' for this in ? I can't find it.
Another thing is:
I did configure the skill 'Querschnitt' to need 5 FP to be used, but it still shows '100' behind it (which is the mana cost).
Why is that ?
QuoteThe SP (or 'AP', I changed the name) on the right side are not being shown properly !!
Locate this:
self.contents.draw_text(0, 0, 640, 32, "#{ap} #{@actor.skillap} / " +
"#{@actor.skillmaxap}", 2)
Change the '640' to a smaller value.
QuoteI did configure the skill 'Querschnitt' to need 5 FP to be used, but it still shows '100' behind it (which is the mana cost).
This is intended--that is what the script does. You can even see in the screen shot example that the SP/MP cost is shown, not the AP cost. If you want it to show the AP cost instead, locate this:
self.contents.draw_text(x + 232, y, 48, 32, skill.sp_cost.to_s, 2)
and replace it all with this:
self.contents.draw_text(x + 232, y, 48, 32, GameGuy.skill_ap(skill.id).to_s, 2)
Thank you so much, it both worked great :)
Sorry for the double-post, but there is a very strange bug that keeps appearing...
Whenever my character leans a new spell due to a level-up, the spell is listed twice (!) in the
'Skill equipment" window...
but (!) if a spell is learned through an event command, it's not listed twice...
What the hell is going on? :D
And another little thing (which isn't that important) is:
If the Skill Equipment script is active, newly learned spells are not shown at the end of a fight (if you lvlup)
anymore (for example: Alex learned Ice !).
I'm using the standard combat system btw (if this helps) !
I can't seem to reproduce your first error. My actor learned the skill once. Go back and check to make sure you didn't configure something incorrectly.
As for the second, that feature is not even in the default RMXP. Go ahead and make a new game and do a test battle--it won't say "Actor X learned Y" upon level up. You must have used another script.
Oh yeah, stupid me...
I did actually use the EasyLvLUpNotifier by Blizzard !!
Just have to figure out how I can still make it show the newly learned spells now...^^
Well, did you really try it out by fighting enemies and lvling up after the fight ?!
Because this error happens to me everytime :(
If you just [add EXP] to your character until he lvls up, then it does not add the spell twice.
I also tried to add the spell to the configuration (i.e. giving it an individual SP cost) but it still
adds the spell twice ...
Could it be because there is NO new spell being learned at LvL 2 ?!
You just get a new spell at LvL 3, so maybe it adds it twice because there 'should' have been a new spell at lvl 2 also ?!
I donno :D
Yep. I'll tell you everything I did.
New Project. Change EXP growth rate for Aluxes to the lowest values (requires 10exp for level 2). Fighter class learns Feint Attack at level 2. Ghosts give 5exp each. Make new event that starts a battle with 2 Ghosts. Also make new event that allows me to view the Scene_SkillEquip. Test run game.
Level 2 after killing. Check the SkillEquip scene. Only Cross Cut and Feint Attack are in the list.
Make a new game and use only this script. If you are getting errors still, then I haven't the slightest clue.
EDIT: Upon further playing around, I found that you can actually make a class learn the same skill twice. Check your actor's class and make sure you didn't put two of the same skill listed. When I did this, I got two listings of the skill in my scene.
Quote from: KK20 on September 17, 2012, 10:45:32 pm
EDIT: Upon further playing around, I found that you can actually make a class learn the same skill twice. Check your actor's class and make sure you didn't put two of the same skill listed. When I did this, I got two listings of the skill in my scene.
I thought that you might ask that, but nope... the class learns the skill only once
due to the class window.
Quote from: KK20 on September 17, 2012, 10:45:32 pm
Yep. I'll tell you everything I did.
New Project. Change EXP growth rate for Aluxes to the lowest values (requires 10exp for level 2). Fighter class learns Feint Attack at level 2. Ghosts give 5exp each. Make new event that starts a battle with 2 Ghosts. Also make new event that allows me to view the Scene_SkillEquip. Test run game.
Level 2 after killing. Check the SkillEquip scene. Only Cross Cut and Feint Attack are in the list.
Make a new game and use only this script. If you are getting errors still, then I haven't the slightest clue.
Hmm, I'll try and edit this later on.
But try having no skill being learned at LvL 2, but one at LvL 3.
Edit:Ok now I'm getting really frustrated :(
If I copy the EXACT 2 scripts (Scene_Menu and SkillEquipping) from my main game to a new test-project
.... it all works fine :<_<:
Now I'll have to figure out what causes this bug in my main game.... *sigh*
This is gonna be hard I guess.
It sounds like the methods def learn_skill and/or def exp= are being overwritten by another script located below this script in your game. My suggestion is to SHIFT + CTRL + F for those two methods and see if they appear anywhere else in your scripts. The only ones we want to care about, though, come after this script.
After doing that, try placing this script as far down the list as you can go, but still being above Main.
The SkillEquipment script has already been the one right above main (by coincidence, I guess).
So these are the results of the search you recommended:
FOR DEF LEARN_SKILL ->1. In the script "
Game_Actor" :
#--------------------------------------------------------------------------
# * Learn Skill
# skill_id : skill ID
#--------------------------------------------------------------------------
def learn_skill(skill_id)
if skill_id > 0 and not skill_learn?(skill_id)
@skills.push(skill_id)
@skills.sort!
end
end
2. In the script "SkillEquipping" :
def learn_skill(skill_id)
if skill_id > 0 and not skill_learn?(skill_id)
@eskills.push(skill_id)
@eskills.sort!
end
end
FOR DEF EXP= ->1. In the script "
Game_Actor" :
#--------------------------------------------------------------------------
# * Change EXP
# exp : new EXP
#--------------------------------------------------------------------------
def exp=(exp)
@exp = [[exp, 9999999].min, 0].max
# Level up
while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0
@level += 1
# Learn skill
for j in $data_classes[@class_id].learnings
if j.level == @level
learn_skill(j.skill_id)
end
end
end
# Level down
while @exp < @exp_list[@level]
@level -= 1
end
# Correction if exceeding current max HP and max SP
@hp = [@hp, self.maxhp].min
@sp = [@sp, self.maxsp].min
2. In the script "
SkillEquipping" :
def exp=(exp)
@exp = [[exp, 9999999].min, 0].max
while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0
@level += 1
@skillap += GameGuy.ap_gain(@id)
@skillmaxap += GameGuy.ap_gain(@id)
for j in $data_classes[@class_id].learnings
if j.level == @level
learn_skill(j.skill_id)
end
end
end
while @exp < @exp_list[@level]
@level -= 1
end
@hp = [@hp, self.maxhp].min
@sp = [@sp, self.maxsp].min
end
def clear_skills
@skills = []
@eeskills = []
@ap = @maxap
end
end
I don't know, seems all pretty normal to me...
I'm really confused about what is causing this :facepalm:
Well, two things you can do at this point:
1.) If you have any other custom scripts in your game, try removing all of them. Test play your game and see if the error still persists. If it does, then something in your database is out of place. If the error goes away, which I don't think is possible since you claim there are no other scripts that use those two methods, one of your scripts is making a compatibility problem.
2.) Make a new project.
Well number 2 is definitely not an option since I've been working on this game for almost a year now
(and I've been working with RM2000 and 2003 since ... I think '03) :haha:
But yeah, oh well... I guess I'm gonna try out experimenting with removing several scripts and stuff like that,
thanks :)
If it comes down to nothing, I'm just gonna make a game without a skill equipment system ^^
I should have probably said this. Can you upload a demo?
Yeah of course I can, but the game is in german, sooo...
I don't know if you can make your way through to the first area
of fights :D
Or is it just so you can look through the scripts ?
I guess I could upload it, yeah.
Yes, I just only want to figure out the bug. I don't really need to play the game other than maybe to test battle. If it's something you don't feel comfortable sharing with everyone, send me the link/file via email.
Updated to 1.35. Fixed a bug that could possibly conflict with any other scripts relating to skill learning. Didn't really realize that the bug existed until recently. Special thanks to KK20 for providing the fix (in another thread).
The updated version seems to have a syntax error in line 173
Sorry, fixed.
Is there any way to make a skill un-removable? I ask because I'm using this as a base for abilities in my evented battle system. They will gain abilities at certain levels, and throughout the game, and some of them (like hp boost) shouldn't be removable ever. At least not for my game lol.
In addition to that, how would I make 1 skill un-equip another skill?
Looking into that as I type this (avoiding homework FTW).
Also, now that I fully understand how this system works, I'd like to point out that the variable @eeskills is entirely unnecessary
as long as you replace any instance of it in conditional statements with @skills instead.
Quote from: Noctis on October 17, 2012, 05:54:18 pm
In addition to that, how would I make 1 skill un-equip another skill?
Do you mean like you have 'slots' to equip skills (universal)? Or do you mean something more like "You can only know a fire spell or an ice spell, but you cannot have both equipped at the same time, but I could care less about the other skills you have equipped" (strict)?
Quote from: Ezel Berbier on October 17, 2012, 11:38:18 pm
Also, now that I fully understand how this system works, I'd like to point out that the variable @eeskills is entirely unnecessary as long as you replace any instance of it in conditional statements with @skills instead.
Oh I know. You gotta remember though, I made this three years ago, only one year after I had just started programming. If I had the motivation and time to do it, I'd go through and revamp all of my scripts. Between now and then, my knowledge of programming has definitely grew and still growing.
As for Zexion's question, if I can find some time, I might redo this script entirely, first to revamp it, secondly, to throw in your suggestions for Permanent Skills and Equipment Rules. Though don't get your hopes up too much, I've been pretty busy with school lately, and when I'm not, I'm usually relaxing from school. Been finding it hard to find any sort of motivation for programming lately.
Quote from: Ezel Berbier on October 17, 2012, 11:38:18 pm
Quote from: Noctis on October 17, 2012, 05:54:18 pm
In addition to that, how would I make 1 skill un-equip another skill?
Do you mean like you have 'slots' to equip skills (universal)? Or do you mean something more like "You can only know a fire spell or an ice spell, but you cannot have both equipped at the same time, but I could care less about the other skills you have equipped" (strict)?
I meant more along the lines of the second option, but not quite either. I have a skill which is the "finisher" attack after a combo, and throughout the game, it will upgrade with your level, and once it upgrades to "finisher2" it will unequip "finisher" for that one, but can be replaced at any time with "finisher, finisher2, finisher3" etc.
To clearify: When you put on one skill, it removes others that aren't allowed with it. Only 1 finishing move at a time.
Quote from: Lightning on October 18, 2012, 12:00:58 am
Oh I know. You gotta remember though, I made this three years ago, only one year after I had just started programming.
Oh, I just guessed that after all these years you didn't notice it. It was only like a 2 minute fix, so yeah...I guess that's where my assumption came from.
Quote from: Lightning on October 18, 2012, 12:00:58 am
Though don't get your hopes up too much, I've been pretty busy with school lately, and when I'm not, I'm usually relaxing from school. Been finding it hard to find any sort of motivation for programming lately.
That's what I'm here for, right? :naughty:
#===============================================================================
# Skill Equipment System
# Author game_guy
# Editted by KK20
# Version 1.4
#-------------------------------------------------------------------------------
# Intro:
# Okay well its a system that makes it so you can't use all of your skills at
# once while in battle. Instead you have to equip them. Now here's the catch.
# Every skill has its own "ap" so when its equipped it takes some of the actor's
# ap. That way you can't use all of your skills and it adds some uniqueness to
# the game.
#
# Features:
# Equip Skills Strategically
# Only Equip Limited Amount of Skills Using Ap
# Have Different Starting Ap for Each Actor
# Have Different Ap Gain for Each Actor per Level Up
# Have Different Ap for Each Skill
# Have an Exit Scene for When the Skill Equipment Closes
#
# Instructions:
# Okay so these could be confusing but lets try and get through this.
# Okay they're not that confusing. Okay so go down where it says
# # Begin Config
# And do all of you're configuration there.
#
# Now theres some stuff you need to know.
#
# When adding a skill it does not automatically equip it. So to equip a
# skill use this
# $game_actors[actor_id].equip_skill(skill_id)
# To unequip a skill use this
# $game_actors[id].remove_skill(skill_id)
#
# Now it will not equip it unless there's enough ap left. So you can either do
# this $game_actors[id].add_map(amount) to add to max ap or you can do this
# $game_actors[id].clear_skills to unequip all skills and give all ap back.
# Just to make it a bit easier.
#
# You can always remove max ap to by doing this
# $game_actors[id].remove_map(amount) but note that doing that clears the
# equipped skills as well to avoid any problems.
#
# To open the skill equipment scene use this.
# $scene = $scene = Scene_SkillEquip.new(actor_id)
# To tell if a skill is equipped or not you'll notice the text is greyed out.
# That means it equipped. If its white it means it can be equipped.
# In the scene though to equip/unequip things just press the action button.
#
# Well thats about it.
# Credits:
# game_guy ~ for making it
# Ethan ~ for the idea of it
# Branden ~ beta testing
#
# Enjoy and give credits.
#===============================================================================
# [ KK20's change notes ]
#
# V 1.4
# - Cleaned up and modified a bit of the existing methods in Game_Actor
# - Fixed the AP display in the window
# - Allow user to show the skill's AP cost instead of its SP cost in the scene
# - Added new feature: Permanent Skills
# + Skills can be permanently equipped
# + Script call for this is as follows:
# $game_actors[id].learn_skill(skill_id, true)
# - Added new feature: Skill Limitations
# + Certain skills cannot be equipped together at the same time
#===============================================================================
module GameGuy
#---------------------------------------------------------------------------
# ApWord = This is the word that displays when showing the ap the actor
# has.
#---------------------------------------------------------------------------
ApWord = "AP"
#---------------------------------------------------------------------------
# StartingAp = The starting ap for every actor. Different amounts can be
# defined below at # Config Starting Ap.
#---------------------------------------------------------------------------
StartingAp = 5
#---------------------------------------------------------------------------
# ApCost = The default ap cost for all skills. Different amounts can be
# defined below at # Config Ap Costs.
#---------------------------------------------------------------------------
ApCost = 1
#---------------------------------------------------------------------------
# ApGain = The max ap gained when an actor levels up. Different amounts
# can be defined below at # Config Sp Gain
#---------------------------------------------------------------------------
ApGain = 2
#---------------------------------------------------------------------------
# DisplayAP = Will display AP costs instead of SP in the scene.
# Set to true if you wish to use this. Use false otherwise.
#---------------------------------------------------------------------------
DisplayAP = true
#---------------------------------------------------------------------------
# ExitScene = The scene it goes to when the Skill Equipment closes.
#
#---------------------------------------------------------------------------
ExitScene = Scene_Menu.new
#---------------------------------------------------------------------------
# SkillLimit = A series of arrays that represent what skills cannot
# be equipped at the same time.
# Examples: [[2,3]]
# >> Greater Heal and Mass Heal cannot be equipped together
#
# [[7,10],[7,11],[7,12],[8,10],[8,11],[8,12],[9,10],[9,11],[9,12]]
# >> Cannot equip any type of fire spell along with an ice spell
#
# [[53,54,55,56]]
# >> Can only equip one: Sharp, Barrier, Resist, Blink
#---------------------------------------------------------------------------
SkillLimit = [[7,10],[7,11],[7,12],[8,10],[8,11],[8,12],[9,10],[9,11],[9,12]]
# SkillLimit = [] # <--If you do not wish to use this feature, do this
def self.start_ap(id)
case id
#-------------------------------------------------------------------------
# Config Starting Ap
# Use this when configuring
# when actor_id then return starting_ap
#-------------------------------------------------------------------------
when 1 then return 10 # Actor 1 : Aluxes
when 2 then return 8 # Actor 2 : Basil
end
return StartingAp
end
def self.skill_ap(id)
case id
#-------------------------------------------------------------------------
# Config Ap Costs
# Use this when configuring
# when skill_id then return ap_cost
#-------------------------------------------------------------------------
when 1 then return 2 # Skill Id 1 : Heal
when 7 then return 3 # Skill Id 7 : Fire
when 57 then return 6
end
return ApCost
end
def self.ap_gain(id)
case id
#-------------------------------------------------------------------------
# Config Ap gain
# Use this when configuring
# when actor_id then return ap_gain
#-------------------------------------------------------------------------
when 1 then return 4 # Actor 1 : Aluxes
end
return ApGain
end
end
#==============================================================================
# Game_Actor
#------------------------------------------------------------------------------
# Added stuff for Skill Equipping.
#==============================================================================
class Game_Actor < Game_Battler
attr_accessor :eskills
attr_accessor :skills
attr_accessor :skillap
attr_accessor :skillmaxap
alias gg_add_stuff_lat_ap setup
def setup(actor_id)
@actor = $data_actors[actor_id]
@skillap = GameGuy.start_ap(actor_id)
@skillmaxap = GameGuy.start_ap(actor_id)
@eskills = []
return gg_add_stuff_lat_ap(actor_id)
end
def skill_learn?(skill_id)
return @skills.include?(skill_id) || @eskills.include?(skill_id)
end
def learn_skill(skill_id, perm = false)
if perm and skill_id > 0
remove_skill(skill_id) if @skills.include?(skill_id)
@eskills.delete(skill_id)
@skills.push(skill_id)
@skills.sort!
elsif skill_id > 0 and not skill_learn?(skill_id)
@eskills.push(skill_id)
@eskills.sort!
end
end
def forget_skill(skill_id)
remove_skill(skill_id)
@eskills.delete(skill_id)
end
def equip_skill(skill_id)
return unless skill_id > 0 && @eskills.include?(skill_id)
potential_ap = @skillap
removal_list = []
GameGuy::SkillLimit.each{|set|
if set.include?(skill_id)
set.each{|id|
if @skills.include?(id) && @eskills.include?(id) && !removal_list.include?(id)
potential_ap += GameGuy.skill_ap(id)
removal_list.push(id)
end
}
end
}
if potential_ap >= GameGuy.skill_ap(skill_id)
removal_list.each{|id| remove_skill(id)}
@skillap -= GameGuy.skill_ap(skill_id)
@skills.push(skill_id)
@skills.sort!
return true
else
return false
end
end
def remove_skill(id)
@skillap += GameGuy.skill_ap(id) if (@skills.include?(id) and @eskills.include?(id))
@skills.delete(id)
end
def add_map(n)
@skillmaxap += n
clear_skills
@skillap = @skillmaxap
end
def remove_map(n)
@skillmaxap -= n
if @skillmaxap < 0
@skillmaxap = 0
end
if @skillap > @skillmaxap
@skillap = @skillmaxap
end
clear_skills
end
def exp=(exp)
@exp = [[exp, 9999999].min, 0].max
while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0
@level += 1
@skillap += GameGuy.ap_gain(@id)
@skillmaxap += GameGuy.ap_gain(@id)
for j in $data_classes[@class_id].learnings
if j.level == @level
learn_skill(j.skill_id)
end
end
end
while @exp < @exp_list[@level]
@level -= 1
end
@hp = [@hp, self.maxhp].min
@sp = [@sp, self.maxsp].min
end
def clear_skills
deleting_these = @skills.clone
deleting_these.each{|id| @skills.delete(id) if @eskills.include?(id) }
@skillap = @skillmaxap
end
end
#==============================================================================
# Window_GGAPSkill
#------------------------------------------------------------------------------
# Copy of Window_Skill but just slightly different.
#==============================================================================
class Window_GGAPSkill < Window_Selectable
def initialize(actor)
super(0, 128, 640, 352)
@actor = actor
@column_max = 2
refresh
self.index = 0
end
def skill
return @data[self.index]
end
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@data = []
for i in 0...@actor.eskills.size
skill = $data_skills[@actor.eskills[i]]
if skill != nil
@data.push(skill)
end
end
@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
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
def update_help
@help_window.set_text(self.skill == nil ? "" : self.skill.description)
end
end
#==============================================================================
# Window_GGAPSkillEquip
#------------------------------------------------------------------------------
# Window uses for equipping skills.
#==============================================================================
class Window_GGAPSkillEquip < Window_Selectable
def initialize(actor)
super(0, 128, 640, 352)
@actor = actor
@column_max = 2
refresh
self.index = 0
end
def skill
return @data[self.index]
end
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@data = []
for i in 0...@actor.eskills.size
skill = $data_skills[@actor.eskills[i]]
if skill != nil
@data.push(skill)
end
end
@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
def draw_item(index)
skill = @data[index]
if @actor.skills.include?(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)
if GameGuy::DisplayAP
self.contents.draw_text(x + 232, y, 48, 32, GameGuy.skill_ap(skill.id).to_s, 2)
else
self.contents.draw_text(x + 232, y, 48, 32, skill.sp_cost.to_s, 2)
end
end
def update_help
@help_window.set_text(self.skill == nil ? "" : self.skill.description)
end
end
#==============================================================================
# Window_GGActorAp
#------------------------------------------------------------------------------
# Window used to display AP and Actor name.
#==============================================================================
class Window_GGActorAp < Window_Base
def initialize(actor)
super(0,64,640,64)
self.contents = Bitmap.new(width-32,height-32)
@actor = $game_actors[actor]
refresh
end
def refresh
self.contents.clear
ap = GameGuy::ApWord
self.contents.draw_text(0, 0, 640, 32, "#{@actor.name}")
self.contents.draw_text(0, 0, 640-32, 32, "#{ap} #{@actor.skillap} / " +
"#{@actor.skillmaxap}", 2)
end
end
#==============================================================================
# Scene_Skill
#------------------------------------------------------------------------------
# Just slightly modded the main method.
#==============================================================================
#==============================================================================
# Scene_SkillEquip
#------------------------------------------------------------------------------
# The scene that deals with equipping skills.
#==============================================================================
class Scene_SkillEquip
def initialize(actor_id=1)
@id = actor_id
end
def main
@actor = $game_actors[@id]
@help_window = Window_Help.new
@skill_window = Window_GGAPSkillEquip.new(@actor)
@skill_window.help_window = @help_window
@status_window = Window_GGActorAp.new(@actor.id)
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
@help_window.dispose
@skill_window.dispose
@status_window.dispose
end
def update
@help_window.update
@skill_window.update
@status_window.update
if @skill_window.active
update_skill
return
end
end
def update_skill
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = GameGuy::ExitScene
return
end
if Input.trigger?(Input::C)
skill = @skill_window.skill
if @actor.skills.include?(skill.id)
$game_system.se_play($data_system.decision_se)
@actor.remove_skill(skill.id)
else
result = @actor.equip_skill(skill.id)
if result
$game_system.se_play($data_system.decision_se)
else
$game_system.se_play($data_system.buzzer_se)
end
end
@status_window.refresh
@skill_window.refresh
return
end
end
end
I recall reading those forum posts months back about your situation and I deeply understand your position.
Thanks! <3 Added you to the credits, added your script to the original post. Thanks KK20. *levels up*
Hey there
when i tried to replace the scene for the normal equipment with the skillequipment
i got this error message
(http://i40.tinypic.com/sbjade.png)
What it does is kinda funny actuelly
it uses the wrong index when i select the first actor it crushes
when i select the second actor it uses the actor 1 and so on
so the fourth actor has the third id =S
how can i fix that ? id love to use this script its exactly what i was looking for :)
Actually, it's not using the wrong index at all. Arrays always start at 0. Even without this script, that's how it works in the default scripts. 0 being the first member, 1 being the second, and so on. I'll try to look into the error real quick.
EDIT: I know what you're issue is (I think). You said you were trying to replace the normal equipment with this scene instead. The party goes off of party indexes, while my script goes off of actor_id.
The line where you have
$scene = Scene_SkillEquip.new(@status_window.index)
Should look like this
$scene = Scene_SkillEquip.new($game_party[@status_window.index].id)
And it should work.
now it does not work at all
now it crushes with everyone :(
Typo on G_G's end (forgot #actors):
$scene = Scene_SkillEquip.new($game_party.actors[@status_window.index].id)
Awesome :) worked ^^
(thanks :shy:)
Just one last question
can i aslo increase an actors AP due a script call ?
Read the script instructions.
*facepalm*
yeah thanks :shy: