Page 1 of 1

Generating structures in map-gen?

PostPosted: Tue Jan 01, 2013 09:06
by SegFault22
Hmm. After looking everywhere and trying everything to find out how to generate a structure in map generation (ex. a 5x5 cube of cobble, filled with a 3x3 cube of lava), I have almost given up on my project to make a mod that adds a structure generating in-game. There is only one thing I will try, until I do give up entirely. I'll ask the community.
So, my question is, how does one go about writing a mod that simply makes a group of nodes generate in an orderly shape, at random points in a world, and only when that chunk is created (a structure)? I know that ore generation is slightly related to this, as it generates something in the world (but that's random - I need to generate something precise and exact)
Anyone know what to do? Any help will be accepted greatly.

PostPosted: Tue Jan 01, 2013 10:57
by Casimir

PostPosted: Tue Jan 01, 2013 10:59
by SegFault22

No no no, I already tried modding from that. That's where I got the idea, and where the problems began. I can't generate structures without random crashes, by changing the code. It's some ''assertion failed!'' bug.

PostPosted: Tue Jan 01, 2013 11:50
by Casimir
It checks for doors to generate. You might have a room like this:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
wwwww
wlllw
wlllw
wlllw
wwwww

w = wall
l = lava
Now it searches for the door "d" finds none and give you an error. This is because celeron wanted those dungeons to have an entrance. You could try to delete those parts of the code.

PostPosted: Tue Jan 01, 2013 15:47
by Sokomine
Have a look at this one from sapiers animals: Vault of Dungeon Masters

PostPosted: Tue Jan 01, 2013 17:21
by Menche
Villages mod randomly places predefined buildings on map generation. If you try it out, use a new world and fly around a lot; the buildings are very rare for some reason.

PostPosted: Tue Jan 01, 2013 18:43
by SegFault22
Casimir wrote:It checks for doors to generate. You might have a room like this:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
wwwww
wlllw
wlllw
wlllw
wwwww

w = wall
l = lava
Now it searches for the door "d" finds none and give you an error. This is because celeron wanted those dungeons to have an entrance. You could try to delete those parts of the code.

Ah, that's it! Thank you! Now I can continue to make a mod I was going to make, and this solves the problem for anyone else who wants to make a structure-generation mod.