The RPG Maker Resource Kit

RMRK RPG Maker Creation => RPG Maker General => General Scripting => Topic started by: Kularian on March 10, 2012, 06:43:57 AM

Title: [XP] Scripting Question (Resolved)
Post by: Kularian on March 10, 2012, 06:43:57 AM
Okay, I'm using XP, and there doesn't yet seem to be a limited, personal inventory per character script thingy out yet.  No big deal.  I'm a novice scripter, so I was messing around in the Game_Party Script, and I meandered down to line 179, which is~

@items[item_id] = [[item_number(item_id) + n, 0].max, 99].min

I changed that 99 there to 8, as there will be 8 main characters.  It's not quite a personal inventory, but close enough for government work. 

My question is, in regards to that 99 there, is there some kind of variable I can call in the script to set that number to the number of characters in the party?  i.e. When I have 4 characters in the party, I can have a max of 4 of each item, and 6 characters gives me 6 items, etc etc.  If not, I'll probably find some happy medium at 4 or 6, ala Secret of Mana/Evermore. 

Thanks!
Title: Re: [XP] Scripting Question
Post by: pacdiggity on March 10, 2012, 06:55:40 AM
I don't have XP, but there'll be a variable or method in Game_Party that gives the current members of the party. You'll need to identify this method (it's probably just 'members' or something), and use it in this context:
@items[item_id] = [[item_number(item_id) + n, 0].max, members.size].min
Title: Re: [XP] Scripting Question
Post by: Kularian on March 10, 2012, 07:04:11 AM
Ah-ha.  The method is actors, and it worked like a charm.  Thankee Pac!