Jump to content

Recommended Posts

Battle Exp

Author: Tsukihime

 

Overview

 

This script changes the exp system such that actors don't gain exp from winning a battle, but instead they gain "battle exp" by successfully damaging the enemy.

 

When you hit an enemy, you gain a certain amount of exp equal to a fraction of the total exp that the enemy would give.

 

When you kill an enemy, the actor that killed the enemy received the total exp from the enemy, inaddition to all of the previous hits.

 

Usage

 

Just specify the "hit" formula at the top of the script as well as the max exp possible in battle.

In the database editor under Enemies tab, the exp that you specify is the exp you receive when the enemy is killed.

 

The following variables are available

 

a = actor (Game_Actor)

e = enemy (Game_Enemy)

r = action result (Game_ActionResult)

 

Download

 

Script: http://db.tt/TeZuVUnk

 

Notes

 

Some graphical improvements would be nice.

 

For example, everytime you land a successful hit, the game actually tells you how much exp you gained (like an exp pop-up), and maybe there's an exp bar that fills up as the battle progresses so you know whether you've reached the limit or not.

Edited by Tsukihime

Share this post


Link to post
Share on other sites

Can you extend the system ?

Like a priest who heal will also gain exp ?

 

Don't know how to determine how much exp should be received.

Have it set for each individual skill, preferably with notetags.

Share this post


Link to post
Share on other sites

I tried using ths script, but for some reason your coding isn't separated by line. It's all one big line. I separated it myself, but it's not working. It actually prevents damage dealt to the enemy. Could you repost this with the correct code?

Share this post


Link to post
Share on other sites

Not sure what you mean. I copy tested code directly from Ace and onto a text file in notepad++

 

Well, your link posted on this topic to the scriptopens a new window with the code in it. But, it's all one big sentence,if you will. It looks as though it was not spaced or entered.

 

Example:

 

The entire code looks like this:

module Tsuki module Battle_Exp Hit_Exp_Formula = "e.exp * 0.05" #formula used to calculate "hit" exp Max_Exp = 25000 # limit how much exp someone can gain from battle end end

 

I'm assuming this reads:

 

module Tsuki

module Battle_Exp

Hit_Exp_Formula = "e.exp * 0.05" #formula used to calculate "hit" exp

Max_Exp = 25000 # limit how much exp someone can gain from battle

end

end

 

Does that make sense?

Share this post


Link to post
Share on other sites

So you're saying my script should be spaced and indented properly before I upload it.

 

In any case I can't reproduce the issue. It might be the browser you're using that doesn't handle formatting characters properly when rendering text files (like some old version of IE that is totally garbage, or some browser that's based on IE, ...)

 

Just download the script directly without copying and pasting.

Edited by Tsukihime

Share this post


Link to post
Share on other sites

So you're saying my script should be spaced and indented properly before I upload it.

 

In any case I can't reproduce the issue. It might be the browser you're using that doesn't handle formatting characters properly when rendering text files (like some old version of IE that is totally garbage, or some browser that's based on IE, ...)

 

Just download the script directly without copying and pasting.

 

You're right, I got it working. I righ-clicked and saved the file, then opened it and it worked. Awesome script!

 

Did you ever find anyone to code the pop up for exp when the character recieves it?

Share this post


Link to post
Share on other sites

It doesn't exist and will need to be written.

Probably similar to the damage pop-up some battle systems have.

 

True. I'll see what I can edit and post ifI get it working.

 

I have another question.

I have tried implementing Yanfly's stand-alone Victory Aftermath,but it does not seem compatible. The experience bars, if you're familiar with the script you'll know, still say the enemy's full xp reward instead of what they get from your script modifier. Anyway you could help me locate what can be tweeked to get it working?

Share this post


Link to post
Share on other sites

So this is like Final Fantasy Tactics where you gain some exp every hit?

Edited by KilloZapit

Share this post


Link to post
Share on other sites

Pretty much, although there is not much flexibility in how the exp is controlled (eg: level differences, strength differences, etc)

 

So, I was thinking that actors could gain a different amount of exp based also upon how much damage they deal to the enemy.

 

I tried editing the formula to something like this:

 

"e.exp * ($game_battler.hp_damage / $game_battler.mhp)"

 

This in theory sound like it would work but I am a novice scripter. I tested it and of course it did not work. Would I go about something like this, or is it a lot more complicated than that?

Share this post


Link to post
Share on other sites

I've updated the script.

 

As usual, you can reference Enemy attributes using the `e` variable.

Additionally, you can use the `a` variable to reference the actor (maybe you want the level), or the `r` variable to reference the ActionResult object, which gives you access to the following attributes found in Game_ActionResult:

 

