Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Generating a Grid Map?!

Asked by
legosweat 334 Moderation Voter
8 years ago

Alright, so my question is, how would I be able to generate a map (grid) with 5x5 squares.

How would I be able to put rocks and trees on the terrain as it generate, mostly on the outer most of the grid.

Here's the plane grid: image link

Here's the Rock, and Tree: image link

I want it to do: image link

^ I want it to do that when it generates the grid.

There might be a algorithm for this, but I'm not sure.

I have no idea how to make start of this, so I don't have any code to present, sorry. I'm just looking for help! :)

0
Clash of clans? :P Prioxis 673 — 8y
0
^ Lol, yep. legosweat 334 — 8y

2 answers

Log in to vote
0
Answered by 8 years ago

I would suggest using the modeltoputongrid:MoveTo(gridbrickpositon) to position your rocks and trees onto the center of the grids. It should automatically move into the center, but you might need to add a bit on the Y axis so that your trees are flush with the ground (you will need to tweak this). Also, it might be useful to have all of your "grid bricks" in one model, so you can loop through them and generate trees or rocks.

If you want to randomly choose what to put on the grid, you can use the math.random function.

Ad
Log in to vote
0
Answered by 8 years ago

For generating the map I'd recommend using noise. Noise is commonly used for generating maps and there are plenty of tutorials online like this one

Answer this question