Smeers
|
  |
| Joined: 14 Feb 2013 |
| Total Posts: 797 |
|
|
| 24 Dec 2015 11:52 AM |
I'm pretty new to any type of generation, so I'd like to start simple.
In this case, a mine.
I have a decent knowing of scripting, I am no master, but I don't know really how to make a randomly generated mine like seen in games like Epic Mining 2. I could easily handle the actual mining part, like mining the object or ore, but I can't randomly generate the parts.
I've tried to get help before but all I was told was 'use math.seed' so I was very confused and such...
Any help would be appreciated. (even a freemodel that I can analyze, learn, and take apart.) |
|
|
| Report Abuse |
|
|
|
| 24 Dec 2015 11:54 AM |
| Well, if it confused you, you need to take a few steps back before you even think about scripting that. Take a look at this. http://wiki.roblox.com/index.php?title=Absolute_beginner%27s_guide_to_scripting |
|
|
| Report Abuse |
|
|
Daftcube
|
  |
| Joined: 10 Jan 2010 |
| Total Posts: 275 |
|
|
| 24 Dec 2015 11:59 AM |
What you want to do is Procedural Generation.
I've done quite a bit of this. If you want to private message me about this, I'd be happy to help. |
|
|
| Report Abuse |
|
|
Smeers
|
  |
| Joined: 14 Feb 2013 |
| Total Posts: 797 |
|
|
| 24 Dec 2015 12:00 PM |
I was only confused because the only thing the person said was 'use math.seed', that was legitimately the only thing he replied with. I asked for further help and never got a reply back.
What would I even do with math.seed? That's all I was told. |
|
|
| Report Abuse |
|
|
KapKing47
|
  |
| Joined: 09 Sep 2012 |
| Total Posts: 5522 |
|
|
| 24 Dec 2015 12:11 PM |
local materials = {} local list = { Iron = 75; Gold = 5; Silver = 20; } for i, v in next, list do for j = 1, v do materials[#materials + 1] = i end end
for x = 0, XLimit do for y = 0, YLimit do for z = 0, ZLimit do --Create block that represents material --In whatever way u want, just use materials[math.random(#materials)] to choose a random material, the chances that are set will work end end end
"My Life is going Good... but..." |
|
|
| Report Abuse |
|
|
Daftcube
|
  |
| Joined: 10 Jan 2010 |
| Total Posts: 275 |
|
|
| 24 Dec 2015 12:23 PM |
About Math.Seed...
This is going to sound very backwards, but the random numbers from random number generation are not truly random! If you continue to pull numbers from math.random, you with eventually get similar and/or repeating numbers. This is because computers are too logical to make truly random numbers.
The random numbers are generated using an algorithm with an input parameter, 'seed.' The seed is a number used to scramble and generate random numbers. That means, a seed of 1 will give a certain order of random numbers while a seed of 2 will give a different order.
Hope I was of use. |
|
|
| Report Abuse |
|
|