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,012
Reaction score
944
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,524
Reaction score
5,537
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

I'm currently being attacked by the RPG Maker Hydra: fixing one problem only to have two more rise to take its place.
Hey you! Yeah YOU! Whatcha doin' not backing up your projects? You a masochist or sumthin'? GO BACK UP YOUR PROJECTS! Sheeesh... Didn't think I'd hafta spell it out for yas.
now I need to determine, how MV determines if an auto tile is complete or not.
Edit:From what I can tell it uses Autotile kinds to do that.
Edit 2: The editor determines it and packs picture data for the engine....
Finished with the ground work for my class system, using Ellye's Class Change Equipment and Yanfly's Class Change Core plugins to implement an equip based subclass feature!
Hi people! I was wondering... Here in Brazil, we have a whats app group for we talk about rpg maker and our projects. A more informal way for we meet each other. Is there any whats app group out there? :)

Forum statistics

Threads
94,281
Messages
919,643
Members
124,014
Latest member
pradeepkanojia
Top