The RPG Maker Resource Kit

RMRK RPG Maker Creation => RPG Maker General => General Scripting => Topic started by: GhstHawk on April 01, 2007, 09:02:41 PM

Title: Random Items [resolved]
Post by: GhstHawk on April 01, 2007, 09:02:41 PM
I'm working on a game in which items are made from boiling herbs found in the environment.

Is it possible to make a script which allows you to randomly find items on the ground? Like 1 out of 2-3 maps you find a item lying on the ground and you walk up to it and pick it up. I'd need it to also to only have certain items allowed to be found, and maybe to perform a check whether the map is bigger than 20x15 (my standard inside building size) before it creates the item.
Title: Re: Random Items
Post by: Halestorm5 on April 01, 2007, 09:04:33 PM
Just make events player touch and make the events move quick as hell away from the character. I think thatll work.
Title: Re: Random Items
Post by: modern algebra on April 01, 2007, 09:20:43 PM
It's possible with events. It requires variables. Basically all you have to do is have a paralell process event in the maps where you want it to be possible, and you want this paralell process to randomize a variable. Then, you give it whatever chance you want this item to appear on the map. If it is, then you just make it appear and become an option. Here is a demo. In order to demonstrate the pseudo randomness I only gave it a 1/6 probability that it won't appear, but it's easy to increase randomness or decrease it.


Title: Re: Random Items
Post by: GhstHawk on April 01, 2007, 10:13:51 PM
I was hoping to avoid events to make it less tedious, but I actually didn't think of having a parallel process to create the variables. I think I'm going to use Common events also to make it quicker.
Thank you.