Check if actor is equipped by one of many armors

Status
Not open for further replies.

Morizel

Veteran
Veteran
Joined
Sep 28, 2018
Messages
65
Reaction score
3
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,011
Reaction score
943
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
65
Reaction score
3
First Language
Russian
Primarily Uses
RMMV
Suddenly, it works.
 

Touchfuzzy

Rantagonist
Staff member
Lead Eagle
Joined
Feb 28, 2012
Messages
6,520
Reaction score
5,531
First Language
English
Primarily Uses
RMMV

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.

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

Latest Threads

Latest Posts

Latest Profile Posts

That moment when you post the wrong download link to your game and wonder why it got so few downloads... :mad:
Trying to make it so my map is cleared of "random" events after the player leaves the map... to little success >.<
Had my first interaction with a legit homophobe concerning one of my games today. Tempting to engage, but pointless.
The BIGGEST immersion breaker for Sword Art Online is that Kirito keeps finding overpowered playstyles using "bad things nobody uses cuz its bad". Players WILL use bad gear BECAUSE it's bad.
When I said I'd make 20 games in 2020, I scared myself. Now it's mid-February, and I've made 6 games. So I got this. But, then again...do I got this?

Forum statistics

Threads
94,238
Messages
919,289
Members
123,945
Latest member
fit2def
Top