Fomar0153 123 Posted December 19, 2011 This is a tool for developers who wish to create system that rely on AP (ability points) for example, Final Fantasy's V's Job System, Final Fantasy VII's materia system etc. I intend to follow this up with a skill system where by characters can learn skills from weapons. AP System Script Category: Creator Tools First you need to make an attribute for AP like so: Then on your enemies you need to add a trait like this: Note the 5 is the ap this enemy will give. If needed edit the script to use the right attribute, look for: AP_Element = 11 Then you're done, a screenshot to celebrate: Now for the script: =begin AP System Script by Fomar0153 Version 1.0 ---------------------- Notes ---------------------- No requirements Implements an ap system for you to use when creating skill ystems that utilise AP. ---------------------- Instructions ---------------------- You will need to create an attribute to use for AP. Then set is as a trait, although it says % just put the number you want the enemy to give as AP. ---------------------- Known bugs ---------------------- None =end module Vocab ObtainAp = "%s AP was obtained!" end class Game_Actor < Game_Battler #-------------------------------------------------------------------------- # â— New Method gain_ap #-------------------------------------------------------------------------- def gain_ap(ap) # your code goes here end end module BattleManager # Set you AP Element AP_Element = 11 #-------------------------------------------------------------------------- # â— Rewrote self.display_exp #-------------------------------------------------------------------------- def self.display_exp if $game_troop.exp_total > 0 text = sprintf(Vocab::ObtainExp, $game_troop.exp_total) $game_message.add('\.' + text) end if $game_troop.ap_total > 0 text = sprintf(Vocab::ObtainAp, $game_troop.ap_total) $game_message.add('\.' + text) end end #-------------------------------------------------------------------------- # â— Rewrote self.gain_exp #-------------------------------------------------------------------------- def self.gain_exp $game_party.all_members.each do |actor| actor.gain_exp($game_troop.exp_total) end wait_for_message $game_party.all_members.each do |actor| actor.gain_ap($game_troop.ap_total) end wait_for_message end end class Game_Troop < Game_Unit #-------------------------------------------------------------------------- # â— New Method ap_total #-------------------------------------------------------------------------- def ap_total dead_members.inject(0) {|r, enemy| r += enemy.ap } end end class Game_Enemy < Game_Battler #-------------------------------------------------------------------------- # â— New Method ap_total #-------------------------------------------------------------------------- def ap return (self.element_rate(BattleManager::AP_Element) * 100).to_i end end Planned Future Development -May need updating when RPG Maker VXA is released in English. 2 Share this post Link to post Share on other sites
Zetu 70 Posted December 19, 2011 (edited) Although this is nice, are you planning to do something with it? (Other than let us make systems that support it) EDIT: Oh, you don't even have the AP gain stored, do you? I'd add setting <Game_Actor>'s @ap = 0 on setup, and the @ap += ap in that method. Actually, this script doesn't actually do much by itself, only displays the potential AP you could have gained. Edited December 19, 2011 by Zetu Share this post Link to post Share on other sites
Rosenblack 79 Posted December 19, 2011 *Added to the Master Script List* Share this post Link to post Share on other sites
Fomar0153 123 Posted December 19, 2011 Although this is nice, are you planning to do something with it? (Other than let us make systems that support it) EDIT: Oh, you don't even have the AP gain stored, do you? I'd add setting <Game_Actor>'s @ap = 0 on setup, and the @ap += ap in that method. Actually, this script doesn't actually do much by itself, only displays the potential AP you could have gained. Thanks, currently I'm working on a system where you can learn skills from equipment (using AP) but I wanted to separate the two systems to reduce the number of times people potentially code the same thing. I'll probably make other skill systems with this as well in the future. As for @ap not being stored that was intentional being as not everyone will want to implement ap as a single variable an example from my weapon skills script I'm working on: class Game_Actor < Game_Battler #-------------------------------------------------------------------------- # â— Aliases setup #-------------------------------------------------------------------------- alias eqskills_setup setup def setup(actor_id) eqskills_setup(actor_id) if Equipment_Skills::Learn_Skills @ap = [] end end #-------------------------------------------------------------------------- # â— New Method or Rewrites gain_ap #-------------------------------------------------------------------------- def gain_ap(ap) if Equipment_Skills::Learn_Skills for item in self.equips if item.is_a?(RPG::Weapon) unless Equipment_Skills::Weapons[item.id] == nil for skill in Equipment_Skills::Weapons[item.id] if @ap[skill] == nil @ap[skill] = 0 end @ap[skill] += ap end end end if item.is_a?(RPG::Armor) unless Equipment_Skills::Armors[item.id] == nil for skill in Equipment_Skills::Armors[item.id] if @ap[skill] == nil @ap[skill] = 0 end @ap[skill] += ap end end end end end end end I needed to store gained ap in an array to keep track of each skill's ap. Should be finished bu tomorrow morning at the latest I'd say. Share this post Link to post Share on other sites
Knightmare 170 Posted December 20, 2011 This will be golden Fomar, I hope you finish it. 2 Share this post Link to post Share on other sites
Fomar0153 123 Posted December 20, 2011 This will be golden Fomar, I hope you finish it. Just finished: http://www.rpgmakervxace.net/index.php?/topic/425-equipment-skills/ Share this post Link to post Share on other sites
daxisheart 0 Posted January 25, 2012 I need to ask, what does this script, by itself, specifically do? enemies will give AP, but is anything particularly done with that ap? Do we have to use this in conjunction with your equipment script? or is the equipment script some updated/renovated version of this? Share this post Link to post Share on other sites
Fomar0153 123 Posted January 25, 2012 It doubles up as a tool for creators to use if they wish and is required for my equipment skill script, I also made an updated version of this which uses note tagging if anyone is interesting in using that or upgrading. Share this post Link to post Share on other sites
Bernkastel 0 Posted January 27, 2012 (edited) Did you find out if what I was talking about was possible? I didn't notice the Fomar at first btw XD Wrong thread O: I was referring to the thread about the custom equipment slots. Edited January 27, 2012 by Bernkastel Share this post Link to post Share on other sites
Fomar0153 123 Posted January 27, 2012 I haven't started on it yet. Would it bother you at all if slots went at the bottom rather than below the armour? Just it would simplify the script by quite a bit. Share this post Link to post Share on other sites
Bernkastel 0 Posted January 27, 2012 oh it doesn't matter the order at all O: I'm not making a pso close, I just really like the system Share this post Link to post Share on other sites
sam guhry forda 0 Posted March 30, 2012 how did you make the vocab show how much exp you got? Share this post Link to post Share on other sites
Fomar0153 123 Posted March 30, 2012 Using sprintf the %s was replaced with the amount of AP the party got. Share this post Link to post Share on other sites
Facinus 0 Posted April 1, 2012 Is it possibe to assign the ap gain to a variable? For example, I'd like to assign the ap increase to the variable 180 (start value 0) so that the player can buy skills with it. (Sorry for my bad english) Share this post Link to post Share on other sites
Fomar0153 123 Posted April 1, 2012 (edited) class Game_Actor < Game_Battler #-------------------------------------------------------------------------- # â— New Method gain_ap #-------------------------------------------------------------------------- def gain_ap(ap) $game_variables[x + @actor_id] += ap end end Try that, replace x with a number e.g. If I want to use variable 10 to 16, x would be 9. Edit: Put this below the original script. Edited April 1, 2012 by Fomar0153 Share this post Link to post Share on other sites
Facinus 0 Posted April 1, 2012 Thank you very much! Share this post Link to post Share on other sites
Heavenlysynner 1 Posted May 4, 2012 Question, is it possible to apply this to traits as well? Like, be able to gain traits through equipment and Ap? Share this post Link to post Share on other sites
Fomar0153 123 Posted May 4, 2012 Question, is it possible to apply this to traits as well? Like, be able to gain traits through equipment and Ap? Nope sorry. Share this post Link to post Share on other sites
Tewky 0 Posted July 18, 2012 (edited) Curious if there would be a way to eliminate it announcing the acquisition. "So and so gained so much AP!" Yeah, I want to hide that. Unfortunately I do not have sufficient knowledge to know if changing anything would be safe xD. EDIT: I would also like to know if it would be possible to change the name from AP to something else, or the sentence it states. Edited July 18, 2012 by Tewky Share this post Link to post Share on other sites
Pretty-Belle 0 Posted October 8, 2012 Don't know if I can't post 2 months after the last post, but I don't know another way to tell you this bug... When a character dies and the battle ends, the character should not receive AP, but he does. Any way to fix it? Share this post Link to post Share on other sites
RuinLight 2 Posted October 14, 2012 I like this script. Seems pleasing to the eye. I'm using this with the Equipment Skills System Script by Fomar0153 Share this post Link to post Share on other sites
patwee 0 Posted February 8, 2013 Thank you for this! Share this post Link to post Share on other sites
Lightmaker2014 2 Posted November 11, 2014 Can this be used to award job exp? Looking for an easy way to implement that. Share this post Link to post Share on other sites
projectbeta 0 Posted July 28, 2015 Got a few questions on this script. I saw where you stated that it can be set to a number variable but could it be link instead to a variable like \v [x] and put in a event to do a random 1 to 100 for variable x to make the AP not a set every fight but a % chance to be given on the fight. Basically I am interested in using this in a form of alternate currency of sorts, kind of like the mythril system in shining force neo or exa games. Where sometimes monsters would award this bonus and it could be used in a shop like yanfly call common event shop to award bonuses to stats and other abilities and such. Or I could set it up also like on Everquests AA system too would work. If you have any suggestions I would love to hear them. Share this post Link to post Share on other sites
DS9 1 Posted July 29, 2015 how did you make the vocab show how much exp you got? Just change this part of this script... #-------------------------------------------------------------------------- # â— Rewrote self.display_exp #-------------------------------------------------------------------------- def self.display_exp if $game_troop.exp_total > 0 text = sprintf(Vocab::ObtainExp, $game_troop.exp_total) $game_message.add('\.' + text) end if $game_troop.ap_total > 0 text = sprintf(Vocab::ObtainAp, $game_troop.ap_total) $game_message.add('\.' + text) end end If you want no msg about AP you should be able to turn it into this #-------------------------------------------------------------------------- # â— Rewrote self.display_exp #-------------------------------------------------------------------------- def self.display_exp if $game_troop.exp_total > 0 text = sprintf(Vocab::ObtainExp, $game_troop.exp_total) $game_message.add('\.' + text) end end If you don't want XP showing. Change the part of this script at the top of this reply to.. #-------------------------------------------------------------------------- # â— Rewrote self.display_exp #-------------------------------------------------------------------------- def self.display_exp if $game_troop.ap_total > 0 text = sprintf(Vocab::ObtainAp, $game_troop.ap_total) $game_message.add('\.' + text) end end You should know that if you get 0xp or 0ap and you have it set to display, it won't because the condition tells it to display ap/xp >0 I would say keep it this way, unless you want a battle where you kill a towns folk and loose AP or XP I didn't test this but I can if you still need help.... I think this should do every thing the script normal does, but now it doesn't tell you the AP you gained from battle. You should how ever edit the menu some where letting the player know their total AP. There are many ways to do this. Good Luck Share this post Link to post Share on other sites