Jump to content
Zetu

Alternate MP X v1.05 [DEMO NOW HERE!]

Recommended Posts

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 by Zetu

Share this post


Link to post
Share on other sites

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 by SamHain

Share this post


Link to post
Share on other sites

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 by Helladen

Share this post


Link to post
Share on other sites

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 by Zetu

Share this post


Link to post
Share on other sites

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

Edit; Ignore this post, i found a way to fix my problem myself.

Edited by Kjsam

Share this post


Link to post
Share on other sites

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

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)

post-15739-0-30349000-1351551719_thumb.png

Share this post


Link to post
Share on other sites

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 by kugelblitz777

Share this post


Link to post
Share on other sites

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

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

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

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

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 by Dark Horseman

Share this post


Link to post
Share on other sites

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

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

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

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

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×