Zetu 70 Posted July 16, 2012 (edited) Alright, let me break it down. Inside the <Game_Actor> class, there is a attr_reader class called @resources, which is a <Game_Resources> class. The access of each resource is in a predefined [] method, as shown here. def [](value) return @resources[value] if value.is_a? Integer return resource_of(value) if value.is_a? String end So @resources[0] will give first resource, and @resources[1] will give the second, or nil if it's nonexistant. If you give a String, aka @resources["Mana"], it will run a different method called resource_of, which will either return the <Game_Resource> class or nil, if you don't have it. If this confuses you, I suggest playing with other scripts. This is not a good script to learn from, due to it's complexity. Edited July 16, 2012 by Zetu Share this post Link to post Share on other sites
SamHain 0 Posted July 19, 2012 (edited) So then, if I were going to assign a variable to equal a character's current resource, I would make an event in which I set that variable as the following script phrase? <Actor>.resources[0].value Like in my barbarian example, if he's using rage, and I want the event to have a conditional effect based on how much Rage he currently has, I would set that variable to something like this? Grulk.resources[1].value Edited July 19, 2012 by SamHain Share this post Link to post Share on other sites
Zetu 70 Posted August 11, 2012 Well... "$game_actors[1].resources[1].value" I am close to finishing v1.06, so expect it soon (: 1 Share this post Link to post Share on other sites
Stefan 0 Posted August 13, 2012 Since Arc Nessiah came up with a newer version of Yanflys Battle Engine, here is the newest version of the compability edits for Zetus AMPX (1.05) http://pastebin.com/SErNegbc Share this post Link to post Share on other sites
Aeirex 14 Posted August 16, 2012 (edited) Since Arc Nessiah came up with a newer version of Yanflys Battle Engine, here is the newest version of the compability edits for Zetus AMPX (1.05) http://pastebin.com/SErNegbc That seems a bit excessive to edit the whole script like that. All you really need to do is override the draws and it works fine (just make a script patch below both scripts). I love this script and thanks for putting so much time into it, and letting other people use it. Edited August 16, 2012 by Helladen Share this post Link to post Share on other sites
Zetu 70 Posted August 17, 2012 (edited) Yeah... let's not do that. Two overwritten methods doesn't not need all that. Only from like 1930-1955ish, from what I saw. :/ I has good and bad news. Bad News -> May take a little longer to get next version (irl sucks) Good News -> I have started on, not v1.06, but v3. Complete redo. Taking the best of the old version and making the new one less hard coded, easier flexibility, and much MUCH simpler module setup. After alot of *sigh* debugging it'll be up. <= Worst part of programing Edited August 17, 2012 by Zetu Share this post Link to post Share on other sites
Mr. Bubble 117 Posted August 17, 2012 Since Arc Nessiah came up with a newer version of Yanflys Battle Engine, here is the newest version of the compability edits for Zetus AMPX (1.05) Reposting the entire script with just a few edits is highly unnecessary. You can just make a separate script where you overwrite what you want to like this: class Window_BattleStatus < Window_Selectable #------------------------------------------------------------------------- # overwrite method: draw_actor_ampx #------------------------------------------------------------------------- def draw_actor_ampx(resource, x, y, width) color1, color2 = resource.params[:color] draw_gauge(x, y-2, width, resource.rate, text_color(color1), text_color(color2)) change_color(text_color(color2)) draw_text(x, y+3, 30, line_height, resource.params[:abbv][0]) draw_current_and_max_values(x, y+3, width, resource.value, resource.max, mp_color(resource.battler), normal_color) end #----------------------------------------------------------------- # overwrite method: draw_actor_mp #-------------------------------------------------------------------------- def draw_actor_mp(actor, x, y, width=124) if actor.resources.nil? actor.setup(actor.id) end width /= actor.resources.size offset = width if actor.resources.size != 1 offset += 0 width -= 0 end for i in 0...actor.resources.size draw_actor_ampx(actor.resources[i], x+offset*i, y, width) end end end Share this post Link to post Share on other sites
Stefan 0 Posted August 17, 2012 Well, i will keep it in mind next time. Share this post Link to post Share on other sites
HellKiteChaoS 36 Posted September 28, 2012 Any update on the next version of this one? Been a good while and I'd like to know if I need to make the 1.5v work or wait for the 3.0v. Share this post Link to post Share on other sites
Kjsam 0 Posted October 14, 2012 (edited) Edit; Ignore this post, i found a way to fix my problem myself. Edited October 19, 2012 by Kjsam Share this post Link to post Share on other sites
Lanyx 0 Posted October 25, 2012 Is there a way to switch resources during the game? For example, a game with class changing. Let's say a character of an energy-using class changes to a class using rage. I can't seem to get the resource to change with the class, even using proper tags. Share this post Link to post Share on other sites
Razimov 0 Posted October 29, 2012 Hey Zetu, the new demo and script are working pretty good. I tested around with it and found some minor errors that had some easy work arounds: :regen, :set, 20, for energy does not increase the actor's energy at all per turn. However, if I replace :set for both Rage and Energy to :mmp, it works exactly the way it's supposed to: 20 energy per turn and -5 rage automatically. Does :set have to be initialized to 1 in the script? It's not working, but I can live without it easily. :regenoffdamage has a small bug where it shows a floating point number on the screen that is incredibly long. I found that is the only method that uses += base, so it was just missing a += base.to_i in line 462. Edit: Just ran this with Fomar's ATB system and it ran consistently as long as I didn't set the turns to incredibly fast. I love you. This doesnt seem to work for me. Actually I cant get any of the resources to regen other then when Im hit (aka-regendmg) Share this post Link to post Share on other sites
kugelblitz777 0 Posted November 30, 2012 (edited) Just wanted to ask if you still work on new version ok cut the just, i also wonder if anyone knows how to make some skills that involve mana regeneration I figured out how to make normal potions and skills that regenerate mana once (same as potions basicly) with some of the previous posts, but now my problem is i cant make skills like: a normal mp regen thats adds a state with [Ex parameter MRG +3%], it will show the number and add the state but depleted mana wont regenerate or for example a mana siphon from a friendly target, i set the type to mp drain / used as formula 20 + b.mmp * 0.2 and added <ampx damage: mana> in skill notes, the drain works but wont give mp back to the user the caster only uses mana in both examples im also using Yanflys battle engine edit cant figure out how to get mp back through recovery, everything but items skills that are flagged as mana recover, wont get mp up at all would be nice if someone has a solution Edited November 30, 2012 by kugelblitz777 Share this post Link to post Share on other sites
thatonegayguy 0 Posted December 9, 2012 is there anyway to make this compatible with the Alternat MPX system http://forums.rpgmakerweb.com/index.php?/topic/1057-very-simple-hud/ so that the HUD will show whichever resource the character currently has? Share this post Link to post Share on other sites
Levi Stepp 12 Posted December 10, 2012 I cannot seem to figure out how to make a Rage type of system that acts like "TP". Every time I heal my actor, it decreases the Rage bar, I do not want that. Share this post Link to post Share on other sites
Dark Horseman 93 Posted March 7, 2013 Apologize for the necro, but I've just got to working on my game again after a while. Has anyone got the :replenish, :deplete to work for their games by the way? So you can have full energy, zero rage etc after each battle. It seems to slowly recover as the player walks for some reason which is odd. Share this post Link to post Share on other sites
poppeuh 0 Posted March 9, 2013 hi first off i realy like your srcipt nice job on this but i found something wrong. I made a game where you start as a rookie who only has mpbar. but soon you can chose a class. But when i use the 'change class event' @>Change Actor Class: [Zyrith], [Archer] @>Change Weapons: [shortbow] +1 the class changed but the 'focus' bar doesn't appear with it. the archer class has this in it's note in the classes section of the database: <AMPX: FOCUS> <AMPX: MANA> Share this post Link to post Share on other sites
OverlyEpux 2 Posted March 12, 2013 I found an issue in the script The Resource doesn't change when an actor changes class. If they start with "EN" as a Warrior, then change to a Mage, instead of going from "EN" to "MP" they simply keep the old resource in their new class. Share this post Link to post Share on other sites
Dalhan 2 Posted March 18, 2013 Hey, just wondering how the new version is coming along? I found a problem with v1.05, where the deplete option doesn't deplete, or even empty after combat. Was it not finished? Either way, still hoping for this one to be finished! (Or at least find an alternative?) Cheers. Share this post Link to post Share on other sites
Dark Horseman 93 Posted March 22, 2013 (edited) Solution for :deplete and :replenish not working Okay, after wasting too much time trying to figure this out, I finally came up with something. class Game_Battler < Game_BattlerBase #-------------------------------------------------------------------------- # * Modify processing at End of Battle #-------------------------------------------------------------------------- def apply_replenish @resources.each.each do |resource| if resource.include? :replenish resource.value = resource.max end if resource.include? :deplete resource.value = 0 end end end def on_battle_end @result.clear remove_battle_states remove_all_buffs clear_actions clear_tp unless preserve_tp? appear apply_replenish end end I didn't alias since I still don't know how to do that, so use at your own risk if you have scripts changing "on_battle_end". Basically you just copy paste the two methods "apply_replenish" and "on_battle_end" right below "def apply_offdamage_regen(damage)". The change checks the resources of each actor once the battle ends and changes the values accordingly (this is done the same time when states, buffs, and TP are cleared). Edited March 22, 2013 by Dark Horseman Share this post Link to post Share on other sites
Dalhan 2 Posted March 23, 2013 Appears to work, good stuff! But after a quick chat to Zetu on another forum, I believe she is bringing out v3.0 soon. Hopefully she solves all these issues in that release. As well as some of the minor fixes others have made to get it working with the Yanfly Battle Codes. Share this post Link to post Share on other sites
Shade Aurion 0 Posted May 15, 2013 Is v3 still coming because it sounds like exactly what I need?A MP bar for magic, an AP bar for skills and a TP bar for limit breaks Til then i'll just go with the current version.Just wanted to say that this script is awesome, yanfly compatibility was a must and I totally appreciate the work you put in Zetu <3 Share this post Link to post Share on other sites
Bludleef 0 Posted July 16, 2013 How do you make items work to refill the energy and such. I have tried the <ampx cost: energy 100> and it wont work. I tried the damage to see if it worked like it did for the skills, but it did not. I also noticed you can't use the skill outside of battle even if it is set to be used anytime. If you can address any of these that would be great. Share this post Link to post Share on other sites
Nmoney 0 Posted August 23, 2013 Don't mean to necro this, but when I change class the resource does not change. I saw some others having the same issue above but there hasnt been a fix... any help? Great script btw Share this post Link to post Share on other sites
Dalhan 2 Posted March 26, 2014 Gonna Necro this again. Zetu mentioned ages back that this script isn't being worked on anymore. So AMPX 3.0 wont ever come. I'm curious to know if anyone has made a script like this or knows of one? Share this post Link to post Share on other sites