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 a manual altitude/depth

 
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 Air / Naval Operations >> Mods and Scenarios >> Lua Legion >> setting a manual altitude/depth Page: [1]
Login
Message << Older Topic   Newer Topic >>
setting a manual altitude/depth - 2/2/2019 6:26:07 AM   
Whicker

 

Posts: 517
Joined: 6/20/2018
Status: offline
I can't figure out how to create a unit and set a manual altitude/depth.

the docs say:

manualAlitude bool To turn on/off manual mode

which is mis spelled, so it wasn't working when I copied and pasted it, then I fixed the spelling but it still doesn't seem to work.

When I print the wrapper for a unit I don't see it, and when I set `manualAltitude = true` it doesn't work. I read something on the steam forum about it working with a plotted course, but I was just setting up some random bio/false contacts and wanted them to stay at the depth I gave them. I guess that is a bit weird if they don't have a course.

https://steamcommunity.com/app/321410/discussions/0/1692659769953724579/

The fish/whales seem to change depth on their own too, if I speed up time to 15x and watch one it can go from 600' to 131' and back again every few minutes. Can't tell if that is on purpose or not. Even the false contact seems to do that sometimes. If I manually set a depth and course they never do that.
Post #: 1
RE: setting a manual altitude/depth - 2/2/2019 9:06:17 AM   
michaelm75au


Posts: 12396
Joined: 5/5/2001
From: Sydney, Australia
Status: offline
You need to set the desired altitude using the course way points. The manual settings have changed over time, and I need to revisit it.
Last time I played with this it only seem to work with a course.

quote:

local unit = ScenEdit_GetUnit({name='Looking #1', guid='207d76e0-e5be-4012-bbc8-93a142bb5b7b'})
unit.course={ {lat=34.39 , lon=136.09,DESIREDALTITUDE=100 }, {lat=37.9 , lon=140.0 } }
print(unit);


_____________________________

Michael

(in reply to Whicker)
Post #: 2
RE: setting a manual altitude/depth - 2/2/2019 12:47:46 PM   
KnightHawk75

 

Posts: 113
Joined: 11/15/2018
Status: offline
Try this seems to work, or I'm not fully understanding desired outcome.

local myunit = ScenEdit_GetUnit({name='SSN 774 Virginia [Flight I]', guid='a0d58a3f-2470-409f-830f-17b70edd07c6'})
myunit.altitude = -100; --set current
--can also use..
--ScenEdit_SetUnit({side='US', unitname='SSN 774 Virginia [Flight I]', moveto=true,depth=105,desiredheading='270',manualaltitude="current"});
--This also works.. with manualaltitude='###' it will set DESIRED setting.
--ScenEdit_SetUnit({side='US', unitname='SSN 774 Virginia [Flight I]', moveto=true,depth=105,desiredheading='270',manualaltitude="-105"});

--Also the doc is out of date about it being Bool, though you can feed it one but it'll be parsed as string and not match any of the presets and fail the numerical parse try.
myunit.manualAltitude = "Current" --set to existing current amount, will set to on if off These work in setunit the same as well.
myunit.manualAltitude = "Desired" --set to existing desired amount, will set to on if off
myunit.manualAltitude = "Off" -- turn if off and back to auto
myunit.manualAltitude = "-105" --set desired. and will trigger manual on.



< Message edited by KnightHawk75 -- 2/2/2019 1:02:36 PM >

(in reply to michaelm75au)
Post #: 3
RE: setting a manual altitude/depth - 2/2/2019 3:35:14 PM   
Whicker

 

Posts: 517
Joined: 6/20/2018
Status: offline
ah - cool, it does work. I think my problem was that it needs to be enclosed in quotes like a string when it is a number. Well, actually it was that I was setting it to true.

so this works:
local new_bio = ScenEdit_AddUnit({side='Biologics', type='Submarine',name='Biologic/False Contact', dbid=DBID,latitude=point.latitude,longitude=point.longitude, manualAltitude= '-246',manualSpeed=math.random(0, 4)})

the depth initially is 131' but it is set to go to the manualAltitude which works. If I also pass in Depth = '246' then it starts at that depth and stays there.

(in reply to KnightHawk75)
Post #: 4
RE: setting a manual altitude/depth - 2/2/2019 3:36:37 PM   
Whicker

 

Posts: 517
Joined: 6/20/2018
Status: offline
is there a way to set the depth to Just Under the Layer? or any of the other ones? that way if it moves around it can maintain that rather than an actual depth.

(in reply to Whicker)
Post #: 5
RE: setting a manual altitude/depth - 2/2/2019 5:07:52 PM   
michaelm75au


Posts: 12396
Joined: 5/5/2001
From: Sydney, Australia
Status: offline
There are presets that can be used instead of actual depth - been awhile since I tried them
"SURFACE" "PERISCOPE" "SHALLOW" "OVERLAYER" "UNDERLAYER" "MAXDEPTH"

_____________________________

Michael

(in reply to Whicker)
Post #: 6
RE: setting a manual altitude/depth - 2/2/2019 5:35:45 PM   
Whicker

 

Posts: 517
Joined: 6/20/2018
Status: offline
those look to work for setting the depth, but then I can't set the manualAltitude - they ignore that it seems. So when I create them they are at that depth - so for OVERLAYER if I go to that unit and select that setting (F2) it is the same depth, but as soon as the game starts they go back to 131' cause it is not actually choosing the radio button for OVERLAYER.

Almost there though.

I think just setting an altitude will be enough, the presets would be nice but not really needed. I was curious what would happen if I preset the depth to -400' and the path it takes goes over shallower water than that and it looks like it then just stays as low as possible which works I think.

(in reply to michaelm75au)
Post #: 7
RE: setting a manual altitude/depth - 2/2/2019 9:25:41 PM   
KnightHawk75

 

Posts: 113
Joined: 11/15/2018
Status: offline
The ones for altitude\aircraft I think are strings "MINALT" "MINALTITUDE" "LOW1000" "LOW2000" "MED12000" "MEDIUM12000" "HIGH25000" "HIGH36000" "MAXALT"

< Message edited by KnightHawk75 -- 2/2/2019 9:29:13 PM >

(in reply to Whicker)
Post #: 8
RE: setting a manual altitude/depth - 2/16/2019 2:27:34 AM   
michaelm75au


Posts: 12396
Joined: 5/5/2001
From: Sydney, Australia
Status: offline
I have tweaked the Lua manual speed/altitude properties; they behave slightly differently in the actual command code, speed is a number but altitude is a off/on switch.
The unit wrapper manualSpeed/manualAltitde will return nil if not set; otherwise they will return the desired speed/altitude values.
Also found that presets and values used at the same time could give some conflicting results.

_____________________________

Michael

(in reply to KnightHawk75)
Post #: 9
Page:   [1]
All Forums >> [New Releases from Matrix Games] >> Command: Modern Air / Naval Operations >> Mods and Scenarios >> Lua Legion >> setting a manual altitude/depth 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.156