Check an enemy's weakness

Status
Not open for further replies.

Super015

Villager
Member
Joined
May 12, 2013
Messages
21
Reaction score
0
First Language
Italiano
Primarily Uses
RMMV
Hi, is there a way to check (via events) if an enemy is weak to a certain element?
Maybe through a conditional branch, it would be perfect.
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
2,604
Reaction score
1,961
First Language
English
Primarily Uses
RMMV
Do you mean check a specific enemy or just whether at least one enemy in the battle is weak against the element in question?
 

ShadowDragon

Veteran
Veteran
Joined
Oct 8, 2018
Messages
2,944
Reaction score
1,050
First Language
Dutch
Primarily Uses
RMMV
Yanfly have a libra skill (you can adjust it in the way you want too) found here.
remember, you need the required plugins to make this work.
 

Super015

Villager
Member
Joined
May 12, 2013
Messages
21
Reaction score
0
First Language
Italiano
Primarily Uses
RMMV
I'm creating an ability that varies based on the elemental weakness of the enemies. Any suggestions on how to program it?
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
2,604
Reaction score
1,961
First Language
English
Primarily Uses
RMMV
What exactly do you want it to do?
 

Super015

Villager
Member
Joined
May 12, 2013
Messages
21
Reaction score
0
First Language
Italiano
Primarily Uses
RMMV
The skill is physical but can acquire an element between fire, ice or lightning if the enemy has one of these 3 weaknesses.
My problem is that I don't know how to check which element the enemy is weak at.
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
2,604
Reaction score
1,961
First Language
English
Primarily Uses
RMMV
Are you using Yanfly's Element Core plugin? This'll be really easy if you are.
 

Super015

Villager
Member
Joined
May 12, 2013
Messages
21
Reaction score
0
First Language
Italiano
Primarily Uses
RMMV
Yes, I have the plugin but I can't find anything that allows me to check to which element an enemy is weak.
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
2,604
Reaction score
1,961
First Language
English
Primarily Uses
RMMV
You use the enemy's elementRate function for that. I just about have something working but I have to go out, I'll sort it when I'm home.
 

Super015

Villager
Member
Joined
May 12, 2013
Messages
21
Reaction score
0
First Language
Italiano
Primarily Uses
RMMV
Ok thanks, meanwhile I try to see if I can do something myself.
If I can, I'll post the solution!
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
2,604
Reaction score
1,961
First Language
English
Primarily Uses
RMMV
Code:
<Before Eval>
let target = $gameTroop.members()[this._targetIndex];
$gameTemp._forcedElements = [];
if (target.elementRate(2) > 1) {
  $gameTemp._forcedElements.push(2);
}
if (target.elementRate(3) > 1) {
  $gameTemp._forcedElements.push(3);
}
if (target.elementRate(4) > 1) {
  $gameTemp._forcedElements.push(4);
}
</Before Eval>
<After Eval>
delete $gameTemp._forcedElements;
</After Eval>
 
Last edited:

Super015

Villager
Member
Joined
May 12, 2013
Messages
21
Reaction score
0
First Language
Italiano
Primarily Uses
RMMV
OK thanks! It's exactly what I needed! The topic can be closed.
 

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
5,635
Reaction score
5,116
First Language
English
Primarily Uses
RMVXA

Closing Topic at OP's request, and also Moving it to the correct board (Plugin Support).

@Super015 In the future, you can Report your own post and say it's been solved - that will ensure a mod sees it and close the topic or help you with whatever else you need.
 
Status
Not open for further replies.

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

Latest Threads

Latest Profile Posts

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!
one bad plugin combo later and one of my followers is moonwalking off the screen on his own... I didn't even more yet on the new map lol.

Forum statistics

Threads
106,034
Messages
1,018,446
Members
137,820
Latest member
georg09byron
Top