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,146
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,146
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,953
Reaction score
5,862
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

$Syringer.png
toying with a brand new monster design
Another doodle! Green-haired girl has no name yet, so, any suggestions?
She is about the same age as Nikki, and she is the last one of her clan, known for their innate skills in manipulating both ice and fire. She is a bit stubborn, as well as having a soft spot for kids.
Mystery messages from my AI assistant. :kaojoy:
1632842960834.png
Made some updates to a previous project I was working on. Trying to mimic the 16 bit Squaresoft aesthetic.

Forum statistics

Threads
115,434
Messages
1,089,892
Members
150,203
Latest member
mead80
Top