Page 1 of 1

Blank Surface?

Posted: Mon Aug 17, 2015 4:23 am
by vzybilly
I was trying to hack together how to spawn a surface and I finally got it to work, but, the wiki says I can use "none" for the frequency but the game won't run the command to build the surface, can I get any help on this? I would like to make a all desert (most wanted to be dirt or stone ground but settling for desert) that has no trees (desert is the only place that doesn't?) no ores, no enemies, nothing.

So far I've been able to get it to work with:

Code: Select all

game.create_surface("Custom",{terrain_segmentation="normal",water="very-small",autoplace_controls={["coal"]={frequency="very-low",size="medium",richness="regular"},["copper-ore"]={frequency="very-low",size="medium",richness="regular"},["crude-oil"]={frequency="very-low",size="medium",richness="regular"},["enemy-base"]={frequency="very-low",size="medium",richness="regular"},["iron-ore"]={frequency="very-low",size="medium",richness="regular"},["stone"]={frequency="very-low",size="medium",richness="regular"}},seed="83",shift={x=24327,y=37422},width=0,height=0,starting_area="medium",peaceful_mode=true})
The more cleaned up non-one-liner is:

Code: Select all

{terrain_segmentation="normal",
water="very-low",
autoplace_controls={
	["coal"]={frequency="very-low",size="medium",richness="regular"},
	["copper-ore"]={frequency="very-low",size="medium",richness="regular"},
	["crude-oil"]={frequency="very-low",size="medium",richness="regular"},
	["enemy-base"]={frequency="very-low",size="medium",richness="regular"},
	["iron-ore"]={frequency="very-low",size="medium",richness="regular"},
	["stone"]={frequency="very-low",size="medium",richness="regular"}},
seed="83",
shift={x=24327,y=37422},
width=0,
height=0,
starting_area="medium",
peaceful_mode=true}
and if the wiki is true, I should be able to put in something like:

Code: Select all

{terrain_segmentation="normal",
water="none",
autoplace_controls={
	["coal"]={frequency="none",size="medium",richness="regular"},
	["copper-ore"]={frequency="none",size="medium",richness="regular"},
	["crude-oil"]={frequency="none",size="medium",richness="regular"},
	["enemy-base"]={frequency="none",size="medium",richness="regular"},
	["iron-ore"]={frequency="none",size="medium",richness="regular"},
	["stone"]={frequency="none",size="medium",richness="regular"}},
seed="83",
shift={x=24327,y=37422},
width=0,
height=0,
starting_area="medium",
peaceful_mode=true}
but as stated, game hates it.

Thanks for the help on this, it seems like there isn't many people working with the surfaces yet... (from what I can tell atleast)

Re: Blank Surface?

Posted: Mon Aug 17, 2015 5:19 am
by GopherAtl
Not sure why none isn't working, but several settings seem to be outdated on the wiki now for autoplace_controls based on my poking at it.

It's a bit brute-force, but you could use this handler for on_chunk_generated to obliterate all entities in the chunk...

Code: Select all

game.on_event(defines.events.on_chunk_generated,function(event) local e=event.surface.find_entities(event.area) for i=1,#e do if not (e[1].valid and e[1].name=="player") then e[i].destroy() end end  end)
You could also loop over the area calling set_tile to change the tiles to desert, or grass, or whatever you wanted.

Re: Blank Surface?

Posted: Mon Aug 17, 2015 7:21 am
by jorgenRe
If you wish to you could "rob" my code for tile changing ;)! Mod the underground
Then you can ask me for help if you need.
Edit:
It also includes the removal of entities ;)!

Re: Blank Surface?

Posted: Mon Aug 17, 2015 4:04 pm
by vzybilly
I've noticed that changing the time in one place effects the other, is there a way to not have that happen?

Also, I've gotten it working, abit more... poorly then I hoped but it works. thanks for the help

Re: Blank Surface?

Posted: Mon Aug 17, 2015 5:40 pm
by orzelek
If you want you can find full list of currently used map settings near beginning of control.lua in RSO mod.
And to drop the resource you need to use size none not the frequency.

Re: Blank Surface?

Posted: Mon Aug 17, 2015 6:24 pm
by vzybilly
it looks like size none seemed to help but it still gave few trees and rocks, I'll run with this as it's less work for the game, thanks for the input

Re: Blank Surface?

Posted: Mon Aug 17, 2015 8:24 pm
by jorgenRe
vzybilly wrote:it looks like size none seemed to help but it still gave few trees and rocks, I'll run with this as it's less work for the game, thanks for the input
It wont be that bad on the CPU if you remove the trees ;)!
game.surfaces[yoursurface].find_entities_filtered(area, type = "tree") ;)!

Re: Blank Surface?

Posted: Mon Aug 17, 2015 10:10 pm
by Rseding91
GopherAtl wrote:Not sure why none isn't working, but several settings seem to be outdated on the wiki now for autoplace_controls based on my poking at it.

It's a bit brute-force, but you could use this handler for on_chunk_generated to obliterate all entities in the chunk...

Code: Select all

game.on_event(defines.events.on_chunk_generated,function(event) local e=event.surface.find_entities(event.area) for i=1,#e do if not (e[1].valid and e[1].name=="player") then e[i].destroy() end end  end)
You could also loop over the area calling set_tile to change the tiles to desert, or grass, or whatever you wanted.
The wiki's accurate for autoplace_controls however the values may not be used as expected during map generation. It would probably be worth a bug report mentioning that the "none" option for autoplace controls doesn't actually work. It should.

Re: Blank Surface?

Posted: Tue Aug 18, 2015 12:03 am
by vzybilly
None in the size worked but not in the frequency, I forgot to mention that in the post about things working. right now it seems like everything is moving along nicely and my blank surface is nicely done.

Re: Blank Surface?

Posted: Tue Aug 18, 2015 12:48 am
by GopherAtl
Rseding91 wrote: The wiki's accurate for autoplace_controls however the values may not be used as expected during map generation. It would probably be worth a bug report mentioning that the "none" option for autoplace controls doesn't actually work. It should.
what @vzybilly said; I didn't double-check the wiki before my post earlier, I just knew there was a "none" option somewhere that ought to work. I played with it once back in 0.12.0 and remember getting "none" to work then, just forgot it was size and not frequency (which would make more sense, semantically, tbh - frequency=none vs size=none) Not played with it enough to have any idea if anything else does or doesn't work as expected.

Re: Blank Surface?

Posted: Tue Aug 18, 2015 12:52 am
by vzybilly
None works in size and not frequency but in the wiki it's listed as an option in both. a controller for trees and rocks would be nice as well...