hello everyone, I wanted to know if there is a plugin or how to make a system to get the game to give you 10 rendom item for example, as if were spin on a lucky wheel or something like that, I use RPG MAKER MV, thanks
Random Item
RPG Maker MV SupportYou can set a variable to randomly generate a number within a specified range, then give the player items & such based on conditional checks for that variable.
Like Animebyran says, a variable and some branches, e.g.
◆Control Variables:#0008 Temporary = Random 1..3
◆If:Temporary = 1
◆Change Items:Potion + 10
◆Text:None, Window, Bottom
: :You got 10x Potion!
◆
:Else
◆If:Temporary = 2
◆Change Items:Magic Water + 10
◆Text:None, Window, Bottom
: :You got 10x Magic Water!
◆
:Else
◆Change Items:Dispel Herb + 10
◆Text:None, Window, Bottom
: :You got 10x Dispel Herb!
◆
:End
◆
:EndYou can use something like this in a Script command:
Edit the numbers in the first line with the IDs of the Items. You'll need a slightly different approach to include Armors/Weapons.
JavaScript:
var ids = [1,2,3];
var id = ids[Math.randomInt(ids.length)];
var item = $dataItems[id];
$gameParty.gainItem(item, 10);
$gameMessage.add('You got 10x ' + item.name + '!');
i do this with eventing like @caethyril posted (cus im bad with script) but i change it a bit.
the issue i have with if variable = 1 give item A, if var = 2 give item B...
if have something like hi-potion and an elixir both in the list they have same chances even though 1 is clearly a better item.
so what i do is RNG 1~100
if variable > 70 give item A (30% chance to get this item (71~100))
else if variable > 50 give item B (20% chance (51-70))
else if v > 35 (15% chance) ect...
if you want it to be 10 different random items 1 at a time,
you just setup the event with a loop, have another variable and increase by 1 each time it gives an item, and have a condition check if that variable = 10 break loop.
the issue i have with if variable = 1 give item A, if var = 2 give item B...
if have something like hi-potion and an elixir both in the list they have same chances even though 1 is clearly a better item.
so what i do is RNG 1~100
if variable > 70 give item A (30% chance to get this item (71~100))
else if variable > 50 give item B (20% chance (51-70))
else if v > 35 (15% chance) ect...
if you want it to be 10 different random items 1 at a time,
you just setup the event with a loop, have another variable and increase by 1 each time it gives an item, and have a condition check if that variable = 10 break loop.
Original thread: https://forums.rpgmakerweb.com/threads/random-item.139645/