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
911
Reaction score
1,550
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,160
Reaction score
15,541
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,160
Reaction score
15,541
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,160
Reaction score
15,541
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
911
Reaction score
1,550
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,160
Reaction score
15,541
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

I think it's ready - Chapter Selection:
unknown.png
On another more gaming topic, I paid 20 bucks for a visual novel to emotionally destroy me. I may write an entry about that.
1638611395177.png
Reading about metaverses recently. I can totally imagine myself in the future, logging in with VR glasses to a virtual beach villa sitting in a virtual chair, with a virtual laptop facing the sea...coding 16-bit RM.
Mod name: "[Game name] Gameplay Overhaul"
What they actually mean: "Here is a mod that makes the game harder."
I decided to reinstall one of my most favourite game of all times, Gothic 2. Time to get back to Khorinis!

Forum statistics

Threads
117,174
Messages
1,105,152
Members
153,283
Latest member
Ianarts
Top