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,196
Reaction score
15,545
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,196
Reaction score
15,545
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,196
Reaction score
15,545
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,196
Reaction score
15,545
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 Profile Posts

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
Well, I've got a party tomorrow, and my friends are coming over. I wanted to work a bit on the Fandom Scouts assets so I can be ready when that update arrives... in other news, Pizza Time Horror is getting a second teaser, and it shows Cabaret Helen's last performance before the location closed.
Also who used to be scared of Chuck E as a kid? I was! Now I love him!
The new cards and what they do:

(I am clearly not a youtuber... Haha)
Just for the record you CAN use the "Exclude unused files" successfully to trim a project down seriously even if you're doing calls to various assets via plugins and such. BUT you need to do a full playtest of pretty much every option to ensure you did get every one of those other assets added in. Then I dumped the assets into a fresh copy of the project and yay it was like 400 Meg......

Forum statistics

Threads
117,270
Messages
1,106,001
Members
153,446
Latest member
AstralCola
Top