The RPG Maker Resource Kit

RMRK RPG Maker Creation => RPG Maker General => General Tutorials and Eventing => Topic started by: JFloyd on April 03, 2007, 02:23:07 AM

Title: (request) Randomness ensues
Post by: JFloyd on April 03, 2007, 02:23:07 AM
How would I make something like say a bush, that you walk up to, and it asks if you want to forage, and you can get 5-10 berries, and 5 different kinds.
How would I do that.
Title: Re: (request) Randomness ensues
Post by: modern algebra on April 03, 2007, 02:26:57 AM
Use variables. They have an option where you can randomize a number between two bounds. In your case, you would use two variables. The first one would choose between 1 and 5 and then based on those numbers, you would assign what type of berry you find. Then you could reandomize another number between 5 and 10 to determine how many berries you get.

There are a few tuts on variables out there. Look them up. You won't regret it.

EDIT:
Your event would look like this. It would be action key activated with an empty second page (conditioned on Self-Switch A)


Text: Would you like to Forage?
Show Choices (yes, no)
When [yes]
    Control Variables: [001: Berries 1] Random (0, 4)
    Control Variables: [002: Berries 2] Random(5, 10)
    Conditional Branch: Variable [001: Berries 1] = 0
        Change Items: [Red Berries] + Variable [002: Berries 2]
    Branch END
    Conditional Branch: Variable [001: Berries 1] = 1
         Change Items: [Blue Berries] + Variable [002: Berries 2]
    Branch END
    Conditional Branch: Variable [001: Berries 1] = 2
         Change Items: [Black Berries] + Variable [002: Berries 2]
    Branch END
    Conditional Branch: Variable [001: Berries 1] = 3
        Change Items: [Purple Berries] + Variable [002: Berries 2]
    Branch END
    Conditional Branch: Variable [001: Berries 1] = 4
        Change Items: [Orange Berries] + Variable [002: Berries 2]
    Branch END
    Control Self Switch [A] ON
When [no]
    Text: Come back later
Branch END
Title: Re: (request) Randomness ensues
Post by: JFloyd on April 04, 2007, 02:55:57 AM
I have pk so things look different, i get the concept, but ive never used variables...
Title: Re: (request) Randomness ensues
Post by: modern algebra on April 04, 2007, 02:59:39 AM
Two tutorials. One by me, one by Yami. Variables are incredibly useful. Learn to use them or else your first born child will be afflicted with a random, but life-threatening, disease.

http://rmrk.net/index.php/topic,11826.0.html (http://rmrk.net/index.php/topic,11826.0.html)
http://rmrk.net/index.php/topic,14157.0.html (http://rmrk.net/index.php/topic,14157.0.html)
Title: Re: (request) Randomness ensues
Post by: JFloyd on April 04, 2007, 08:18:42 PM
Ok.....variables isnt helping.....
I had it set to random 5/10 and i only got 1 berry....
I cant get the hang of them
Title: Re: (request) Randomness ensues
Post by: modern algebra on April 04, 2007, 08:21:55 PM
you probably added the wrong variable i'd think. See if that's the problem. If not, I'll post a demo
Title: Re: (request) Randomness ensues
Post by: JFloyd on April 04, 2007, 08:25:07 PM
Could I pm my game to you?
It'll have what i did in it.
Title: Re: (request) Randomness ensues
Post by: modern algebra on April 04, 2007, 08:27:18 PM
sure  :D
Title: Re: (request) Randomness ensues
Post by: JFloyd on April 04, 2007, 08:42:44 PM
Dont feel like using an upload site...
Title: Re: (request) Randomness ensues
Post by: modern algebra on April 04, 2007, 08:46:31 PM
I'll get it when I am back home. Expect it back in about an hour.