What's missing in this Lua Condition?

Take command of air and naval assets from post-WW2 to the near future in tactical and operational scale, complete with historical and hypothetical scenarios and an integrated scenario editor.

Moderator: MOD_Command

Post Reply
ProdigyofMilitaryPride
Posts: 106
Joined: Thu Apr 16, 2015 11:54 pm

What's missing in this Lua Condition?

Post by ProdigyofMilitaryPride »

Trying to make certain facilities appear in a scenario that I'm creating through Lua-based conditions... But the conditions keep failing! Something's missing from them, but I don't know what it is.

Here's two examples...
ScenEdit_AddUnit({type = 'Facility', name = 'ERC-90 Section', dbid = 2983, 'DEG', Latitude='N16.52.12', Longitude='99.52.07', autodetectable='true', holdfire='true', proficiency=4})
ScenEdit_AddUnit({type = 'Facility', name = 'Mexican Command Post', 'DEG', dbid = 452, Latitude="N16.52.06", Longitude="99.53.33", autodetectable="true", holdfire="true", proficiency=4})
"The courageous must protect freedom." - Dwight D. Eisenhower
"Anything built by human hands can be destroyed. This is no exception." - Kei "Edge" Nagase, Ace Combat 5: The Unsung War
MagpieS
Posts: 22
Joined: Sun Oct 19, 2008 3:46 am

RE: What's missing in this Lua Condition?

Post by MagpieS »

You need E or W on the Longitude and they should be in ' not "

I don't think you need the 'DEG' either

I think that might be what's messing it up
Whicker
Posts: 664
Joined: Tue Jun 19, 2018 9:54 pm

RE: What's missing in this Lua Condition?

Post by Whicker »

I ran:
ScenEdit_AddUnit({type = 'Facility', name = 'Mexican Command Post', 'DEG', dbid = 452, Latitude="N16.52.06", Longitude="99.53.33", autodetectable="true", holdfire="true", proficiency=4})

and the error was that it was missing the side. I added that and it added the unit - though it ended up in Thailand, not sure if that was the right location or not, seems like an odd place for a mexican command post. maybe this is cause of that Magpies said. I usually get the lat lon off the map by pressing cntrl + x and then clicking somewhere, that copies it to the clipboard.

you can use either quotes as long as the pairs match - so '1234' is ok and so is "1234" but '1234" is not ok.
MagpieS
Posts: 22
Joined: Sun Oct 19, 2008 3:46 am

RE: What's missing in this Lua Condition?

Post by MagpieS »

Longitude 99 E is correct for Thailand.
Mexico would be W or negative
User avatar
michaelm75au
Posts: 12457
Joined: Sat May 05, 2001 8:00 am
Location: Melbourne, Australia

RE: What's missing in this Lua Condition?

Post by michaelm75au »

Yes, if adding a unit, it would be useful for the method to know on which side to add it.[:D]
Michael
Post Reply

Return to “Command: Modern Operations series”