Random Mining Spots

Where do I begin.

This is the concept: I want a player to be able to walk into a cave and have random mining spots appear. I already know I'm going to have to work with variables and switches, the problem I have is I have no idea how to get it to work the way I want. When I've done test experiments with very small variables (1-5), every single mining spot showed up for any given variable.

Lets say I dotted 10 events around the cave and created a variable dependency "If Var <=2 then X" "If Var >=3 then Y" and each of the 10 spots also has a second variable for "special" mining spots, "if Var == 10 and (the other) Var == (Whatever) then Z"

So ideally what I want is quasi-procedural mining points generated by an RNG, that's.... not what seems to be happening. I get ALL the mining points instead of the 3-4 per map reset that I want.

I don't even know how to ask for help on this because I don't know what the problem seems to be, but any insights you could provide into creating a good random distribution of mining points with an RNG would be fan-tittly-tastic <3

*edit*
If this is the wrong subforum, I apologize, the description seemed most related to the question.
i would create an event for every possible mining spot. then, as the player enters the cave, have it set a random number variable between, say, 1 and 5. when it's 1, X number of mining spots appear (set the event condition to variable 'random number' =1) and the same for the other numbers. you can have as many random numbers as u want and only a set number of spots (events) will appear each time the player enters the cave.
A screenshot of one or two of your events will help. Where are you putting these variable dependencies? If it's in the built in field on the left, they may all appear because it operates as "this number or any higher number".

There's multiple ways of solving this particular problem. I like to keep everything centralized into a single autorun or parallel process that turns on every time you enter the map. If it were me, I would make it so all of the mines are active by default. In the autorun I would then eliminate them via random number.

- Variable[1] Random 0 ~ 5 (or whatever numbers you want)
- Conditional Branch: Variable[1] >= 3
- script call:
$game_map.events[2].erase (repace 2 with whichever mining node you want to erase)​
- end Conditional Branch


no need for an else option.

and repeat the above per each one. If you're more advanced you can do the above in a loop with a second variable acting as an iterator. If you're even more advanced, you can do the whole of above via script call.

edit: here's a screenshot of the autorun if that was all that it did. Keep in mind that if you save on this map, it will reload the mines again at random depending on how you set them up.

mining_nodes.PNG


Edit 2: messed up the script call method. It should be "for I in 0..4" if were doing events 2 through 6. I didn't actually test these out ;x

Original thread: https://forums.rpgmakerweb.com/threads/random-mining-spots.95438/