altering a script through activation of an event

KeenWolf

Amateur Game Creator
Member
Joined
Mar 14, 2014
Messages
18
Reaction score
0
First Language
English
Primarily Uses
     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).

 

 

      
 
Last edited by a moderator:

ShadowLurk

Tanoshii~
Veteran
Joined
Feb 14, 2014
Messages
226
Reaction score
53
Primarily Uses
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.
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,671
Reaction score
2,993
First Language
Tagalog
Primarily Uses
and make the font size larger, it's not that easy to read thru really small texts
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
38,789
Reaction score
12,219
First Language
English
Primarily Uses
RMMV
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 ;)
 

KeenWolf

Amateur Game Creator
Member
Joined
Mar 14, 2014
Messages
18
Reaction score
0
First Language
English
Primarily Uses
Sorry about text it is a habit from school...
 

ShadowLurk

Tanoshii~
Veteran
Joined
Feb 14, 2014
Messages
226
Reaction score
53
Primarily Uses
I tried to make stamina gain arbitrary. Try this:

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...
 
Last edited by a moderator:

KeenWolf

Amateur Game Creator
Member
Joined
Mar 14, 2014
Messages
18
Reaction score
0
First Language
English
Primarily Uses
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.
 

ShadowLurk

Tanoshii~
Veteran
Joined
Feb 14, 2014
Messages
226
Reaction score
53
Primarily Uses
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...
 

KeenWolf

Amateur Game Creator
Member
Joined
Mar 14, 2014
Messages
18
Reaction score
0
First Language
English
Primarily Uses
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. 
 

ShadowLurk

Tanoshii~
Veteran
Joined
Feb 14, 2014
Messages
226
Reaction score
53
Primarily Uses
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))
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Well, looks like I need to build myself a quest system. Or really just a system for "Helpful voices" to talk to the player. I'm sure nothing will go wrong listening to them.... They're "helpful". :LZSwink:

Should be pretty easy with PIXI just letting me write all over the screen. :LZSexcite:
I'm starting to think I just dont like anime since the last one I enjoyed was none of them.
Hi guys, Im new here. Im using RPGMMV. In this community i would like to learn more and become better rpg developer.
The main character for the first game was originally going to become a member of the party in the third game but I'm probably changing him to an important NPC instead. That brings the third game's total ensemble roster down to nine with one optional secret character.

Forum statistics

Threads
95,593
Messages
930,309
Members
125,898
Latest member
dudoanxsmb
Top