Status
Not open for further replies.

kovak

Silverguard
Veteran
Joined
Apr 3, 2016
Messages
1,264
Reaction score
1,569
First Language
PT - EN
Primarily Uses
RMMV
I think i did it but i have no idea of how am i gonna test it

Game_Actor.prototype.gainExp = function(exp) {
var newExp = this.currentExp() + Math.round(exp - Math.round(this.level / 5) * Math.round(Math.randonInt(12)))
+ Math.round(exp * this.finalExpRate());
this.changeExp(newExp, this.shouldDisplayLevelUp());
};
 
Last edited:

Tonedawg181

Tonedawg Gaming
Veteran
Joined
Oct 21, 2016
Messages
67
Reaction score
22
First Language
English
Primarily Uses
RMMV
sorry i went afk for a little bit my friend needed help. Your latest formula came back with
TypeErorr undefined is not a function
and the previous one to that came back as RefrenceError Game_Temp is not defined.

Someone in the yanfly discord suggested this plugin: http://himeworks.com/2016/02/battle-action-exp/
with this code in the plugin parameters.
b.isEnemy() && b.isDead() ? $gameParty.members().forEach(function(mem) {var gains = b.exp() * 0.01 * (90+Math.random(21));mem.gainXp(gains);}) : 0

I'm going to give this a shot real quick and i'll let you guys know of the results.
Also I really do appreciate the effort though your awesome for fiddling around with this with me <3
 
Last edited:

kovak

Silverguard
Veteran
Joined
Apr 3, 2016
Messages
1,264
Reaction score
1,569
First Language
PT - EN
Primarily Uses
RMMV
It's k but i'm not sure if this formula is gonna help you the way it's writen as well.



