Well, I wanted to make a trailer park (didn’t know there was already one in game) where each trailer would be pulled from a random assortment of nested chunks. This would make each trailer park a pseudo-random experience.
But I also wanted rare spawn trailers (like one with a suicide or a meth lab or whatever). I thought that I could use “weight” to make them rarer. You can’t, though.
What you can do, though, is break those into their own set. IE: Basic trailers would have one nested_mapgen_id (tp_single, in my case) and then rare ones with a separate id (tp_single_rare).
Then, when you are spawning your chunks in the main mapgen entry, you can weight those categories. I’m not good with the exact terms for these things, so that all might sound like nonsense. But basically it looks like this.
"place_nested": [ { "chunks": [ [ "tp_single", 99 ], [ "tp_single_rare", 1 ] ] "x": 0, "y": 0},
This way it should pull from the standard nested chunks 99% of the time and from the rare chunks 1% of the time. Uh, that’s if I understand how those numbers work.
Again, sorry I don’t know coder words and phrases. I hope all that made sense.
You can find examples of this in mapgen/labs/lab_rooms.json, which is where I figured it out. I was originally looking at lab_floorplans_finale1level.json, which didn’t have what I was looking for.
As a side note, I don’t think the trailer thing is going to work out. They just turn out as small houses and I’m not sure how people feel about preconstructed neighborhoods.
EDIT: At least I’m pretty sure that’s how it’s supposed to work but I’ve been effing with it for about 20 minutes and my chunks won’t show up. So maybe I don’t know as much as I thought.