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,838
Reaction score
1,766
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,774
Reaction score
9,973
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 Profile Posts

 …So I was looking at a question someone had asked and did some related experimentation. Apparently the Jump… movement route command works like the ultimate through. Including letting you move around outside the confines of the map entirely. o_O
Jump.png
Okay so today I heard the dumbest theory I have heard in a loooooooong while. It's so stupid I just have to share... Appearantly I have learned to draw 'hot chicks' so that 'real men' get physically excited by looking at it and I can then swoop in and 'turn' them.... Wow... Just... Amazing how some brains works...
What the writer wrote: "The curtain is blue."
The readers: "There must be a hidden meaning behind this, perhaps to convey the character emotions ...".
What the writer has in mind: "The curtain is frickin' blue".
Time to share something!
hmZFwQe.png

I made these a while ago for my game. I took reference from various huts in Africa.
Have a great night! :D
I really need to buy a new mouse. Mine's keeps double-clicking and makes me waste A LOT of time eventing

Forum statistics

Threads
115,844
Messages
1,093,365
Members
151,038
Latest member
ClaudeSpeeds
Top