Turn off zones.

All discussions & material related to Command's Lua interface

Moderators: angster, RoryAndersonCDT, michaelm75au, MOD_Command

Post Reply
User avatar
tjhkkr
Posts: 2431
Joined: Wed Jun 02, 2010 11:15 pm
Contact:

Turn off zones.

Post 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?
Remember that the evil which is now in the world will become yet more powerful, and that it is not evil which conquers evil, but only love -- Olga Romanov.
Whicker
Posts: 665
Joined: Tue Jun 19, 2018 9:54 pm

RE: Turn off zones.

Post 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.
User avatar
michaelm75au
Posts: 12467
Joined: Sat May 05, 2001 8:00 am
Location: Melbourne, Australia

RE: Turn off zones.

Post 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

Michael
User avatar
tjhkkr
Posts: 2431
Joined: Wed Jun 02, 2010 11:15 pm
Contact:

RE: Turn off zones.

Post by tjhkkr »

Thank you!
Remember that the evil which is now in the world will become yet more powerful, and that it is not evil which conquers evil, but only love -- Olga Romanov.
Post Reply

Return to “Lua Legion”