Generating structures in map-gen?

User avatar
SegFault22
Member
 
Posts: 870
Joined: Mon May 21, 2012 03:17

Generating structures in map-gen?

by SegFault22 » Tue Jan 01, 2013 09:06

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.
Resources are abundant; only money is scarce. People should not have to work hard and remain poor just to pay for the needs of survival.
Society can thrive without money - but only if productive members of society are rewarded for being productive.
 

User avatar
Casimir
Member
 
Posts: 1101
Joined: Fri Aug 03, 2012 16:59

by Casimir » Tue Jan 01, 2013 10:57

 

User avatar
SegFault22
Member
 
Posts: 870
Joined: Mon May 21, 2012 03:17

by SegFault22 » Tue Jan 01, 2013 10:59


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.
Resources are abundant; only money is scarce. People should not have to work hard and remain poor just to pay for the needs of survival.
Society can thrive without money - but only if productive members of society are rewarded for being productive.
 

User avatar
Casimir
Member
 
Posts: 1101
Joined: Fri Aug 03, 2012 16:59

by Casimir » Tue Jan 01, 2013 11:50

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.
 

Sokomine
Member
 
Posts: 2980
Joined: Sun Sep 09, 2012 17:31

by Sokomine » Tue Jan 01, 2013 15:47

Have a look at this one from sapiers animals: Vault of Dungeon Masters
A list of my mods can be found here.
 

User avatar
Menche
Member
 
Posts: 994
Joined: Sat Jul 02, 2011 00:43

by Menche » Tue Jan 01, 2013 17:21

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.
An innocent kitten dies every time you top-post.
I am on the Voxelands Forums more often than here.
Try Voxelands (forked from Minetest 0.3) by darkrose
 

User avatar
SegFault22
Member
 
Posts: 870
Joined: Mon May 21, 2012 03:17

by SegFault22 » Tue Jan 01, 2013 18:43

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.
Resources are abundant; only money is scarce. People should not have to work hard and remain poor just to pay for the needs of survival.
Society can thrive without money - but only if productive members of society are rewarded for being productive.
 


Return to WIP Mods

Who is online

Users browsing this forum: No registered users and 9 guests

cron