The RPG Maker Resource Kit

RMRK RPG Maker Creation => Requests => Script Request => Topic started by: epson777341 on June 19, 2009, 03:05:01 AM

Title: Pulling a Recipe out of a Hat...
Post by: epson777341 on June 19, 2009, 03:05:01 AM
So, I'm using Cmpsr2000's Crafting system, I was wondering If anyone knows if it's possible to randomize the recipe received. I was thinking of maybe, like, tying a variable to the recipe learnt value, then randomizing the variable, but, then I realized that I absolutely suck at scripting, So my attention turned  towards asking you guys for help, I looked here for the solution, but, I couldn't find it.

Any Ideas?
Title: Re: Pulling a Recipe out of a Hat...
Post by: Grafikal on June 19, 2009, 03:08:50 AM
I don't recall how you use recipes in the script, but you could just event it. If a recipe is an actual item then just randomize the items you get that are recipes or if you call script just randomize which call script is used to learn a recipe. etc.
Title: Re: Pulling a Recipe out of a Hat...
Post by: epson777341 on June 19, 2009, 03:39:50 AM
Well, yeah, that was the other option,

"If Variable: Random = 7
    Then
         Teach this one
     else
If Variable: Random = 8
     then
         teach this one
     else
...
"
Gets really really old, especially since I have like, 381 Recipes.
Title: Re: Pulling a Recipe out of a Hat...
Post by: modern algebra on June 19, 2009, 04:00:28 PM
By teach this one, is that a call script command? Or giving an item? Because if it is a call script that you have to pass an ID for, all you would need is to replace the ID with $game_variables[random_variable_id]

or even just rand (381)
Title: [RESOLVED] Pulling a Recipe out of a Hat...
Post by: epson777341 on June 21, 2009, 03:30:30 PM
Thanks! That helped a lot, I understand now.  It was through the scripting.