Game_Actor.prototype.gainExp = function(exp) {
var newExp = this.currentExp() - Math.round(Math.round(this.level / 5) * Math.round(Math.randonInt(12)) + Math.round(exp * this.finalExpRate());
this.changeExp(newExp, this.shouldDisplayLevelUp());
};
 
Last edited:

Aloe Guvner

Walrus
Veteran
Joined
Sep 28, 2017
Messages
1,628
Reaction score
1,145
First Language
English
Primarily Uses
RMMV
Here's an option, as an example, for an +8%/-8% variance across all enemies where the variance applies before the "experience rate" sp-parameter:
Code:
Game_Actor.prototype.gainExp = function(exp) {
    var variancePercent = 0.08;   // 8% variance
    var varianceCap = exp * variancePercent;  // exp from enemy multiplied by percent
    var varianceAmount = (Math.random() * varianceCap * 2) - varianceCap;  // calculates for + or - amount
    var newExp = this.currentExp() + Math.round((exp + varianceAmount) * this.finalExpRate());
    this.changeExp(newExp, this.shouldDisplayLevelUp());
};
 

Tonedawg181

Tonedawg Gaming
Veteran
Joined
Oct 21, 2016
Messages
67
Reaction score
22
First Language
English
Primarily Uses
RMMV
Here's an option, as an example, for an +8%/-8% variance across all enemies where the variance applies before the "experience rate" sp-parameter:
Code:
Game_Actor.prototype.gainExp = function(exp) {
    var variancePercent = 0.08;   // 8% variance
    var varianceCap = exp * variancePercent;  // exp from enemy multiplied by percent
    var varianceAmount = (Math.random() * varianceCap * 2) - varianceCap;  // calculates for + or - amount
    var newExp = this.currentExp() + Math.round((exp + varianceAmount) * this.finalExpRate());
    this.changeExp(newExp, this.shouldDisplayLevelUp());
};

@Aloe Guvner YAAAAAY, thats EXACTLY what I'm looking for!! Works perfectly!
@kovak thank you also, I know you tried a lot of different formula's with me and I love you for that, this is the one im going with though.

If it wasent for both of you guys though coming together and problemsolving this wouldnt have been possible. THANK YOU GUYS SO MUCH!!! <3
 

Tonedawg181

Tonedawg Gaming
Veteran
Joined
Oct 21, 2016
Messages
67
Reaction score
22
First Language
English
Primarily Uses
RMMV
I apologize in advance for the double post, but I figured this should be shared clearly incase anyone else needs this thread.
THIS WAS THE WORKING SOLUTION
open your rpg_objects.js and replace this (lines 3924-3927)

Game_Actor.prototype.gainExp = function(exp) {
var newExp = this.currentExp() + Math.round(exp * this.finalExpRate());
this.changeExp(newExp, this.shouldDisplayLevelUp());
};

WITH THIS

Game_Actor.prototype.gainExp = function(exp) {
var variancePercent = 0.08; // 8% variance
var varianceCap = exp * variancePercent; // exp from enemy multiplied by percent
var varianceAmount = (Math.random() * varianceCap * 2) - varianceCap; // calculates for + or - amount
var newExp = this.currentExp() + Math.round((exp + varianceAmount) * this.finalExpRate());
this.changeExp(newExp, this.shouldDisplayLevelUp());
};


What this will do is give u a slightly random based, but still scaling based EXP variance of 8% up or down from whatever the actual value is for each enemy in the database's xp reward section. It also still allows you to make an enemy give 0 exp if needed. It's compatible with yanfly's victory aftermath and I would assume other plugins that accomplish the same task.

Credits to:
@Aloe Guvner for finding the actual solution.
and @kovak for trying multiple formula's with me to get to this point.
 
Last edited:

Aloe Guvner

Walrus
Veteran
Joined
Sep 28, 2017
Messages
1,628
Reaction score
1,145
First Language
English
Primarily Uses
RMMV
Glad it's working for you!

It would be better to paste it into a new plugin file and add that to your plugin manager.

Reasons:
  • Changes are isolated, so in the future if you decide to change 8% to 10% then it's easier to find
  • If you update your project to a new version, you'll lose all direct edits to the rpg_* js files
 

kovak

Silverguard
Veteran
Joined
Apr 3, 2016
Messages
1,264
Reaction score
1,569
First Language
PT - EN
Primarily Uses
RMMV
Now i wish for something similar but decreasing the variation :/
 

Tonedawg181

Tonedawg Gaming
Veteran
Joined
Oct 21, 2016
Messages
67
Reaction score
22
First Language
English
Primarily Uses
RMMV
Now i wish for something similar but decreasing the variation :/
i would assume this section

var variancePercent = 0.08; // 8% variance

controls the % so making the 0.008 and the 8% lower numbers should do the trick.

right @Aloe Guvner ?
 

kovak

Silverguard
Veteran
Joined
Apr 3, 2016
Messages
1,264
Reaction score
1,569
First Language
PT - EN
Primarily Uses
RMMV
I was more into decreasing it based on actor level instead of changing the percentage itself.
It's fine, this is great.
 

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
8,941
Reaction score
5,855
First Language
Dutch
Primarily Uses
RMXP

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

Latest Threads

Latest Profile Posts

It's a shame that Selection Control will not be ported to MZ. I found a neat way of using it to enable ways for tanks to protect squishies. lol
Lately I have been taking a break from game and resource making so I won't get burnt out. But I am also interested in the Game Jams this site periodically holds. It'd be great if I knew when the next one, if any, is planned.
elexy 1.2.pngSome bust art to be cropped and cleaned. May use in special decision moments. Depending on how it looks in game I may cut it.
Tiamat-86 wrote on ATT_Turan's profile.
apparently since its turning 15 years old this year the ps3 is considered "retro". now how old do you feel?
guess that means im an "antique" gamer since ill still play games as old as i am.
"you know your getting old when your childhood console changes ethnicity" lol it turned yellow
I'm making Toilet in Wonderland 2. and tell vinny about it lol

Forum statistics

Threads
115,347
Messages
1,089,184
Members
150,025
Latest member
HisOwnSelf
Top