Charas-Project

  • Home
  • Help
  • Search
  • Calendar
  • Login
  • Register
*
Please login or register.

Login with username, password and session length
 

News:

Click here to join us on IRC (#charas on irc.freenode.net)!



  • Charas-Project »
  • Game Creation »
  • Requests »
  • RPG Maker Programming »
  • How do I find out how much EXP was gained last battle?
« previous next »
  • Print
Pages: [1]

Author Topic: How do I find out how much EXP was gained last battle?  (Read 2206 times)

Offline Tisteca

  • Member
  • Initiate
  • *
  • Posts: 3
How do I find out how much EXP was gained last battle?
« on: June 03, 2007, 05:29:58 AM »
OK, so I'm making a materia-like system that uses normal EXP (not AP or something), which will be added to a variable and stuff will happen once the variable gets high enough. But in order to add to this variable, the script has to know how much EXP was gained last battle. How would I do that (without having to code too much)?
Logged

Offline Prpl_Mage

  • Administrator
  • Sage
  • *
  • Posts: 7,645
  • The Administrator Mage
    • Check out our itch website
(No subject)
« Reply #1 on: June 03, 2007, 06:36:07 AM »
Hmm I guess that you could set the variable equal to the hero's experiance although that would not give you the exact number of exp you earned that fight, so I guess that wont work.

But you should be able to add a battle event that increases a variable by the number of exp you get from that monster when it´s dead.
That would solve the problem but you´d have to make an event for every monster in the monster group.
Logged
Cool RPGM Project!
Sprite till you die

Oh my god, this was ...10 years ago...

Offline game_maniac

  • Member
  • Acolyte
  • *
  • Posts: 350
(No subject)
« Reply #2 on: June 03, 2007, 09:06:24 AM »
How about making a variable to determine the total experience of your hero before the battle, doing the same after the battle is over and subtracting both?
Logged
Um, not to sound stupid or anything but what's castration? Is it like a food or something?" -vannypegasus, Pokémon board (6/14/05)

BlackRose203: There are only 21 hours in a day. Go to school more. -_-

Offline zuhane1

  • Member
  • Associate
  • *
  • Posts: 210
  • Male, Tall, 16, UK, Brown hair, Tom.
(No subject)
« Reply #3 on: June 03, 2007, 12:41:05 PM »
How would you go about putting it into a bar after a battle? It would be cool to make a FF7 sort of EXP bar appear.
Logged
Nether-
A game featuring more extras and minigames than anything. Endorse in hours of fun without even doing the storyline. A game with so many features it's just not right.

Offline game_maniac

  • Member
  • Acolyte
  • *
  • Posts: 350
(No subject)
« Reply #4 on: June 03, 2007, 01:03:08 PM »
I can't remember what FF7's exp bar was like from the top of my head, but I don't think you'd need more than quite a few pictures of a bar and a variable representing the total exp the hero has.
Logged
Um, not to sound stupid or anything but what's castration? Is it like a food or something?" -vannypegasus, Pokémon board (6/14/05)

BlackRose203: There are only 21 hours in a day. Go to school more. -_-

Offline Prpl_Mage

  • Administrator
  • Sage
  • *
  • Posts: 7,645
  • The Administrator Mage
    • Check out our itch website
(No subject)
« Reply #5 on: June 03, 2007, 06:10:34 PM »
Well I guess that you are using a CMS so you could use this tut-thingy Dragonblaze helped some other members do their health bar in their CBS, pretty much the same thing but an exp bar instead of a health bar.

Quote
Written by Dragonblaze some time back:
Ok I dont know what you mean by start, but i can help you with the hp bar.

Ok, how many pictures do you have for the bar? Well lets say you have 20 (if you don't, just replace 20 with the number you have).

First off, set a variable to the current hp, lets call it [hp percent]. Multiply it by 19 (or one less than the number of pictures you have 20-1 = 19), then divide it by the hero's total hp. This will make [hp percent] equal to the percent of the heros life life.

Now make 20 conditional branches. One for if [hp percent = 0] (show the empty bar), one for if its one (show the almost empty bar, and keep going up from there. In the end, it should look like this.

set [hp percent] = current hp
multiply [hp percent] by 19
divide [hp percent] by total hp

if [hp percent] less than or equal to 0
- show picture, empty bar
if [hp percent] = 1
- show picture, almost empty bar

...

if [hp percent] = 19
-show full bar

The reason you have to do it one less than the number of pictures you have is because you need to count 0 as a number. so even though you're only going up to 19, you're counting 0 too, and 0 + 1-19 = 20 numbers.

Although I´m pretty sure that he will come here eventually to help you I´ll leave this here untill his arrival.
Logged
Cool RPGM Project!
Sprite till you die

Oh my god, this was ...10 years ago...

  • Print
Pages: [1]
« previous next »
  • Charas-Project »
  • Game Creation »
  • Requests »
  • RPG Maker Programming »
  • How do I find out how much EXP was gained last battle?
 

  • SMF 2.0.10 | SMF © 2015, Simple Machines
  • XHTML
  • 2O11
  • RSS
  • WAP2
  • Simple Machines Forum