How to control EXP in troops and enemies

I want to know how to set the exp to zero if the player level exceeds the enemy, for example I make a zombie I had its stats designed to be fought by level 5 players but I want if the player surpassed lvl 8 want the enemy unable to give EXP when when the player is lvl 8 or over.
I've moved this thread to RGSS2 Script Requests. Please be sure to post your threads in the correct forum next time. Thank you.


You will need a script for that.


Can you clarify whether you are using VX (which is where you posted) or XP (which is what your profile shows)?
I've moved this thread to RGSS2 Script Requests. Please be sure to post your threads in the correct forum next time. Thank you.

You will need a script for that.

Can you clarify whether you are using VX (which is where you posted) or XP (which is what your profile shows)?
I am using RPG Maker MV and I didn't know you needed a script.

(Yeah need to update profile)
lol - then you still posted in the wrong place - VX Support was where you put it. So now I shall move it again, to the REAL correct place.


It is pretty easy to determine that you need a script/plugin for this. Looking at the database, there is one place where you can set an enemy's EXP. You cannot set multiple values and conditions that determine which value should be used. If you want this, you will need a plugin. Enemies do not have levels. If you want this, you will need a plugin. There is no way to compare enemy stats to player stats. If you want this, you will need a plugin.
lol - then you still posted in the wrong place - VX Support was where you put it. So now I shall move it again, to the REAL correct place.

It is pretty easy to determine that you need a script/plugin for this. Looking at the database, there is one place where you can set an enemy's EXP. You cannot set multiple values and conditions that determine which value should be used. If you want this, you will need a plugin. Enemies do not have levels. If you want this, you will need a plugin. There is no way to compare enemy stats to player stats. If you want this, you will need a plugin.
@Shaz

So I need a conditional plugin? One that lets me use enemy IDs to tell it  the proper lvl range to give exp? Perhaps I should put thought into this more please lock this until I have what I need mapped out better.
I can quickly write a plugin that allows you to use formulas (similar to damage formulas) to calculate the experience gained per enemy if you would like.
I can quickly write a plugin that allows you to use formulas (similar to damage formulas) to calculate the experience gained per enemy if you would like.
Hmmm explain more please
Basically you'd be able to define experience formulas in the notes section of the enemy using note tags. Sort of like damage formulas.

Like 

<exp>

value = 100 * 2;

</exp>

to make an experience formula for 200 exp. Of course there is the ability to use some variables as well, like any actor in the game party,or any switch or variable, or the enemy object itself since its evaluated as java script code. I've gone a head and made it for you, there are some example and a short how to in the help just save this file as Anima_ExpControl.js and add it to your plugins.

The code can be found here: https://bitbucket.org/liquidize/anima-framework/raw/d8c83b33d86209b54a122c29d4b147fe5df22cc0/Experience%20Control/Anima_ExpControl.js

If you have any questions or request feel free to ask, it was quickly written so it can be extended.

EDIT: There are a few typos in the help, there is no "level()" function on actors, use "actorobject._level" instead. Also you can use the exp specified in the Exp field of the database with the variable exp.

EDIT 2: Sorry this was rather written fast lol, however here is a formula to do what you described in your first post.

<exp>

value = exp;

for (var i = 0; i < battleActors.length; i++){

 if (battleActors._level >= 8) value = 0;

}

</exp>

 

this will make it so the experience given by this enemy is 0 exp if any of the actors have a level of 8 or higher. I understand you probably want it on a per actor basis, and that can be done too, but would require an edit to the script.
You need a way of identifying what "player level" this enemy is intended for (and you need to define how "player level" is to be calculated - is it the leader's level, a certain actor's level, the average level of the entire party, the average level of just the battlers)

You also need a way of saying how much EXP to give if the "player level" is below that figure, and how much to give if it's greater than that figure (and how much if it's exactly that figure)

It's likely that these things can be set up using note tags. But you will need a plugin to do the calculations and comparisons, and to give the appropriate EXP based on the results.

It could be set so you could do something like this in note tags:

<playerlevel: 5><EXPifLower: 10><EXPifHigher: 0>or something like this:
Code:
<EXPtoGive 5 10 0>
where the first number is the player level, the second is how much to give if below, and the third how much to give if higher.Of course there could be other possibilities too.

It would be a case of you working with a scripter to determine what's the best method that makes it both easy to code and easy to use.

Edit: @Liquidize, given GraveBusta's apparent confusion when it comes to scripts, I think the one you provided might be quite a bit too difficult to implement.
You need a way of identifying what "player level" this enemy is intended for (and you need to define how "player level" is to be calculated - is it the leader's level, a certain actor's level, the average level of the entire party, the average level of just the battlers)

You also need a way of saying how much EXP to give if the "player level" is below that figure, and how much to give if it's greater than that figure (and how much if it's exactly that figure) Party Leader since I am doing 1 main character and temporary other party members

It's likely that these things can be set up using note tags. But you will need a plugin to do the calculations and comparisons, and to give the appropriate EXP based on the results.

It could be set so you could do something like this in note tags:

<playerlevel: 5><EXPifLower: 10><EXPifHigher: 0>or something like this:
Code:
<EXPtoGive 5 10 0>
where the first number is the player level, the second is how much to give if below, and the third how much to give if higher.Of course there could be other possibilities too.

It would be a case of you working with a scripter to determine what's the best method that makes it both easy to code and easy to use.

Edit: @Liquidize, given GraveBusta's apparent confusion when it comes to scripts, I think the one you provided might be quite a bit too difficult to implement.
Yes please and sorry Liquidize I have no JS knowledge yet hehehe I have attempted C++ although I never made it through the basics.
So you need to define some things first.


What is the "party level" - is it the average level of all party members? The average level of all the battlers? Does it include knocked out members? Is it just the leader? Is it a particular actor? Or do we compare actor by actor and give one or the other amount of EXP depending on whether that actor's level is greater or less than the magic number?


What are the comparisons to be - is it one value for < and another for >=? Or one value for <= and another for >?
So you need to define some things first.

What is the "party level" - is it the average level of all party members? The average level of all the battlers? Does it include knocked out members? Is it just the leader? Is it a particular actor? Or do we compare actor by actor and give one or the other amount of EXP depending on whether that actor's level is greater or less than the magic number?

What are the comparisons to be - is it one value for < and another for >=? Or one value for <= and another for >?
1 actor is lvl 8 (the only party member getting exp) vs lvl 5 monsters  3 level difference causes no experience. 

it's a bit hard to tell you more clearly since I am trying to avoid spoilers on character names all I can tell you the party by default is 1 player I will be adding guest players as the story goes by but their stats are gonna be entirely gear based not level based, I also plan on having a form system where the player can turn into a more powerful form as the main protagonist but shift back to normal for after battle. I have found a way to transform actors without the use of scripts its just balancing the exp tables with a lvl cap of 15-20 is a bit hard to do. if I add forms that level up it will be harder to keep the player from feeling overwhelmed that is why I am not using a standard EXP system.
is there a way to have each character get a custom amount of exp? such as if I have a party of 4, each with a different level and say they are fighting a group of monsters each with there own levels. if the hero level matches the monster level, that hero will receive 100xp; say the other hero is below that monsters level, so he will receive 25more exp per level difference between that low level hero and that monster.
A slightly different question. I would like to tweak the EXP gained if my level is Easy or Hard. Can this be done with a script call?

e.g $gameActors.actor(actorId).gainExp(n*150%) ;

Screenshot 2022-02-15 115154.jpg

Original thread: https://forums.rpgmakerweb.com/threads/how-to-control-exp-in-troops-and-enemies.51352/