Status
Not open for further replies.

kovak

Silverguard
Veteran
Joined
Apr 3, 2016
Messages
1,264
Reaction score
1,567
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,567
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,141
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,141
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,567
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,567
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,729
Reaction score
5,761
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

cdjensen94 wrote on Kaliya's profile.
Are you the one who develops Kaliya's Visual Map Enhancements. If so I desperately need some help. I bought the plugin back a few months. I've only started using it recently.
Cause MP Damage instead of HP, Localization Plugin for Translation | RPG Maker News #112

Here in Fla were are seeing crazy covid spikes and some vaccinated getting bad infections. I had a mild fever on Thurs but it went down fast. How is everyone else doing. Hopefully you are all well. :)
Wish I was better at art, specifically that I was faster at it, bc this one NPC took Several Days to complete! It's gonna take So Extremely Long to do all of the art for my game, never mind writing it... Anyways, here's my gorgon, Hopernica Sthyxis!

57b88732c7abbcd84981dacf624a98495af61fcc.gifv
Idk if this is my ADHD or if it's a common problem. But I cant stay motivated for anything. I want to work on so many different things at once. Game dev, skateboarding, ranking up in League, playing OSRS, fitness, nutrition, relationships. It's like, where do I even begin?

Forum statistics

Threads
113,822
Messages
1,077,716
Members
147,880
Latest member
VenUserOne
Top