Page 1 of 1

Ability to mark non-interactive areas/zones

Posted: Tue Jun 12, 2018 1:29 pm
by Godmave
I would like to mark one or multiple areas/zones defined by (for starters) a square, without needing to place down concrete or something similar via (soft-)mod.
Visually I would prefer a not too in your face border. Maybe a definable tint of the border tiles.

surface.addZone(x1,y1,x2,y2,tint={r,g,b,a}, fill=bool) : returns zoneId
surface.removeZone(zoneId)

or for polygonal markings:
surface.addZone(area=[{x,y},{x,y},{x,y},{x,y},..],tint={r,g,b,a}, fill=bool) : returns zoneId

instead of fill you could do flags={fill=true/false, flash=true/false, show_on_map=true/false etc.}

My use-case: Mark zones that allow building a specific building, or give buildings specific abilities if they are in a specific zone. In my case a train-stop gets the ability to teleport. I can implement the zones, but the player has to guess where the zones are, which is not very user friendly. But placing down concrete looks ugly, conflicts with stuff on the map and has complications when changing the zones dimensions later.

Possible use-case for you: Use it in tutorials to highlight stuff for the current tutorial step. "Go here and mine zone iron ore".

Re: Ability to mark non-interactive areas/zones

Posted: Tue Jun 12, 2018 1:39 pm
by eradicator
Additional possible usecase:
Minecraft had zone-based permissions (vanilla, modded? don't remember) so that players could "own" plots of lands where other players were not allowed to build. For PvP this could for example be used to enforce that team A only builds west of {0,0} and team B only east of {0,0}. Visually a sort of striped border like hazard concrete but much thinner and semi-transparent would be nice, and there should probably be a button to toggle it on and off.

Re: Ability to mark non-interactive areas/zones

Posted: Wed Jun 13, 2018 10:26 am
by Rseding91
This seems completely outside of what the base game should be doing. All of that can be done with mods.

Re: Ability to mark non-interactive areas/zones

Posted: Wed Jun 13, 2018 10:57 am
by Godmave
Well, the point was not to have to resort to mods. And using hundreds or thousands of sprites to draw the border marker does not really sound like a performant solution.
I am not aware of way to just draw a semi-transparent colored line (not using sprites) on a surface via mods either. If there is, I would be thankful for a pointer in the right direction.

Re: Ability to mark non-interactive areas/zones

Posted: Fri Jan 04, 2019 6:10 pm
by Bilka
I implemented this for 0.17: https://lua-api.factorio.com/0.17.0-pre ... ering.html It allows you to simply draw the zones using the rectangle or by using multiple dashed lines, if you want to get fancy :)