Jump to content
New account registrations are disabed. This website is now an archive. Read more here.
  • 0
Espie23

[Un-Concluded] Restoring MP when attacking

Question

Hey guys, first post here...asking for help. Nice first impression I'm sure.

 

Anyway, I've stumbled upon a little dilemma. Here's what I'm trying to do:

 

Basically, I'm putting together an AP system similar to some of the Tales games, where instead of just using points for skills/magic and recharging it when it gets low, I want to have a fixed amount of AP (doesn't increase with level) that you can restore a portion of by attacking and maybe defending as well. RMXP is kind of limited to what you can process in the background of battles as far as Conditional Branches and battle actions are concerned. My problem would be solved if you could attach Common Events to weapons as well as skills, but I haven't found any way in the default system to change stats like this by attacking.

 

Here's where you guys come in. After skimming through the scripts, I've narrowed the Attack/Defend handling down to somewhere in Scene_Battle 3 and 4, but as far as actually making the proper modifications to get this working...that's beyond me.

 

So, in great detail if possible, what will I have to add where to allow X amount of AP (SP, MP, whatever you want to call it) to be restored when attacking and defending?

 

Helpful facts:

- Default Battle System

- Fixed amount of AP gain

- Party only if possible (Monsters will use the basic consumption system)

- Attacking AND Defending if possible

 

Thanks in advance, guys! The help is greatly appreciated :D

Share this post


Link to post
Share on other sites

7 answers to this question

Recommended Posts

  • 0

So you want to receive as much MP as you did damage to the enemy? Or what?

Share this post


Link to post
Share on other sites
  • 0

Well, in my case, I was thinking of having Attacks restoring 4 and Defending restoring 2. I wish there was a way to event this, but I've exhausted most of my options. You wouldn't happen to have some scripting knowledge for me, would you?

Share this post


Link to post
Share on other sites
  • 0

Sorry for the double post, but this is really important to me, haha.

 

I've just about solved it using Events and whatnot. I have each of the weapons inflicting an invisible state on the enemy (one for each of the party members, so it can tell who attacked), and a Common Event checking for the state to appear. I'm using Conditional Branches to check all 8 possible enemies, and a Common Event triggering that restores AP to the party members, depending on what state was inflicted. So basically, I have the theory down, but putting it into practice has proven difficult...

 

Even if the event is totally comprised of Conditional Branches (ie: event does nothing if no conditions are met), the only way to process the event right when an attack is made is to set the battle event page span to Moment. Here's my dilemma. The AP restores just fine when I set the span to Turn, but because of that, the AP from an attack won't add on until I select my action NEXT turn. If I want the AP increase to be instant, I have to use Moment, which always locks up my battle, because it's trying to process the event over and over again.

 

That being said, look in Scene_Battle 4, from Line 178 onward ("Make Basic Action Results"). This is where the attacks are processed. Plain and simple, what do I have to add that will restore X (fixed number) amount of AP to the player who made the attack right when the damage from the attack is displayed? Come on people, I know there are a lot of scripters out there...help me out!

Share this post


Link to post
Share on other sites
  • 0

(Woops, forgot about this topic. Sawwy. :sweatdrop:)

 

So you've managed to make is so that when the player attacks, he restores his "AP" the next turn, correct?

 

That's the same as him receiving it that turn, because he's already attacked, so restoring AP that turn is the same as restoring it at the beginning of the next turn.

 

If this isn't the case, I'll contact one of my scripter friends. ^~^

Share this post


Link to post
Share on other sites
  • 0

Sorry, I should have been more clear, my post was probably quite confusing. What happens is, it calculates who attacks just fine, and the battles don't freeze up, but the AP from the attack doesn't add until I perform my action next turn, so it doesn't add until after I select my actions next turn.

 

Let's say I have 3 AP left, and I need 5 to use my skill. I use a regular attack to give me 2 AP back, but it doesn't give it back to me until after I pick an action next turn. Because of this, I can't use my skill next turn like I intended, because I don't have enough AP until after I pick an action. Do you see my dilemma? D:

 

Help from your scripter friends would be much appreciated.

Share this post


Link to post
Share on other sites
  • 0

Oh I see, so if you use an attack, you get the AP two turns later. What eventing have you done so far to get this result?

/

Share this post


Link to post
Share on other sites
  • 0

All right, so my only real dilemma when initially figuring this out was that you couldn't attach Common Events to weapons. What you CAN do is play around with the States that weapons inflict when they hit. Going off of that, this is the method I've come up with in the couple hours I had to work on it today:

 

> I made a separate State for each of the party members. Each member will only use a certain kind of weapon, so I just set all of X's weapons to inflict X's State. This was the easiest way to tell who attacked that I've come up with so far. States are nonresistant and 0 priority, so they operate solely in the background.

 

> I have a Party AP Recovery Common Event that has 32 Conditional Branches in it. It checks all 8 possible monsters for any of the four States. For organizational purposes, I make separate Common Events that 1) give AP to X member, and 2) remove their State from all monsters (to prevent multiple AP gains from one attack).

 

> In theory, I want to have the initial Common Event running in the background, constantly checking for any of the States to appear on the monsters in real time. The problem with this, is that to have it running constantly, even when none of the Conditional Branches are met (ie: no real event processing) it locks up the battle.

 

In a nutshell, here's the system:

 

- Common Event checks for States.

- When a State appears, AP gain and State removal based on what State was inflicted.

 

Hope this helps, I'd really love to get this issue resolved.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...