Matrix Games Forums

Forums  Register  Login  Photo Gallery  Member List  Search  Calendars  FAQ 

My Profile  Inbox  Address Book  My Subscription  My Forums  Log Out

Trouble with LUA / Activation & Deactivation of No-Navigation Zones

 
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 >> Trouble with LUA / Activation & Deactivation of No-Navigation Zones Page: [1]
Login
Message << Older Topic   Newer Topic >>
Trouble with LUA / Activation & Deactivation of No-Nav... - 6/9/2017 9:17:56 AM   
Fer_Cabo

 

Posts: 111
Joined: 9/17/2015
Status: offline
Hi guys,

I'm having trouble with a LUA instruction for an Action that deactivates an existing and active No-Navigation Zone.

What i found in CMANO manuals and sample scripts is as follows:

mySide = VP_GetSide({Name=”US”})
myZone = mySide:getnonavzone(“AAW Zone 1”)
myZone.isactive = ”False”

In my Scenario case, the script would be as follows, for an Action deactivating the initially activated No-Navigation-Zone defined for "DPRK" side units on Chinese Territory (the No-Navigation Zone is called "PRCSOVEREIGN"), once the side "PRC" has been attacked and the Mutual Defence Agreement between the two countries/Sides enters into effect:

mySide = VP_GetSide({Name=”DPRK”})
myZone = mySide:getnonavzone(“PRCSOVEREIGN”)
myZone.isactive = ”False”

The problem is... when i test this LUA Script in the Script Console, it returns ERROR based on a character position (148) which does not even exist, since the script is apparently not so long.

What'd be the right scripting?

Thanks a (metric)Ton in advance for your help!

Fernando.


Post #: 1
RE: Trouble with LUA / Activation & Deactivation of No... - 6/9/2017 11:02:10 AM   
michaelm75au


Posts: 13500
Joined: 5/5/2001
From: Melbourne, Australia
Status: offline
Would be easier to see what problem is if you attach the scenario?
The error should report what line the error occurred on.

_____________________________

Michael

(in reply to Fer_Cabo)
Post #: 2
RE: Trouble with LUA / Activation & Deactivation of No... - 6/9/2017 11:11:38 AM   
Fer_Cabo

 

Posts: 111
Joined: 9/17/2015
Status: offline
Thanks Michael, but the error only reports unexpected character in position 148 (no line reference - besides, there are only 3 lines in the script).

Thought it could be a typo just like using some Capital letters: GetNonavzone vs. getnonavzone, but doesn't work either

(in reply to michaelm75au)
Post #: 3
RE: Trouble with LUA / Activation & Deactivation of No... - 6/9/2017 11:33:04 AM   
michaelm75au


Posts: 13500
Joined: 5/5/2001
From: Melbourne, Australia
Status: offline
I assume you are using the latest version (1.12+)
The " isn't needed around the false.

If you can zip and attach the scenario, I can probably give a clearer answer.
I don't know it is just how it shows, but the quotes marks around DRPK and PRCSOVEREIGN seem to be different.
mySide = VP_GetSide({Name=DPRK})
myZone = mySide:getnonavzone(PRCSOVEREIGN)

Try using the single quote ' instead.

< Message edited by michaelm -- 6/9/2017 11:35:53 AM >


_____________________________

Michael

(in reply to Fer_Cabo)
Post #: 4
RE: Trouble with LUA / Activation & Deactivation of No... - 6/10/2017 12:26:49 PM   
Fer_Cabo

 

Posts: 111
Joined: 9/17/2015
Status: offline
mySide = VP_GetSide({Name="DPRK"})
myZone = mySide:getnonavzone("PRCSOVEREIGN")
myZone.isactive = False

It works like this!

Thanks a lot!

(in reply to michaelm75au)
Post #: 5
Page:   [1]
All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Tech Support >> Trouble with LUA / Activation & Deactivation of No-Navigation Zones 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

0.672