attr_accessor :used                     # used flag
 attr_accessor :missed                   # missed flag
 attr_accessor :evaded                   # evaded flag
 attr_accessor :critical                 # critical flag
 attr_accessor :success                  # success flag
 attr_accessor :hp_damage                # HP damage
 attr_accessor :mp_damage                # MP damage
 attr_accessor :tp_damage                # TP damage
 attr_accessor :hp_drain                 # HP drain
 attr_accessor :mp_drain                 # MP drain
 attr_accessor :added_states             # added states
 attr_accessor :removed_states           # removed states
 attr_accessor :added_buffs              # added buffs
 attr_accessor :added_debuffs            # added debuffs
 attr_accessor :removed_buffs            # removed buffs/debuffs

 

For example:

 

e.exp * (r.hp_damage / e.mhp)

 

This is only for the hit exp.

Edited by Tsukihime

Share this post


Link to post
Share on other sites

I've updated the script.

 

As usual, you can reference Enemy attributes using the `e` variable.

Additionally, you can use the `a` variable to reference the actor (maybe you want the level), or the `r` variable to reference the ActionResult object, which gives you access to the following attributes found in Game_ActionResult:

 

attr_accessor :used					 # used flag
 attr_accessor :missed				   # missed flag
 attr_accessor :evaded				   # evaded flag
 attr_accessor :critical				 # critical flag
 attr_accessor :success				  # success flag
 attr_accessor :hp_damage				# HP damage
 attr_accessor :mp_damage				# MP damage
 attr_accessor :tp_damage				# TP damage
 attr_accessor :hp_drain				 # HP drain
 attr_accessor :mp_drain				 # MP drain
 attr_accessor :added_states			 # added states
 attr_accessor :removed_states		   # removed states
 attr_accessor :added_buffs			  # added buffs
 attr_accessor :added_debuffs			# added debuffs
 attr_accessor :removed_buffs			# removed buffs/debuffs

 

For example:

 

e.exp * (r.hp_damage / e.mhp)

 

This is only for the hit exp.

 

Nice work! I'm glad I wasn't TOO off. :D

Thanks again!

 

EDIT:

I tried the new script, but for some reason it did not change anything.

I am wondering if I have a conflicting script, but I don't believe any of the other battle scripts reference the same sets of class other than the Battle Aftermath script.

Edited by Adrian Meza

Share this post


Link to post
Share on other sites

Well, when I edited the formula to (e.exp * ($game_battler.hp_damage / $game_battler.mhp)) in your original script, it gave no extra exp to an actor other than whoever killed the enemy. The same result comes with the update. I'm looking through my scripts because again, I believe it's being conflicted.

Edited by Adrian Meza

Share this post


Link to post
Share on other sites

Is "$game_battler" even a valid object? What does that var refer to?

I mentioned before, I am a novice scripter. I am not even sure that it would work, but when I was reading the scripts, the class Game_battler referenced hp_damage, which was a variable I though would be most appropriate for what I wanted. Regardless, the update to the script makes this function correctly, but it seems to be conflicting with another on of the scripts I have implemented.

 

EDIT:

 

I am stupid, and I apologize for wasting your time.

 

This is a math error on my part.

 

If exp granted is equal to the percentage of their total hp, and the actor can only possibly do 100% of damage to their hp, then they would gain of course 100% of the exp reward.

 

My only concern is, shouldn't the actor gain an additional 100% of the exp reward? Because this does not happen.

Edited by Adrian Meza

Share this post


Link to post
Share on other sites

Is "$game_battler" even a valid object? What does that var refer to?

 

It refers to nil.

And my method will rescue the user and return 0.

 

I should probably remove the rescue and have the game tell the user that something went wrong.

Share this post


Link to post
Share on other sites

Is "$game_battler" even a valid object? What does that var refer to?

I mentioned before, I am a novice scripter. I am not even sure that it would work, but when I was reading the scripts, the class Game_battler referenced hp_damage, which was a variable I though would be most appropriate for what I wanted. Regardless, the update to the script makes this function correctly, but it seems to be conflicting with another on of the scripts I have implemented.

 

Yeah, but "Game_Battler" is a class, not an object. A object is a thing that exists, and a class is more or less a set of behaviors some types of things have. Well... something like that anyway. Yeah, I know, it's a bit confusing because "$game_player", "$game_map", etc. refer to objects of the "Game_Player", "Game_Map", etc. class. But that's because there usually is only one object of those classes at a time. You need to use "a" or "e" which are objects of the class "Game_Battler" (actually they are objects of the "Game_Actor" and "Game_Enemy" classes but both are subclasses of "Game_Battler", but that's a whole other thing to get into).

 

You know it's kind of sad that the first idea for an analogy that would explain what classes are that popped in my head was that they were like platonic forms... but I doubt anyone knows what platonic forms are! :P

Edited by KilloZapit

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.

×
Top ArrowTop Arrow Highlighted