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,794
Reaction score
10,061
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

Got sick and had to take a few days off work in order to get tested and make sure it wasn't the big one. Felt a lot better today and thought to myself, "Hey now, I can't get tested until tomorrow anyway, I can get so much character art done today!"
....I watched Youtube and browsed this site for hours instead.
>.>
But at least I'm doing the art now! Yaaaaay.......
1638314262144.png
Didn't wanna spam the feed by posting Denzel's spritelayer separae, but I'm real happy with how this concept is coming along so wanted to share it, innit :D
EVXA wrote on Avery's profile.
Not sure how often you take time to play the games sent to you, but if you could give my game a shout & review on steam maybe that would be amazing, only if you like the game of course, I'd love to know which games have been your favorites over the years too.
I'm seeing my god daughter's school play next week. Being the mild agoraphobe I am this makes me nervous. Thus I had a dream that it was actually a plot by my best friend to take me clubbing at an establishment where it is customary to throw a harpoon at staff members to reward good service.
Praise be to the game make!

Forum statistics

Threads
117,090
Messages
1,104,485
Members
153,087
Latest member
Luphelia
Top