Morizel

Veteran
Veteran
Joined
Sep 28, 2018
Messages
112
Reaction score
8
First Language
Russian
Primarily Uses
RMMV
I tried to use "Check.any_equipped" command of "Conditional Branch+", but it doesn't work with multiple armor IDs.
I want to make sure that the actor 1 wears one of two types of armor.
condbranch1.jpg
How to solve this problem?
 

ovate

tale
Veteran
Joined
Dec 16, 2016
Messages
917
Reaction score
1,552
First Language
English
Primarily Uses
N/A
Did you tried-
Check.any_equipped

The script you used in the image-
Check.equipped_any

Edit: I checked the plugin, both ways should work. Are there other plugins you used?
 
Last edited:

Morizel

Veteran
Veteran
Joined
Sep 28, 2018
Messages
112
Reaction score
8
First Language
Russian
Primarily Uses
RMMV
Did you tried-
Check.any_equipped

The script you used in the image-
Check.equipped_any

Edit: I checked the plugin, both ways should work. Are there other plugins you used?
Yes, I using other plugins. A lot of them:
TerraxLightingPlugin;
ARP_TitleCommandExit;
ChangeGraphics;
Yami's Skill Shop;
Yanfly's Battle Engine Core, Buffs & States Core, MoveRouteCore, HitAccuracy, HPGauge, TurnOrderDisplay;
Polyedit's BondageMovementSystem and BMSSV;
And EnemyBook with Community_Basic.
plugins.jpg
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
44,200
Reaction score
15,547
First Language
English
Primarily Uses
RMMV
Please include a link to the script (do not copy/paste the script into this thread)
 

Morizel

Veteran
Veteran
Joined
Sep 28, 2018
Messages
112
Reaction score
8
First Language
Russian
Primarily Uses
RMMV
Please include a link to the script (do not copy/paste the script into this thread)
You mean link to the plugin?
2.0 version.
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
44,200
Reaction score
15,547
First Language
English
Primarily Uses
RMMV
A plugin is a script, so yes.
 

Morizel

Veteran
Veteran
Joined
Sep 28, 2018
Messages
112
Reaction score
8
First Language
Russian
Primarily Uses
RMMV
Alright, the script works well
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)
but plugin doesn't do it. Although i wrote the right lines:
Code:
Check.any_equipped(1, "armor", 6, 1, 2, 9, 10, 11)
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
44,200
Reaction score
15,547
First Language
English
Primarily Uses
RMMV
link, please. It would take a small amount of time to give you the correct command, if you would just provide the link. I'm not going to go hunting for it.
 

Morizel

Veteran
Veteran
Joined
Sep 28, 2018
Messages
112
Reaction score
8
First Language
Russian
Primarily Uses
RMMV
link, please. It would take a small amount of time to give you the correct command, if you would just provide the link. I'm not going to go hunting for it.
I'm not sure that I can help here.
Link to the plugin is above. Or you need another link? I can't understand what the link is required.
I found the code, which supposed to make "Check.any_equipped" works, in the plugin:
Code:
Check.any_equipped = function() {
    var args = Array.prototype.slice.call(arguments);
    var actors = [], weapons = [], armors = [];
    //setup actors
    if (isNaN(args[0])) {
        if (args[0] === "active") {for (var i = 0; i < $gameParty.battleMembers().length; i++) {actors.push($gameParty.battleMembers()[i]._actorId)}
        } else {for (var i = 0; i < $gameParty.allMembers().length; i++) {actors.push($gameParty.allMembers()[i]._actorId)}}
    } else {
        for (var i = 0; i < args.length; i++) {
            if (isNaN(args[i])) {break}; //stop when they declare weapon/armor
            actors.push(args[i]);
        } for (var i = 0; i < actors.length; i++) {args.shift()}
    }
    //setup weapons and armors arrays
    for (var i = 0; i < args.length; i++) {
        if (isNaN(args[i])) {phase = args[i]} else {
            eval(phase + "s" + ".push($data"+ phase.charAt(0).toUpperCase() + phase.slice(1) + "s" + "[" + args[i] + "])")
        }
    }

    for (var i = 0; i < actors.length; i++) { //for every person
        var has = false;
        for (var w = 0; w < weapons.length; w++) { //check weapons
            has = $gameActors.actor(actors[i]).hasWeapon(weapons[w]);
        } if (has) { //we got it, stop checking now
            Check._whoHad = actors[i]; //save who had it
            return true}
        for (var a = 0; a < armors.length; a++) { //check armors
            has = $gameActors.actor(actors[i]).hasArmor(armors[a]);
        } if (has) { //we got it, stop checking now
            Check._whoHad = actors[i]; //save who had it
            return true}
    }
    //we checked everyone already, and nobody had it
    Check._whoHad = 0;
    return false;
};
"Check.equipped" works well.
 

ovate

tale
Veteran
Joined
Dec 16, 2016
Messages
917
Reaction score
1,552
First Language
English
Primarily Uses
N/A
Code:
Check.any_equipped(1, "armor", 6, 1, 2, 9, 10, 11)
Possible reason why it might not work was probably due to using armor id that's not created in the database yet.
If maximum is 10 then 11 is null in the script. (from what I tried) You did get it to work by using a different script call.
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
44,200
Reaction score
15,547
First Language
English
Primarily Uses
RMMV
<removed>

okay - I haven't seen that in a plugin before. Will need to take a bit more time to look at it before I understand how it's processing arguments that aren't even passed.

Edit: according to the description, Check.equipped() and Check.any_equipped() both do the same thing. If Check.equipped() works, why not just use that?
 
Last edited:

Latest Threads

Latest Posts

Latest Profile Posts

since all my maps are hand drawn... I admit, I super envy those who can make the tileset's work. I'm garbage at mapping, but slightly less bad at just drawing my own areas. plus it's easier to draw my own sprites than edit others to look like my characters.
Guys, I made a trailer! And, I also launched the Steam page! If you would like to support the game, please Wishlist it :ahappy: ->
working on some tilesets _ノ乙(、ン、)_

CIBl8xT.png


Oq8WKHX.png
aww man, color hex code #C4C4C4 doesn't work for the tint value in this scene I need something darker, which stinks just because I liked that one it was my favorite plastic explosive three times...#696969 (nice) should work better (WHY IS MY BRAIN LIKE THIS)
Tell it to me straight, doc. If I've been trying to piece together a "shorter" game to learn stuff outside of game jams... am I just running away from my WIP? :v

Forum statistics

Threads
117,284
Messages
1,106,139
Members
153,471
Latest member
Minedude209
Top