altering a script through activation of an event

     Basically I would like to alter a one of the scripts in my game through activation of an on-map event so that the gameplay of my game will change slightly. To be more specific, I am using an ATB based combat system with yanfly's script that allows stats to pass normal maximums, but when agility passes 1000 which is my max stamina for atb it causes my characters to act about 100-1000 times before the monsters even move. I would like to know if I can set an event to change the atb script's "MAX_STAMINA:" line so that characters with agility over 1000 don't get to take nearly infinite turns.

      Normally I would just research this problem, which I did, but it seems no one else is attempting what I am, therefore I require help. Any help would be much appreciated. 

   This is the script being used.

http://www.rpgmakervxace.net/topic/802-ace-battle-engine-add-on-atbstamina-system/

Line 36 is what I would like to alter through event activation.

 

 

    If I set the max stamina to 10,000 then the meter fills at such extreme slow speed that players would get sick of it after the first fight (agility at level 1 is 58). The meter fills based on agility and I want to make it possible to max out agility like any of my other stats which are set to max at 99,999. I figure the best method would be to set an event to change the script to have a higher stamina meter when entering higher leveled areas, but of course if this is not possible I know I can make a loophole such as limiting agility so that it does not exceed a certain amount. I personally don't want to do that though because then it takes away from the ability to strike multiple times in a row before an enemy through different enhancements (ex. abilities or items that boost agility temporarily).

 

 

      
Just change the default MAX_STAMINA to 10000 or something. Also, if you seek help for any script, please also give a link to the script in question in your post.
and make the font size larger, it's not that easy to read thru really small texts
I've moved this thread to RGSSx Script Support. Please be sure to post your threads in the correct forum next time. Thank you.


Please provide links to the scripts you are using so people don't have to search for them (actual links to the original threads - don't copy and paste the scripts themselves).


And +1 on the font size comment. My eyesight isn't what it used to be 😉
Sorry about text it is a habit from school...
I tried to make stamina gain arbitrary. Try this:

Spoiler
module CBS def self.make_battle_stamina @stamina_eql = 20 ($game_troop.members+$game_party.battle_members).each { |member| @stamina_eql += member.agi } @stamina_eql *= 30 / ($game_troop.members+$game_party.battle_members).size end class <<self; alias :stam_mult_org :stamina_mult; end def self.stamina_mult(battler) stam_mult_org(battler).to_f * MAX_STAMINA / @stamina_eql end endmodule BattleManager class <<self; alias :setup_c8987 :setup; end def self.setup(*args) setup_c8987(*args) CBS.make_battle_stamina end end
Put this script below the ATB.Edit: Though I think the problem is not with the stamina gain, but with how the script make stamina gain and loss...
I got an error saying:

Script 'ATB' line 53: NameError occurred.

undefined method 'stamina_mult' for class 'Module'

I'm not sure if I put it in the wrong place, which I tried various places starting with under line 42: ATB = True, or it isn't going to work as you said it may not be the cause of the problem.

I apologize for any trouble, but I am 100% new to everything here since I just started making a game about 2 weeks ago.
Sorry for not giving more info. I meant you put it in a new script page below the ATB script, not under any lines in the original script...
opps, well it works now, but the meter now fills at a fixed rate that is not as slow as having max stamina at 10,000 but still takes about 3 seconds to fill and agility allows characters to attack repeatedly in a single turn then the enemy also gets to act repeatedly in a single turn at a rate of what seems to be 100agility=1attack in a turn, which would be a problem since bosses hit hard and can most likely eliminate a party in a single turn when it can attack about 8 times in a row. 
Check your ATB's SKILL_COST section first. Is it set to the appropriate value?

If you are still having a problem, around line 90 there is this.

return ((2 + [0, battler.agi / 10].max) * self.stamina_mult(battler)).to_i delete the rounding part (".to_i"), so it reads like this:

Code:
    return ((2 + [0, battler.agi / 10].max) * self.stamina_mult(battler))

Original thread: https://forums.rpgmakerweb.com/threads/altering-a-script-through-activation-of-an-event.25047/