How to alter enemy parameter in battle based on a variable?

Milennin

"With a bang and a boom!"
Veteran
Joined
Feb 7, 2013
Messages
2,356
Reaction score
1,505
First Language
English
Primarily Uses
RMMV
I'm looking for a way to alter enemy parameters during combat, based on the value stored in a variable. To be more specific, I want to create a skill that, when used, lowers the enemy's Defence and Magic Defence until the end of battle, based on a variable's value that is accumulated through actions during an encounter. Example: say, the variable has a stored value of 10 during a battle. When the skill is used, it needs to lower the foe's Defence and Magic Defence by 10 points.

The only things that come relatively close to what I'm looking for are:
  • "Grow" under skill effects, however, it can only make parameters go up, not down (I think?)
  • States that alter parameters, however, these are in percentages, and can't be tied to variables.
  • The only enemy stats that can be altered through a regular event command are the enemy's HP and MP, but nothing for any of the other parameters.

How can I make this work?
 

Mrs_Allykat

Failsauce
Veteran
Joined
Oct 13, 2017
Messages
521
Reaction score
2,110
First Language
English
Primarily Uses
RMMV
I did something similar based on the number of chickens kicked while playing through the game... Yeah, Zelda left a mark ;) Anyway here is how I handled it:

Under "troops" I added a "round one" script call that does the following,
Code:
hpbump = $gameVariables.value(10) * 100

atkbump = $gameVariables.value(10)

$gameTroop.members()[0].addParam(0, hpbump)

$gameTroop.members()[0].addParam(2, atkbump)

$gameTroop.members()[0].addParam(3, atkbump)

$gameTroop.members()[0].addParam(5, atkbump)
I think you could manipulate this in a skill to reduce parameters. ( I reused ATKBump and HPBump based on the scale I was wanting to adjust the number by. So, kick 1 chicken the mob gets +100 hitpoint and only +1 ATK. I think the other two I add to is mana and def )

Since this is under troops in the database, it's kind of easy. It's also one monster. While I'm really not sure of the next part, I would start by deciding between "how to use a common event to get the $gameTrooop.members()" or would it be easier and faster to "only have certain troops susceptible to the effect" and having the script calls only on those troop sets.

( edit: obviously, you'de want to make those numbers turn negative before using addParam() in your case since it will be a debuff. )

Take it with a grain of salt though, I'm still a bit of a newbie.
:kaosigh:
 
Last edited:

lvkeai

test Custom Title
Member
Joined
Jan 13, 2018
Messages
16
Reaction score
8
First Language
Chinese
Primarily Uses
RMMV
Can these parameters be restored after the battle?
 

Alisu

Veteran
Veteran
Joined
Apr 4, 2018
Messages
61
Reaction score
36
First Language
Finnish
Primarily Uses
RMMV
I don't think enemies exist after battle anyway. So whichever modifications you did in one battle to the enemies won't show in the next battle. You get fresh patch.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

And (un)surprisingly, I already started developing a old project as MZ code right off from the bat. Waiting the launch anxiously...
Is there a single word I can use instead Magic Defense", but has the same meaning?
does anyone know where I could theoretically post a game i made full of copyrighted content so that I can get feedback on it

edit: not looking to make any money or anything. just want criticism
Yay! It's raining! ^.^
I decided to take part in the One Map Game Challenge. :LZSexcite:
Finished the map itself, just need to finish the actual game lol.

Forum statistics

Threads
100,668
Messages
978,296
Members
132,289
Latest member
WhateverImDrunk
Top