Remove No-Navigation Zone with LUA

All discussions & material related to Command's Lua interface

Moderators: RoryAndersonCDT, michaelm75au, angster, MOD_Command

Post Reply
tmoilanen
Posts: 111
Joined: Wed Oct 19, 2011 4:28 pm

Remove No-Navigation Zone with LUA

Post by tmoilanen »

Hi - I'm trying to remove a No-Navigation zone via Lua script and can't seem to find the correct syntax in the docs.

Below is code that I have tried, but if I have multiple No-Nav zones defined it will delete 1 zone, and not necessarily the one which is specified my the zone variable.

Any assistance would be appreciated...tm

Code: Select all

local myside = {'NATO'}
local myzone = {'Kaliningrad'}

for s = 1,#myside
do

local side = myside[s]

for z = 1, #myzone
do

zone = myzone[z] .." No-Nav Zone"

ScenEdit_RemoveZone(side,0,{zone})

end
end
KnightHawk75
Posts: 1850
Joined: Thu Nov 15, 2018 7:24 pm

Re: Remove No-Navigation Zone with LUA

Post by KnightHawk75 »

All you should need "IF" you know the side and name of the zone you should not need all the rest just:

ScenEdit_RemoveZone('NATO',0,{Description="Kaliningrad"});

Be aware the related RP's generally speaking remain (you're just deleting the zone using them).
Post Reply

Return to “Lua Legion”