RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
Tutorial: Simple Random Item Placement

0 Members and 1 Guest are viewing this topic.

**
Rep: +0/-0Level 85
I thought this up while building the interior to a restraunt.  I tried it and it works.

All that's needed is:
1 Variable
An Event on the screen that you are doing this to

Okay, on the door that leads to the area, you need it to set a variable.  Like:
Control Variable:  [Restraunt Randomizer] = Random No. [1...3] (This can be 1 to however many random combinations you want)

Now, the people and objects INSIDE.

Create an event.  Place it on the right side of a table.  Trigger should be Variable Restraunt Randomizer = to 1.
The sprite is an Old Lady.  She says "I really hate Tomato Soup..."
Add a page to this event.  This page also has a Trigger.  Restraunt Randomizer = to 3.
This time the Sprite is a Little Boy.  He says "The food here is WAY better than at home!"
Add pages until you get all your Restraunt Randomizer numbers.

Create ANOTHER event.  This time it's in the LEFT side of the table.  Trigger should be Variable Restraunt Randomizer = to 1.
The sprite is an Old Man.  He says "Tomatoes are good for the Heart.  I don't see why my wife hates them so."
Add a page to this event.  This page also has a Trigger.  Restraunt Randomizer = to 2.
This sprite is a Young Man.  He says "I'll just drink my worries away...
Add ANOTHER page.  You guessed it.  Trigger is Restraunt Randomizer = to 3.
This time the Sprite is a Young Woman.  She says "My son has no appreciation for the time I spend cooking."
Add pages until you get all your Restraunt Randomizer numbers.

Create yet ANOTHER event.  It should be ON the Table this time.  Trigger should be Variable Restraunt Randomizer = to 1.
The sprite is a Pot. 
Add a page to this event.  This page also has a Trigger.  Restraunt Randomizer = to 2.
This sprite is a Salad.
Add ANOTHER page.  You guessed it.  Trigger is Restraunt Randomizer = to 3.
This time the Sprite is a Bottle of Wine.
Add pages until you get all your Restraunt Randomizer numbers.

So, the result:

Upon entry of the map, say it sets it to 1.  There's an Old Lady near a table, at the other side of the table is an Old Man.  On top of the table is a pot.
Upon entry of the map next time, it sets it to 3.  There's a Little Boy near a table, a Young Woman on the other side, and a salad on the table.
Upon entry of the map next time, it sets it to 2.  There's No one at one side of the table, and a Young Man at the other.  There's a bottle of Wine on the table.

I'm sure you can find many ways to use this.  The best thing is, this Variable is reusable!  You can use the same variable on MANY maps.  Now some of your places won't look the same EVERYTIME!  Just a simple way to add a little variety to your game!

I hope this helps you all!  ^^

***
Rep:
Level 85
nice, but in your example their is one wrong thing: the kid drinks wine :P


***
Rep:
Level 85

**
Rep:
Level 85
Destiny's Corpse
lol sok, for me it's super early in the morning, I just can't sleep, and when I read it through I thought the kid hated tomato vodka.

*****
Rep:
Level 88
Nice tutorial. I think I'll use this some. It's something I wouldn't have thought of. ;)

Oh and you did make the kid be a drinker. You set the kid and the mother to 3 and the bottle of wine to 3 as well. The young man will be drinking a salad. ;)

Still, a nice tutorial.

**
Rep:
Level 87
RIP w-hat the fork
I must say, the idea to have random events in a place is very unique, I haven't seen something similar posted anywhere.
I have an addition you might like:
Set the events X and Y coords randomly as well, however this might cause some unwanted occurrences like spawning the event inside a table...
But still possible.
I'll bet I could come up with an algorithm to fix it though.
Detect the events terrain tag or something...
Then +1 everytime it lands on that tag.
And when it reaches the max X, then change it to 0, and continue detecting.
Repeat with Y.
I think I shall go see if I can do this...
Huge sig is huuuuge.