Page 1 of 1

What's missing in this Lua Condition?

Posted: Fri Aug 02, 2019 1:55 am
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})

RE: What's missing in this Lua Condition?

Posted: Fri Aug 02, 2019 5:12 am
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

RE: What's missing in this Lua Condition?

Posted: Fri Aug 02, 2019 12:19 pm
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.

RE: What's missing in this Lua Condition?

Posted: Fri Aug 02, 2019 6:49 pm
by MagpieS
Longitude 99 E is correct for Thailand.
Mexico would be W or negative

RE: What's missing in this Lua Condition?

Posted: Fri Aug 02, 2019 11:37 pm
by michaelm75au
Yes, if adding a unit, it would be useful for the method to know on which side to add it.[:D]