Control Variables including equipment

EDIT: I seemed to have explained myself terribly. Let me try to explain exactly what I'm trying to accomplish:

OK. So the event I'm trying to make happen isn't to check whether both items are in one's inventory, which I believe is easy enough; it's to trigger an event if they are not equipped or in inventory. Basic premise:


Character (no other party members) attempts to exit house. Upon touching the event, if the player has not found both Item A (An Amulet of Vigor, item #0007) and Item B (armor #003 Casual Clothes), I want a message box to appear saying "I should find x and y before leaving.", to force the player into staying until they are found. I managed to accomplish this using control variables checking if there are <1 of these items in one's inventory, which works perfectly, however it no longer works if the Player equips the Casual Clothes, since it's no longer technically in one's inventory. I'm asking how I might do a check on items not in one's inventory, equipped or otherwise. Again, here is a screenshot of what I had originally, which worked so long as the Casual Clothes were not equipped: http://i.imgur.com/Ic3alY2.png

i hope that clarifies things

---original post---

Hello everyone! I'm so, sorry if the answer to this is super obvious or written somewhere else, I just couldn't seem to find it. I have a very simple question -- I am trying to create an event wherein it check for two items to be either equipped or in one's inventory in order to proceed. I tried doing it the normal way first (a simple inv check) but I couldn't figure out how to make it work for more than one item. Then I tried using control variables to check whether the party had <1 of those items, which worked until I realized that for some reason it wasn't checking for equipped items, even though its listed as an armor and a key item respectively.. So now I'm a bit stuck, and I could really use a little help!

here's a screenie of what I got:

http://i.imgur.com/Ic3alY2.png


Edit: Hello, I'm sorry, but this is a Maker MV issue, not VX Ace -- sorry for not specifying! If the topic could be moved again I would super appreciate it.
 
I've moved this thread to VX Ace Support (this is not a discussion of a game mechanic). Please be sure to post your threads in the correct forum next time. Thank you.
I've moved this thread to VX Ace Support (this is not a discussion of a game mechanic). Please be sure to post your threads in the correct forum next time. Thank you.
I'm super sorry! I got incredibly confused, thinking this forum meant questions about game mechanics. Thank you for informing me, I'll be more careful in the future.
Moving to MV Support


In that case, someone else had this exact same question only within the last week or so. Have a good look through the MV Support and the JS Plugin Requests and Support forums - anything within the last week, and you should be able to find a good solution.


If you can't find it after searching, post back and I'll see if I can track it down. I just don't recall the person's name or the title of the thread. If you search for $gameParty that should help narrow it down.
Moving to MV Support

In that case, someone else had this exact same question only within the last week or so. Have a good look through the MV Support and the JS Plugin Requests and Support forums - anything within the last week, and you should be able to find a good solution.

If you can't find it after searching, post back and I'll see if I can track it down. I just don't recall the person's name or the title of the thread. If you search for $gameParty that should help narrow it down.
thank you again Shaz! Using that term I was able to find the topic (I think?), however, I'm a complete newb when it comes to this program (only been playing with it for few days, though I'm already in pretty deep lol) so translating the solution from that thread to make it work for my particular event is confusing to me. So if anyone could help me, I would appreciate it!

Basically, this seemed to work for the person in the other thread:

Control Variables: [001: Sword Count] = $gameParty.numItems($dataWeapons[8]) + $gameParty.members().filter(function(a) { return a.hasWeapon($dataWeapons[8]) }).lengthHowever, in my case, I'm looking for it to search for Casual Clothes (body armor, item number 0003, not sure how the ID system works). Please let me know if I'm missing any more additional information that could help narrow down what I need to do.
Okay, so you'd give your variable a different name (Casual Clothes Count), and change the two places where it says $dataWeapons[8] to say $dataArmors[3] instead.

Control Variables: [001: Casual Clothes Count] = $gameParty.numItems($dataArmors[3]) + $gameParty.members().filter(function(a) { return a.hasWeapon($dataArmors[3]) }).lengthThis will make variable 1 contain the total quantity of casual clothes your party has, either in inventory, or equipped.
If this is very early in the game (you only have one party member) you could also just do a series of conditional branches, to see if the items are in inventory, or if that single character has the items equipped.
I tried to input that script but it doesn't seem to work for me. Even assuming you mean Armor instead of Weapon toward the end there, either I get some sort of error or nothing happens. I could be putting this in the totally wrong spot, I dont 'know... >< but as I was trying to do this, I realized something

I seemed to have explained myself terribly. Let me try to explain exactly what I'm trying to accomplish:

OK. So the event I'm trying to make happen isn't to check whether both items are in one's inventory, which I believe is easy enough; it's to trigger an event if they are not equipped or in inventory. Basic premise:

Character (no other party members) attempts to exit house. Upon touching the event, if the player has not found both Item A (An Amulet of Vigor, item #0007) and Item B (armor #003 Casual Clothes), I want a message box to appear saying "I should find x and y before leaving.", to force the player into staying until they are found. I managed to accomplish this using control variables checking if there are <1 of these items in one's inventory, which works perfectly, however it no longer works if the Player equips the Casual Clothes, since it's no longer technically in one's inventory. I'm asking how I might do a check on items not in one's inventory, equipped or otherwise. Again, here is a screenshot of what I had originally, which worked so long as the Casual Clothes were not equipped: http://i.imgur.com/Ic3alY2.png

I hope that explains it much better, I'll update my first post.
You possibly entered it wrong. I would need to see a screenshot of the Control Variables command to see exactly what you had in there. You CAN do it by checking if BOTH items are in inventory (or equipped) - if the test returns false (or 0) then it means they don't have it.

However, for only one player, you don't need to go to that trouble. You can do it with conditional branches like this:

Code:
Conditional Branch: [Amulet of Vigor] in Inventory  Conditional Branch: [Casual Clothes] in Inventory    Transfer Player  Else    Conditional Branch: Actor 1 has [Casual Clothes] Equipped      Transfer Player    Else      Show Text: (need casual clothes)    Branch End  Branch EndElse  Show Text: (need amulet of vigor)Branch End
Couldn't you also do this by increasing a variable by 1 when each item is found, and not letting the player leave until the variable is 2? That way you don't have to worry about if the items are equipped or not.
You possibly entered it wrong. I would need to see a screenshot of the Control Variables command to see exactly what you had in there. You CAN do it by checking if BOTH items are in inventory (or equipped) - if the test returns false (or 0) then it means they don't have it.

However, for only one player, you don't need to go to that trouble. You can do it with conditional branches like this:

Conditional Branch: [Amulet of Vigor] in Inventory Conditional Branch: [Casual Clothes] in Inventory Transfer Player Else Conditional Branch: Actor 1 has [Casual Clothes] Equipped Transfer Player Else Show Text: (need casual clothes) Branch End Branch EndElse Show Text: (need amulet of vigor)Branch End
!! that worked perfectly! I didn't realize I could do that with just conditional branches, the Else's always confused me. I could have been further confused considering that I started doing research for this particular event while I was still using Ace VX (just before i switched) so I might have thought it was just something I couldn't do. Something I read somewhere about how both conditions couldnt both be true at the same time...I have no idea. So much confusion. Eitherway, this totally works, I consider the problem solved!

@bgillisp - hum! that sounds like an alternative I could have tried. I will keep this in mind to try out in case it suits my needs better for this event or another in the future 🙂

Original thread: https://forums.rpgmakerweb.com/threads/control-variables-including-equipment.55127/