Page 1 of 1

Turn off zones.

Posted: Fri Oct 26, 2018 12:00 am
by tjhkkr
Question: is there a way to turn off zones?

For example: I do not want infantry to advance until they are safe to do so.
Any thoughts?

RE: Turn off zones.

Posted: Fri Oct 26, 2018 1:53 am
by Whicker
this is from the commandlua website as an example under VP_GetSide:

local a = VP_GetSide({Side ='sidea'}) -- a side object
local z = a.nonavzones --List of no-nav zones for the side if you need to find it
local n = a : getnonavzone(z[1].guid) -- required zone object for a particular zone
n.isactive = false -- turn it off

not sure if that is what you want but maybe? and not sure I actually understand it but with a little experimenting maybe it would make sense.

RE: Turn off zones.

Posted: Fri Oct 26, 2018 6:37 am
by michaelm75au
Using the above:
n.affects is a table of unit types that apply to the zone.

n.affects = {} -- removes all type
n.affects = {'Aircraft', 'Submarine', 'Facility', 'Ship' } -- turn on for all
n.affects = {'Aircraft', 'Facility' } -- turn on for planes and facilities


RE: Turn off zones.

Posted: Sat Oct 27, 2018 12:13 am
by tjhkkr
Thank you!