Interrelated parameters

ButtAlien

Villager
Member
Joined
Mar 17, 2019
Messages
12
Reaction score
0
First Language
English
Primarily Uses
RMMV
I would like to be able to connect main parameters with each other. For example, I would to be able to have a character's Magic Attack parameter be increased by a percentage of their Defense parameter. The hope is to encourage players to not just choose magic attack boosting items for their wizards. I would prefer that this be a state option (so it could be turned on and off easily), but a class option would work as well.

I have tried desperately to implement this feature myself, but have had no luck. If anyone could help me out, I would be extremely grateful.
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
You can also just utilize the damage formula of your skills to implement some of these.. Like include the def parameter of the caster in your formula instead of just the mat

Else, Yanfly's Parameter plugin can allow you to make custom formulas for the parameters, just take care that you dont make parameters that has a circular reference which would make an infinite loop.
 
Last edited:

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,522
Reaction score
14,255
First Language
English
Primarily Uses
RMVXA
Right. For instance, if DEF uses MDF, then MDF can't use DEF, that is a circular loop that will always be updating. But a better way would be to use the damage formula, for instance have your physical skills use a percentage of the MDF stat too in damage reduction and so on.
 

ButtAlien

Villager
Member
Joined
Mar 17, 2019
Messages
12
Reaction score
0
First Language
English
Primarily Uses
RMMV
I can change the base parameter formula for MAT to include DEF, but then MAT wont increase when i equip a +100 DEF item , right? I need it to increase when items are applied as well. I do have skills that factor in DEF, I was interested to see if i could create a passive as an alternative.
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,522
Reaction score
14,255
First Language
English
Primarily Uses
RMVXA
No, but you can change your damage formula to include the increase. For instance, if you want a +100 to DEF to include +10% of your DEF to MAT you do this:

(a.mat + a.def * 0.10) instead of a.mat.

If you want it to be a different percent, you change the number in the formula.
 

ButtAlien

Villager
Member
Joined
Mar 17, 2019
Messages
12
Reaction score
0
First Language
English
Primarily Uses
RMMV
I have it working finally, but the code below murders my game performance. Is there an alternative way to access the characters defense parameter? Thank you guys so much for your help.

<Custom Class Parameters>
maxhp = level * 25 + 300;
maxmp = level * 8 + 300;
atk = level * 12 + 12;
def = level * 15 + 15;
mat = level * 17 + 17 + $gameActors.actor(5).param(3); //add defense to magic attack
mdf = level * 15 + 15;
agi = level * 16 + 16;
luk = level * 15 + 15;
exp = level * (level / 2) * 20 +10;
</Custom Class Parameters>
 

ButtAlien

Villager
Member
Joined
Mar 17, 2019
Messages
12
Reaction score
0
First Language
English
Primarily Uses
RMMV
Update: I believe the reason my performance is dying is because the code listed above is constantly reevaluating the formula and as such i am getting the Maximum Call Stack Size Exceeded error. Any ideas on how to stop the game from repeatedly checking? Also, I realize this is a different question to my original issue. Is there a different forum I should move this too?
 
Last edited:

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

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,865
Messages
1,017,059
Members
137,575
Latest member
akekaphol101
Top