Matrix Games Forums

Forums  Register  Login  Photo Gallery  Member List  Search  Calendars  FAQ 

My Profile  Inbox  Address Book  My Subscription  My Forums  Log Out

ScenEdit_AddZone fails in LUA Console?

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
  Printable Version
All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Tech Support >> ScenEdit_AddZone fails in LUA Console? Page: [1]
Login
Message << Older Topic   Newer Topic >>
ScenEdit_AddZone fails in LUA Console? - 8/14/2017 2:33:00 AM   
coolum001

 

Posts: 7
Joined: 8/3/2017
Status: offline
Hi

I am running Command V12.12 Build936.21, Running in Steam Mode

I have a problem trying to create an exclusion zone from the LUA Console (use case is modelling an Economic Exclusion Zone, with many RPs to be created from LUA). The problem occurs in even the hand-crafted 4 RP case.

my code looks like:

local points = ScenEdit_GetReferencePoints({side="ADF", area={"X1", "X2", "X3", "X4"}})
print(points)
local tt={description='EEZ', isactive=true, area=points, affects={'Aircraft','Ship'}, markas='Hostile'}
print(tt)
ScenEdit_AddZone('ADF', 1, tt)


and the print statements shows what I expect, but I get the error pop-up, and LUA error
ScenEdit_AddZone 5 : ,Error in RP!

Is there some attribute I should be setting in the RP, so I can use them in a Zone to be created from LUA?

Thanks in advance

Attachment (1)
Post #: 1
RE: ScenEdit_AddZone fails in LUA Console? - 8/14/2017 3:27:01 AM   
coolum001

 

Posts: 7
Joined: 8/3/2017
Status: offline
So I figured it out by myself;

In the 'table' list parameter input to the Scen_AddZone method,

the attribute 'area' is described as '{ of RPs }'; it is actually a list of RP names.

So, code like:

local tt={description='EEZ', isactive=true, area={"X1", "X2", "X3", "X4"}, affects={'Aircraft','Ship'}, markas='Hostile'}
print(tt)
ScenEdit_AddZone('ADF', 1, tt)

works OK

I suggest providing usage examples for this method.

Thanks for your time

(in reply to coolum001)
Post #: 2
RE: ScenEdit_AddZone fails in LUA Console? - 8/14/2017 4:15:09 AM   
Rory Noonan

 

Posts: 2816
Joined: 12/18/2014
From: Brooklyn, NY
Status: offline
You can save yourself some typing and use the following:

ScenEdit_AddZone('ADF', 1, {description='EEZ', isactive=true, area={"X1", "X2", "X3", "X4"}, affects={'Aircraft','Ship'}, markas='Hostile'})

(in reply to coolum001)
Post #: 3
Page:   [1]
All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Tech Support >> ScenEdit_AddZone fails in LUA Console? Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts


Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI

5.094