MV Need script call for "If : Party has [item ID]"

Hello.

The title pretty much says it all, but I'm going to be using a variable to refer to the item ID (e.g. 77), and I thought that part might look something like:

$dataItems[$gameVariables.value(77)]

But I'm not sure.

EDIT: Or maybe something like "If : Script : $gameParty.hasItem(77)" ???
if you have the conditional++ , you can easy if the party has or actor has the item.
would be way easier that way, so you dont have to get nesting or long scriptcalls.
if you have the conditional++ , you can easy if the party has or actor has the item.
would be way easier that way, so you dont have to get nesting or long scriptcalls.

Thanks, but I'm going to be referring to the item ID with $gameVariables.value(NUMBER), so it has to be a script call. I mean, I could probably use "If : Script : (some script call)" as opposed to making the entire thing a script call, but I can't figure out how to do either.
I'm not 100% sure as I don't use RPGMV but there is a list of Script Calls. The thread's made by Archeia.


Though, there is another way that doesn't involve script calls. Lol.

You can go to Control Variable - Whatever Variable ID - Game Data - Item

And then you can use Conditional Branch using whatever numbers you desire. If you want, I can show you?
I'm not 100% sure as I don't use RPGMV but there is a list of Script Calls. The thread's made by Archeia.


Though, there is another way that doesn't involve script calls. Lol.

You can go to Control Variable - Whatever Variable ID - Game Data - Item

And then you can use Conditional Branch using whatever numbers you desire. If you want, I can show you?

Yeah, I use the script call list regularly, but it's missing a lot. For example, for conditionals it simply has "if (code) {stuff} else {stuff}" and that's it, haha.

As for the second part (setting a variable to an item ID), that part I already have. The problem is that—now that I have a variable set to the item ID—how do I use a condition to check to see if the item (that that variable's value is set to) is in the inventory?
Code:
$gameParty.hasItem($dataItems[ITEM_ID])
is the Code you need 🙂

If you don't know how to get the id from the variable, it's this code
Code:
$gameParty.hasItem($dataItems[$gameVariables.value(VARIABLE_ID)])
Code:
$gameParty.hasItem($dataItems[ITEM_ID])
is the Code you need 🙂

If you don't know how to get the id from the variable, it's this code
Code:
$gameParty.hasItem($dataItems[$gameVariables.value(VARIABLE_ID)])

Ahhh, $dataItems, there it is. Thank you, thank you, thank you!

Original thread: https://forums.rpgmakerweb.com/threads/need-script-call-for-if-party-has-item-id.132920/