Ideas for the “Select Item” Command – RPG Maker MV Tutorial

Here is the code I used in the video:

Remove Selected Item (Trade for Gears demo):
$gameParty.loseItem($dataItems[$gameVariables.value(6)], 1);


Card Game:
Four of Clubs: <card_value: 4>
Could do <card_suit: 2>


Number($dataItems[$gameVariables.value(14)].meta.card_value) > $gameVariables.value(13)

Since this was mostly about why you use the Select Item command, I didn’t try too hard with the actual coding. But thinking about it more, here is some better code for the card game. This will randomly give the girl an actual card item, and use the value from that. So she can play a King with a value of 13, for instance. This is still a very simple and boring game, but maybe it will give you some ideas.

Variable 12 is her card value
Variable 13 is her card item ID

Then in her event:

Set variable 13 to random number 15 – 22 (or whatever your card items are). Then you use the next script call to grab the value of the card and set it to v#12.

$gameVariables.setValue(12, Number($dataItems[$gameVariables.value(13)].meta.card_value))

SHOW TEXT (this will display the name of her card–uses Yanfly Message Core plug-in):

She played a \ni[\v[13]].

Number($dataItems[$gameVariables.value(14)].meta.card_value) > $gameVariables.value(12)

Here is a screenshot in case that’s confusing:

select-item-card-game-advanced