HOW DO YOU EARN AP?

Posts

Pages: 1
Hey guys, mantlecore again.

I'm working on an RM2K3 project and I'm trying to design a system where you earn AP after every battle. AP is a variable which you can spend in a skill tree in order to learn abilities.
The problem is that I don't know how to make every battle earn different AP amounts to the hero... if that doesn't make sense, I really don't know how else to describe it...

Let's say you run into a slime. You beat him. I want it to show that you earned 1 AP.
Yay!

Then you run into a dragon. You beat him. I want it to show that you earned 10 AP instead of 1 like the slime...

Can anyone help me!?
kentona
I am tired of Earth. These people. I am tired of being caught in the tangle of their lives.
20742
What I do when I want to increment variables for things like AP is have a common event run after every battle.

First, I turn on a switch at the very beginning of the game.
Second, I have a battle event in every single battle that runs if said switch is ON
The battle event sets a variable (0001: APEarned = 10) and then turns another switch ON
I have a common event that runs when that "another switch" is ON - it would increment the 0002:totalAP variable by the amount in the 0001:APearned
The common event ends with it turning the "another switch" OFF.

You'd have the slime battle's battle event set the APEarned to 1, and the dragon's APEarned set to 10.

I'd then make a CMS that allows me to spend AP points.

This is a really rough overview, but that's the gist of it.
I'd do it slightly differently, with one switch (which I'll call Battle) and four variables (called APEarned, TotalAP, and BattlesWon. The fourth is just a temporary variable)

In every encounter, make a new page that triggers on Turn 0, turn on Battle switch, and sets APEarned to the AP the party would make via winning the figth (so for the Slime, APEarned = 1, Dragon->ApEarned = 10).

Now have a Common Event that's set to AutoStart when the Battle switch is true. First set your temporary variable to the Number of Battles Won. If this temporary variable is greater than BattlesWon, set BattlesWon to the temporary variable and increment TotalAP by APEarned. Then at the end of the event, turn off the Battle switch.


Its pretty much the same thing as Kentona's, but it accomodates fights that you ran away from and I just like it more for no good reason except that its mine :P (Sorry Kentona)
kentona
I am tired of Earth. These people. I am tired of being caught in the tangle of their lives.
20742
author=GreatRedSpirit link=topic=593.msg7900#msg7900 date=1201043637
Its pretty much the same thing as Kentona's, but it accomodates fights that you ran away from and I just like it more for no good reason except that its mine :P (Sorry Kentona)
It's okay, I can take it....





*sniffle*
for me, I use Add AP into variabel in battle condition.
lol, is it just me, or does divinelight's way of doing it seem so much more simplistic and easy? It seems to do what needs to be done as well.
kentona
I am tired of Earth. These people. I am tired of being caught in the tangle of their lives.
20742
Is that for random battles, though? Or scripted event-driven battles?
harmonic
It's like toothpicks against a tank
4120
In RM2k3 there's really no other way to script point acquisition (other than xp and money) than what Kentona said. On turn 0 of every battle, turn a switch on that calls a common event, which adds the AP and turns that switch back off.
mysersguy and divinelight, that method wouldn't work because I was talking about random encounters, and as far as I know, there's no "Victory" battle event condition. Just wanted to clear that up.
You can make a custom random battle system so that every X steps you go into a battle, then if you win the battle you gain x amount. Um. I'll try to explain a bit better.

Have a process that checks whether the player has moved by constantly comparing X/Y positions.

Make it so that if the player has moved there's a random chance of an enemy encounter. You'll have to test this so that random encounters aren't too annoying. Try about a 1/10 or 1/15 chance.

If there is an enemy encounter you can choose a random enemy via variables and have the victory condition give your the AP (best used if AP gain is constant no matter what monsters you face).

This way is easy if you want to just have a random monster group attack. Make a variable *Random* and set it to randomise between the numbers of the monster parties in the database. It's highly recommended that you have each areas monsters together. So say in the database:
MP(Monster Party)0001: Field Slimes x2
MP(Monster Party)0002: Field Slimes x3
MP(Monster Party)0003: Field Mice x2
MP(Monster Party)0004: Field Birds x 4
MP(Monster Party)0005: Cave Bats x 2

So if you wanted only the Field monsters to be chosen you'd make the *Random* variable randomise between 1 and 4. If you wanted the Cave monsters then you'd have to randomise between 5 and the number of the last of that area's monsters. Then, in the enemy encounter command have it choose an enemy via the variable *Random*. Viola!


If you want AP gain to be different for each type of monster, use variables to create random battles and add the different AP in the victory condition.

Make a *Random* variable (every game should have one ^.^). Using the above example (hidden) have the amount of monsters randomised. Four monsters in this case.
So:
IF VARIABLE =
ENEMY ENCOUNTER
VICTORY CONDITION
<>ADD POINTS HERE
DEFEAT CONDITION
<>DIE
END
END

IF VARIABLE =
ENEMY ENCOUNTER
VICTORY CONDITION
<>ADD POINTS HERE
DEFEAT CONDITION
<>DIE
END
END


ET CETRA and so forth.


Hope that helps. It's easier to add it during the battle, however.
Ocean
Resident foodmonster
11243
author=mantlecore77 link=topic=593.msg8856#msg8856 date=1202681047
mysersguy and divinelight, that method wouldn't work because I was talking about random encounters, and as far as I know, there's no "Victory" battle event condition. Just wanted to clear that up.
You can make your own random encounter system. Plus, this gives you the added benefit of having abilities/conditions/whatever happen before or after a battle, or altering the battle itself in some way. Like, for example, if I have an initiative ability, I can set it so that if they have it equipped, then the player will strike first in the battles. If they don't, it goes as normal. Actually, that's not a very good example as there are weapons/items that can do that too but you get my point.

Or have event encounter systems. They're nice.
kentona
I am tired of Earth. These people. I am tired of being caught in the tangle of their lives.
20742
event encounter systems get...tedious after a while. It's the #3 killer of motivation!

Building your own random encounter system is an option, but if your only aim is to have a "after battle" event, then the effort may not be worth it.
I agree with Kentona. A custom encounter system isn't too hard to make (I've got one in one of my projects. I made it because I really, really, really, really, hate any random encounter system that supports one-step encounters and I added more to it later), but if you're going to try and use it to support end-battle event running, you'll just make more work for yourself. Its possible with the right design it won't become a pain to make changes, but at the end of the day you'll still have a mess.

The common event method of running post-battle scripts that Kentona and I described is really the best way to do it. I'd do it that way even in the case of using a custom encounter system like I am. Its just so easy to make universal changes, find bugs, and the like.
Pages: 1