The RPG Maker Resource Kit

RMRK RPG Maker Creation => RPG Maker General => General Scripting => Topic started by: Arkhan on January 24, 2007, 09:20:41 AM

Title: Putting a maximum on the number of items
Post by: Arkhan on January 24, 2007, 09:20:41 AM
Is there a way to limit the maximum amount of a certain item you can have?

Also, is there a way to make an item stay with you even when you have zero of it? E.g. a container of water. Whenever you get water, the number of containers increases, representing hte amount of water it holds increasing. But when you run out of water, the water container still remains there.

The first question is more important than the second.

First post, woot.

~Arkhan
Title: Re: Putting a maximum on the number of items
Post by: Wafflekid on January 24, 2007, 12:37:03 PM
With the water thing, let's say you fill the bucket up at a fountain. Then you would make an event that when you click on the fountain, your items change. It would take away one emtpty bucket, but give you one full bucket. To make it seem as it's the same item when it's really too different items.
(https://rmrk.net/proxy.php?request=http%3A%2F%2Fimg178.imageshack.us%2Fimg178%2F9350%2Fbucket5bq.png&hash=51a23a8842e96e997b2be63dcad91c04987a5466)
I also added a sound in that sounds like water rushing into the bucket as well as a message that says something like, "You have filled your bucket up with water"


*Sorry, I misspelled some things in my little picture, I was rushing!
Title: Re: Putting a maximum on the number of items
Post by: italianstal1ion on January 24, 2007, 09:42:31 PM
also note the MAXIMUM amount of items you can have is in the script editor:
In Game_Party  this line here
@items[item_id] = [[item_number(item_id) + n, 0].max, 99].min

Change the "99" to whatever you want. If you look further down in the editor you'll see the limits of armors and weapons too.
Title: Re: Putting a maximum on the number of items
Post by: Taylor on January 24, 2007, 10:34:48 PM
To continue what italianstal1ion said- check Scene_Shop too. Otherwise you'll be able to still buy 99 of items but the overflow from the Game_Party maximum will disapear.

Hmm... this makes me think that maybe I could limit normal items to 25 while weapons only 5.