Conditional Branch - Actor not wearing any equipment

Fifix

Villager
Member
Joined
Jul 1, 2015
Messages
10
Reaction score
0
First Language
Polish
Primarily Uses
Hi. I was wondering if it's possible to make a conditional branch with a script that checks if actor (number x) doesn't have anything equipped in his equipment slots.


In RPG Maker VX, the script looked like this:


$game_actors[1].equips[0].nil?


Can anyone convert this script so it can be used with RPG Maker MV?
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,144
Reaction score
12,418
First Language
English
Primarily Uses
RMMV
That VX script would only tell you if an actor had a weapon equipped.  It would not tell you whether any of the armor slots were filled.  Is that what you want - by "equipment slots" do you mean "weapon"?  Or do you mean ANY equipment?
 

Fifix

Villager
Member
Joined
Jul 1, 2015
Messages
10
Reaction score
0
First Language
Polish
Primarily Uses
Just one slot is fine, because I could make other conditional branches to check the rest of slots.


If I'm correct, the first part would be:


$gameActors.actor(1).


What about the rest?
 
Last edited by a moderator:

mrcopra

Veteran
Veteran
Joined
Jul 21, 2015
Messages
449
Reaction score
150
First Language
Not English
Primarily Uses
N/A
There is trick and i think its useful


it will check every slots


!($gameActors.actor(x).equips()==",,,,")
 
Last edited by a moderator:

Fifix

Villager
Member
Joined
Jul 1, 2015
Messages
10
Reaction score
0
First Language
Polish
Primarily Uses
Thank you!


I also found a script which I can't make to work in a conditional branch. Getting syntax error "Unexpected end of input".


This is the script:


if ($gameActors.actor(Id).equips(SlotID).contains($dataArmors[Id])


What it's supposed to do is to check if a specific armor is equipped in the selected slot. Any help why I'm getting the error?
 
Last edited by a moderator:

mrcopra

Veteran
Veteran
Joined
Jul 21, 2015
Messages
449
Reaction score
150
First Language
Not English
Primarily Uses
N/A
you forgot ")"


if ($gameActors.actor(Id).equips(SlotID).contains($dataArmors[Id]))
 

Fifix

Villager
Member
Joined
Jul 1, 2015
Messages
10
Reaction score
0
First Language
Polish
Primarily Uses
you forgot ")"


if ($gameActors.actor(Id).equips(SlotID).contains($dataArmors[Id]))
Weird, still getting the same error...


Ok nevermind, it worked when I removed the "if".


Thanks for help!
 
Last edited by a moderator:

mrcopra

Veteran
Veteran
Joined
Jul 21, 2015
Messages
449
Reaction score
150
First Language
Not English
Primarily Uses
N/A
that's how i do it


conditional Branch > Script >  $gameActors.actor(1).equips().contains($dataArmors[1])
 

Morizel

Veteran
Veteran
Joined
Sep 28, 2018
Messages
82
Reaction score
6
First Language
Russian
Primarily Uses
RMMV
Okay!
Then what I need to write if I want to check same on ALL actors in party?
 
Last edited:

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

Latest Threads

Latest Profile Posts

I'm back to the bugs.
100 bugs in my coding,
take one down,
fix it up,
132 bugs in my coding.
On the plus side, if all this rioting sparks another Covid outbreak... I will have a whole lot of time to work on my game. Not exactly how I wanted to get that time, but hey I'm a glass is half full... of RM kind of guy. :LZSwink:
A video once in a while won't hurt.
Have a craving for a Nesquik milkshake. No idea why. Haven't had one since I was a kid. lol. I remember them kinda tasting nice, but also leaving a lot of nasty powder at the bottom of the cup.

Forum statistics

Threads
98,071
Messages
949,016
Members
129,341
Latest member
Shinkukae
Top