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

mistFAWKES

Veteran
Veteran
Joined
Feb 8, 2016
Messages
50
Reaction score
13
First Language
elngish
Primarily Uses
N/A
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?
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
AFAIK it is still gainItem, but instead of $dataItems as a parameter, you put $dataArmors or $dataWeapons


so it will be


.gainItem($dataArmors[ID],amount)
 

mistFAWKES

Veteran
Veteran
Joined
Feb 8, 2016
Messages
50
Reaction score
13
First Language
elngish
Primarily Uses
N/A
Works! Thanks so much. Was about to call it for the night, i suppose I'll keep working now :D
 

mistFAWKES

Veteran
Veteran
Joined
Feb 8, 2016
Messages
50
Reaction score
13
First Language
elngish
Primarily Uses
N/A
In case someone finds this in a google search in the future, the correct commands to give an item/weapon/armor based on a stored variable are:


$gameParty.gainItem($dataItems[$gameVariables.value(ID)], amount);


$gameParty.gainItem($dataWeapons[$gameVariables.value(ID)], amount);


$gameParty.gainItem($dataArmors[$gameVariables.value(ID)], amount);


Have fun not doing those loot tables manually ;)
 
Last edited by a moderator:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

On my journey of character rework: I had this character, she was meant to be just a princess that joins your party. And at long term she was just uninteresting... So I tweaked her to be a rebel agaisn't the royalty before meeting up with the party.

Quick tip for any other ametuer pixel artists! When trying to create a colour palette, enabling Antialiasing can speed up the process of creating different shades! Just place your lightest colour and your darkest colour next to each other, select both pixels, and stretch it out!
Revolutionizing the JRPG Industry: Knocking on Doors.

Take that, murderhobos.
Don't forget, aspiring writers: Personality isn't what your characters do, it is WHY they do it.

Forum statistics

Threads
106,054
Messages
1,018,578
Members
137,843
Latest member
Betwixt000
Top