Topic category: Help with MCreator software
In mods such as Roguelike Dungeons, there are structures which would spawn on the surface and have a staircase somewhere in them which would lead down to a dungeon, how could I go about doing this? I've followed tutorials and learned the basics of creating / spawning in structures for dungeons but I'm just wondering how I could make it so there would be a structure on the ground surface (i.e a house or a tower or something) which would be able to lead to a dungeon in the underground.
Also, I'd like to know how to make dungeons themselves connected, I want to have rooms that are empty, some have a mob spawner, and some have a chest. How would I go about implementing this so that way there is a mix of empty rooms and rooms w/ things in them? (aka a normal dungeon in basically any game) Thanks for your time.
Dungeons tutorial: https://www.youtube.com/watch?v=2sfqLgUR2Tw
Thank you i've watched that video already. I understand that the procedure generates 3 rooms, how would I go about making it so that 2 of the rooms are significantly more likely than the 3rd? My goal is to make it so 2 of the rooms are just rooms while another is a room with a chest, but I don't want the chest room to be as common as the blank rooms, but I still want to make sure that each dungeon has at least 1 everytime it generates.
So in the If statement, with 3 options:
So this would give every room a 33% chance. You can simply change the proportions to make certain rooms more rare:
Which would give the first one a 6% chance, and the other 2 a 47% chance. etc.
Thanks for telling me that, but if the statement is
if Rand < 0.33
else if Rand < 0.67
else
Then what is the and this gives each room a 33% chance, then what is the "else if Rand < 0.67" assigned to? Like where is that 0.67 going?
Sorry i meant and this gives each room a 33% chance, then what is the "else if Rand < 0.67" assigned to? Like where is that 0.67 going?
If you divide 1 by 3 (3 because we have 3 options), you will get 0.3333333 (infinitely)
simply for each test, check for that amount + 1* that amount:
In case of 3 options: (Everything having a 1/3rd of a chance)
In case of 5 things: (Everything having a 20% chance)
Since random is a number between 0 and 1, we know that the number isn't 0.33 or below if we get to the 0.67 else if statement. At this point we check whether random was between 0.33 and 0.67 which is 1 third of 1, thus a 33% chance.
I noticed in your procedure for 3 rooms in a dungeon, you only have 2 instances of "Get Local", by this i mean the code looks like
if Get Local: Rand < 0.33
do Place at x:
else if Get Local: Rand < 0.67
do Place at x:
else Place at x:
So if I wanted to have 4 rooms (with 1 being pretty rare compared to others since its a loot room) what would the code look like?
Let's say we want 1 special room to have a 7% chance of spawning. That means we subtract 0.06 from 1 = 0.93. The 0.93 we equally divide over the other 3 rooms, thus 0.93/3 = 0.31 for each other room. Thus:
*That means we subtract 0.06 = That means we subtract 0.07. Correction.
Thanks so much for your help and explaining why these things do what they do. Do you know how I could go about setting up an above ground structure with a staircase which would lead to a dungeon?
In the tutorial video about structures, you can see that the Y value is mostly left alone in section 1. You can use that y value to create both a staircase AND create vertical dungeons too.
Thanks for your help so far but I do have one question.
Why is it that in your original dungeon procedure, you have one structure attached to the if statement "Get Local Rand < 0.33" yet you have two set to else if "Get Local Rand < 0.67"?
If I want to add this separate chest room, would I need to create a new else if statement?
** So far my code looks like this:
if Get Local Rand < 0.31
do (place structure room1)
else if Get Local Rand < 0.62
do (room2)
else if Get Local Rand < 0.93
do (room3)
else (chestroom1)
Im trying to make the chestroom have a 7% chance of spawning, so is this correct?