[SCRIPT] – Simplified Item Randomizer

Author Topic: [SCRIPT] – Simplified Item Randomizer  (Read 3403 times)




A script that randomizes weapons based on what appear on colored scripted bricks.

For instance, have a brick named "Randomizer Brick" that you color differently for each category that you want.  Then, you have an output event that calls for a random item of that color.

So, say you have two randomizer bricks that are orange and two that are cyan.  One orange brick is Gun, and the other is Guns Akimbo.  One cyan brick is Rocket Launcher and the other is Horse Ray.  Now you get into events.

So it's as simple as this:
onMinigameSpawn >> Player >> addRandomItem [color]

And when we apply it to our example:
onMinigameSpawn >> Player >> addRandomItem
onMinigameSpawn >> Player >> addRandomItem

And they then get two items, on from the orange list and one from the cyan list, with the orange group item in the first slot available an the cyan group item in the next.

Based on the color selected in the event, it will choose from among the randomizer bricks of that color.



Other features might include having different bricks for different rarities.

And it would probably be best to have the bricks be simple 2xs[/size]
« Last Edit: June 16, 2016, 11:23:33 AM by SWAT One »

boy oh boy oh yes boy

I'll start working on it today.

It'd probably be better to just have an admin only 2x2f randomizer brick. It'd make things simpler.

Other features might include having different bricks for different rarities.

And it would probably be best to have the bricks be simple 2xs

I think naming the bricks is fine, because you could use brick volume to control rarity.

Should it be brick type, quantity, size, or something in the brick name, to control rarity?

What I was thinking is a 2x2 brick that you put the items on.  Since the idea would be that you put them in a room away from the featured map, perhaps when they are planted and get a shapename of "Rarity: 1 (Ubiquitous)" (1 being ubiquitous, 5 being very rare), and you use an admin only randomizer rarity tool (alliteration: Randomizer Rarity Wrench), probably an orange recolored wrench or something to decide its rarity.

Perhaps you just click the brick and it says
"\c6Press a number \c31\c6–\c30 to set the rarity for \c3<ui name>\c6."
Quote from: Quote preview because the background turned out white this time
Press a number 10 to set the rarity for <ui name>.

1 (Ubiquitous)
2 (Common)
3 (Uncommon)
4 (Rare)
5 (Very Rare)

What do you think?  Is this a good solution on the user end?

Ok. Will do. It'll have to add a fake event onto the brick though. So that the rarity gets saved along with the build.
I'll add a command to set the category name for each color too.


Anyone have a better idea for names for rarities?

$AddRandomItem::Rarity0 = "Ubiquitous";
$AddRandomItem::Rarity1 = "Very Common";
$AddRandomItem::Rarity2 = "Common";
$AddRandomItem::Rarity3 = "Uncommon";
$AddRandomItem::Rarity4 = "Very Uncommon";
$AddRandomItem::Rarity5 = "Rare";
$AddRandomItem::Rarity6 = "Very Rare";
$AddRandomItem::Rarity7 = "Epic";
$AddRandomItem::Rarity8 = "Very Epic";
$AddRandomItem::Rarity9 = "Legendary";

What about...

$AddRandomItem::Rarity0 = "Ubiquitous";
$AddRandomItem::Rarity1 = "Familiar";
$AddRandomItem::Rarity2 = "Common";
$AddRandomItem::Rarity3 = "Usual";
$AddRandomItem::Rarity4 = "Unusual";
$AddRandomItem::Rarity5 = "Uncommon";
$AddRandomItem::Rarity6 = "Rare";
$AddRandomItem::Rarity7 = "Very Rare";
$AddRandomItem::Rarity8 = "Epic";
$AddRandomItem::Rarity9 = "Legendary";

... and additionally another for not spawning an item at all for on-the-fly tests named "Nonexistant."

... and additionally another for not spawning an item at all for on-the-fly tests named "Nonexistant."
What do you mean? Why?

I guess it doesn't matter, actually.  You could just paint the brick a different color that isn't used in the events.

That would be cool (Bump because I don't want this topic to die)

That would be cool (Bump because I don't want this topic to die)
Would be kind of hard for it to die. It's almost finished.

This is how I did the rarity system for RandomizerDM
$RDM::Rarity[0] = "Common" TAB "0 60";
$RDM::Rarity[1] = "Uncommon" TAB "61 78";
$RDM::Rarity[2] = "Rare" TAB "79 88";
$RDM::Rarity[3] = "Elite" TAB "89 96";
$RDM::Rarity[4] = "Legendary" TAB "97 99";
$RDM::Rarity[5] = "Impossible" TAB "100 100";
$RDM::RarityCount = 6;
$RDM::MaxRarity = 100;