Matrix Games Forums

Forums  Register  Login  Photo Gallery  Member List  Search  Calendars  FAQ 

My Profile  Inbox  Address Book  My Subscription  My Forums  Log Out

Setting altitude

 
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 >> Mods and Scenarios >> Lua Legion >> Setting altitude Page: [1]
Login
Message << Older Topic   Newer Topic >>
Setting altitude - 3/13/2020 4:20:33 PM   
Gunner98

 

Posts: 5508
Joined: 4/29/2005
From: The Great White North!
Status: offline
Using the command:

ScenEdit_SetUnit({side="NATO", unitname="101 Sqn RAF #1", altitude=10972.6, speed=230})

works fine, but note that the command uses meters and you must have the decimal point included. 10972.6 (or 7 or 8 or 9) returns 36,000.7 ft ASL which is fine but -

Is there a way to simply give the command in feet and avoid the '.7'

BTW, the documentation notes the meters but doesn't mention using the decimal point.

Thanks

_____________________________

Check out our novel, Northern Fury: H-Hour!: http://northernfury.us/
And our blog: http://northernfury.us/blog/post2/
Twitter: @NorthernFury94 or Facebook https://www.facebook.com/northernfury/
Post #: 1
RE: Setting altitude - 3/13/2020 5:54:31 PM   
TitaniumTrout


Posts: 374
Joined: 10/20/2014
From: Michigan
Status: offline
So if you give it the command without a decimal value then it just sets it to zero, correct? That's what I see in my testing.

local a = ScenEdit_SetUnit({side="BLUFOR", unitname="Airplane", altitude = 7000, manualaltitude=7010, manualspeed=410})
print(a)




A few things you can do. One, just add a decimal after the value. Setting the "altitude = 7000." is enough to make it work. Odd that it doesn't also happen with speed, probably something going on with a conversion.

You could also include a conversion so you don't have to think in meters. then you'd do "altitude = (3600/3.281)".

Interestingly enough that works, however I'm running into some oddities setting the math on the manualaltitude side of things. I can divide 3000/3 and it sets it to 3,281 ft. However if I try to divide 3000/3.281 it sets it to 20 ft. Dividing 4000/3 also sets it to 20 ft.

local man = 1000/3
print(man)

local a = ScenEdit_SetUnit({side="BLUFOR", unitname="Airplane", altitude = (3000/3.281), manualaltitude=man, manualspeed=400})
print(a)


Manual override goes to 20 ft.

local man = 333
print(man)

local a = ScenEdit_SetUnit({side="BLUFOR", unitname="Airplane", altitude = (3000/3.281), manualaltitude=man, manualspeed=400})
print(a)


Manual altitude goes to 1093 ft.

333.0 returns 1093 ft.
333.3 returns 20 ft.

I'll cross post this as a bug? Unless I'm missing something.







_____________________________


(in reply to Gunner98)
Post #: 2
RE: Setting altitude - 3/13/2020 7:15:54 PM   
Gunner98

 

Posts: 5508
Joined: 4/29/2005
From: The Great White North!
Status: offline
quote:

So if you give it the command without a decimal value then it just sets it to zero, correct? That's what I see in my testing


Yes that is exactly what is happening to me. I do believe there is something to do with rounding as the same result (36000.7 ft ASL) in feet appears with multiple altitude entries (altitude=10972.6 or .7, or .8 or .9)


This is very workable but I do think something may be off.

Thanks for checking into it.

B

_____________________________

Check out our novel, Northern Fury: H-Hour!: http://northernfury.us/
And our blog: http://northernfury.us/blog/post2/
Twitter: @NorthernFury94 or Facebook https://www.facebook.com/northernfury/

(in reply to TitaniumTrout)
Post #: 3
RE: Setting altitude - 3/14/2020 2:27:22 AM   
michaelm75au


Posts: 13500
Joined: 5/5/2001
From: Melbourne, Australia
Status: offline
This may be a side affect of moving to Lua 5.3 as in Lua 5.2 all numbers were treated as decimal/floats that is not the case in L5.3. The suggestion from the L5.3 manual is to force it to a float by adding a decimal point to it. . As TT suggests.

I need to check how the values are being passed to the SE_SetUnit() as funny speed works and altitude doesn't - we came across something like this on a different function when testing the changes.

Verified and fixed for a future build.

< Message edited by michaelm75au -- 3/14/2020 3:04:41 AM >


_____________________________

Michael

(in reply to Gunner98)
Post #: 4
RE: Setting altitude - 3/14/2020 2:30:07 AM   
michaelm75au


Posts: 13500
Joined: 5/5/2001
From: Melbourne, Australia
Status: offline
BTW you should be able to put the value in feet.

{altitude='100 FT'}

_____________________________

Michael

(in reply to michaelm75au)
Post #: 5
RE: Setting altitude - 3/14/2020 12:34:47 PM   
Gunner98

 

Posts: 5508
Joined: 4/29/2005
From: The Great White North!
Status: offline
Cheers, thanks Michael

B

_____________________________

Check out our novel, Northern Fury: H-Hour!: http://northernfury.us/
And our blog: http://northernfury.us/blog/post2/
Twitter: @NorthernFury94 or Facebook https://www.facebook.com/northernfury/

(in reply to michaelm75au)
Post #: 6
Page:   [1]
All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Mods and Scenarios >> Lua Legion >> Setting altitude 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

1.047