Indie Dev

Hello Guest!. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, sell your games, upload content, as well as connect with other members through your own private inbox!

Trouble giving Weapon/Armor/Item[<Variable X>]

polar_fawkes

Towns Guard
Hey all,

I've got a pretty simple question, scanned a few forums and couldn't find the answer. I've set up a system where an item/weapon/armor is stored in variable 101, and it's then passed back to a local event, which then uses that variable to know which item/weapon/armor to give the character.

i've set up a case handler to determine whether we're firing the give item, give weapon, and give armour command. the code i'm executing on giveItem is as follows:

$gameParty.gainItem($dataItems[$gameVariables.value(101)], 1);

now, this code works as intended. it looks up variable 101, goes, 'okay, V101 is 25, you want item 25', and gives it to you. but i can't find the equivalent commands for weapons and armors. here's my guesses:

$gameParty.gainArmor($dataArmors[$gameVariables.value(101)], 1);
$gameParty.gainWeapon($dataWeapons[$gameVariables.value(101)], 1);

they both don't work. throw error undefined and the console complains. does anyone know the correct commands for these two? thanks so much in advance
 

Zarsla

Villager
Xy$
0.00
For Wespons:
$gameParty.gainItem($dataWeapons[$gameVariables.value(101)], 1);

For Armors:
$gameParty.gainItem($dataArmors[$gameVariables.value(101)], 1);

You can learn the javascript commands for alot of the RPG Maker MV here.
 
Top