Check if actor is equipped by one of many armors

Status
Not open for further replies.

Morizel

Veteran
Veteran
Joined
Sep 28, 2018
Messages
112
Reaction score
8
First Language
Russian
Primarily Uses
RMMV
Okay, i want to check in conditional branch next: "IF actor 1 is equipped in ArmorID 6 OR ArmorID 1 OR ArmorID 2 OR ArmorID 9 OR ArmorID 10 OR ArmorID 11), THEN actor's face in message changes."
Because IF plugin "Conditional Branch+" doesn't work, then maybe there is another option?
 

Aesica

undefined
Veteran
Joined
May 12, 2018
Messages
1,844
Reaction score
1,781
First Language
English
Primarily Uses
RMMV
For your conditional branch, paste this into the script box:

Code:
(function(actor, ...ids){ var result = false, armors = actor.armors().reduce(function(r, obj){ return r.concat(obj.id); },[] ); for (i in ids) if (armors.contains(ids[i])) result = true; return result; })($gameActors.actor(1), 6, 1, 2, 9, 10, 11)

Not really tested, but it should work in theory? :D

Anyway it should return true if the actor has armor with any of those IDs equipped, false otherwise. You can add or change the armor ids it checks by modifying the numbers at the very end. Or you can change the actor by changing $gameActors.actor(1) to some other number.
 

Morizel

Veteran
Veteran
Joined
Sep 28, 2018
Messages
112
Reaction score
8
First Language
Russian
Primarily Uses
RMMV
Suddenly, it works.
 

Touchfuzzy

Rantagonist
Staff member
Lead Eagle
Joined
Feb 28, 2012
Messages
7,793
Reaction score
10,058
First Language
English
Primarily Uses
RMMZ

Please do not make a second thread for the same question in your previous thread. There was no need for this one. Closed.

 
Status
Not open for further replies.

Latest Threads

Latest Posts

Latest Profile Posts

All new MZ Weather & Title updates are also RETRO'able for MV! Updated RETRO project will be released on same day I'll release updated MZ demo -project!

retro.png
Just lost about half a day's worth of work because rpg maker crashed during playtesting and corrupted my file :kaolivid:
Boku.gif
advanced_puzzling.PNG
Having a lot of fun making different poses for my character sets! Open to suggestions/critique!

CSKttqh.png

AABS laser beams features:
1,Shoot penetrating laser beams for player's normal attack
2,Beam's width/damage/comsumes/loot can be controlled by events/variables with great flexibility
3,Beam can rebound to walls or certain regionID
4,Can play SE when shooting beams
5,Beam's images can be solid images or animated ones.

Forum statistics

Threads
117,018
Messages
1,103,887
Members
152,923
Latest member
mistikal
Top