Alkaline

Veteran
Veteran
Joined
Jun 30, 2020
Messages
45
Reaction score
8
First Language
English
Primarily Uses
RMMV
Is there a way I can set an enemy to gain resistance after being hit with attacks of the same type? (i.e. after 3 fire attacks the enemy now takes half damage from fire)?
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
36,282
Reaction score
9,703
First Language
German
Primarily Uses
RMMV
yes and no.

you can add as many elemental damage rates to an enemy as you want, they will simply multiply each other.
doing so after a time will require it to be a state, and theoretically this can be done by a troop event checking for most conditions.

unfortunately the conditions you specify are a bit complex to be handled by events, especially if there are many possible attacks of the same element.

so your best guess might be to look for a plugin that could handle this.
 

Alkaline

Veteran
Veteran
Joined
Jun 30, 2020
Messages
45
Reaction score
8
First Language
English
Primarily Uses
RMMV
I feel like Im getting close to event programming this in the troops menu, but I cant seem to be able to count and keep track of how many times the fire move, for example, was used...
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
36,282
Reaction score
9,703
First Language
German
Primarily Uses
RMMV
that needs to be done in the skill, either by calling a common event that counts the correct variables up or by a javascript command in the damage formula that does the same.
both ways require different variables for different targets and will have problems of targeting the correct variable.

there are reasons why I said this is difficult to do by events.
 

dzgword

Villager
Member
Joined
Oct 26, 2016
Messages
9
Reaction score
1
First Language
English
Primarily Uses
There a way where you can do it with one hit if you are using Yanfly's scripts


I would say start there, Maybe add a variable to each element and if variable gets to the number you set activate that state for resistance if its for one enemy.
 

sawworm

Sir Waste Time A Lot
Veteran
Joined
Jul 28, 2013
Messages
138
Reaction score
42
First Language
Turkish
Primarily Uses
RMVXA
Is there a way I can set an enemy to gain resistance after being hit with attacks of the same type? (i.e. after 3 fire attacks the enemy now takes half damage from fire)?
Alright, you need to setup a troop event for that and that needs to check some variables for that.
On skill tab on your fire skill put that into formula before the damage:
$gameVariables.setValue(21, $gameVariables.value(21)+1);
Change the 21 to what your fire variable will be.
Then add a state to change element resist.
Back to troop events, make one event page like that Conditions: Turn End - Span: Turn
on the bottom: if the enemy has 3> fire variable
add state Fire Resist to enemy.
After the battle ends set those element variables to 0 (I recommend using a common event to reset them). I hope this helps.
 

Alkaline

Veteran
Veteran
Joined
Jun 30, 2020
Messages
45
Reaction score
8
First Language
English
Primarily Uses
RMMV
Alright, you need to setup a troop event for that and that needs to check some variables for that.
On skill tab on your fire skill put that into formula before the damage:
$gameVariables.setValue(21, $gameVariables.value(21)+1);
Change the 21 to what your fire variable will be.
Then add a state to change element resist.
Back to troop events, make one event page like that Conditions: Turn End - Span: Turn
on the bottom: if the enemy has 3> fire variable
add state Fire Resist to enemy.
After the battle ends set those element variables to 0 (I recommend using a common event to reset them). I hope this helps.
Awesome! I had something similar set up where I had a common event as an effect of the skill use to count up the variable, I just wasn't able to get the state to show up but now it works perfectly!

Thanks a lot!
Funny enough my variable was also number 21, but what does that line do for the damage formula?
 

sawworm

Sir Waste Time A Lot
Veteran
Joined
Jul 28, 2013
Messages
138
Reaction score
42
First Language
Turkish
Primarily Uses
RMVXA
Awesome! I had something similar set up where I had a common event as an effect of the skill use to count up the variable, I just wasn't able to get the state to show up but now it works perfectly!

Thanks a lot!
Funny enough my variable was also number 21, but what does that line do for the damage formula?
Whenever you cast or do a skill, it adds +1 to the 21st variable~
 

Latest Threads

Latest Profile Posts

I made a menu option that pulls a (accurate) version of the world map from my game instead of having a "traditional" world map. How did I do?

1656552400614.png

..Every time after I edit it and repost it I find a new tiny error I made. :kaodes:
1656550526125.png
Town Design is the best part of an RPG. Well, that and dungeon design
I think that this forum's member posts should include their Phone Number and Social Insurance Number.
My PC just broke with everything I've been working on, on it. I can't afford to replace it. Life is just wonderful....
More musics! Praise be to the winter towns!

Forum statistics

Threads
123,178
Messages
1,154,650
Members
161,546
Latest member
Desteyo34
Top