presetThrottle & Altitude in Waypoint

All discussions & material related to Command's Lua interface

Moderators: angster, RoryAndersonCDT, michaelm75au, MOD_Command

Post Reply
GJV
Posts: 2
Joined: Sun Dec 04, 2022 12:34 pm

presetThrottle & Altitude in Waypoint

Post by GJV »

Good afternoon,

I'm trying to initiate a A/C with WP's but cannot get the speed and altitude in the Waypoints. Unable to find what I'm doing wrong, also not seeing both parameters in the Waypoint settings.

Code: Select all

-- Add A/C + Homeplate
local homebase = ScenEdit_GetUnit({name='Chernyakhovsk Air Base', guid='DA4EJL-0HMLKS285SKR0'});
local AC1 = ScenEdit_AddUnit({guid='2BGABG-0HMMD7HQ13JL5', name='Golub #1', side='Russia', DBID=600, LoadoutID=1473, type='aircraft', latitude='54.6177049426136', longitude='21.7828231889477', altitude=3500, heading=270, presetThrottle='cruise'});
AC1.base = homebase;

-- Set WP's
ProbeCourse = {
    [1] = { TypeOf = 'ManualPlottedCourseWaypoint',  desription='1-High', latitude='55.5613458922204', longitude='17.7358573281829', presetAltitude='HIGH25000' presetThrottle='military'},
    [2] = { TypeOf = 'ManualPlottedCourseWaypoint',  desription='2-Low', latitude='55.6885769813964', longitude='16.7903917927341', presetAltitude='LOW2000', presetThrottle='afterburner'} ,
    [3] = { TypeOf = 'ManualPlottedCourseWaypoint',  description='target', latitude='56.2017352448754', longitude='16.1747209083475'} } -- deze nog on-top!
    ScenEdit_SetUnit({guid='2BGABG-0HMMD7HQ13JL5', Course=ProbeCourse})
If someone sees my mistake, much appriciated.
regards
KnightHawk75
Posts: 1850
Joined: Thu Nov 15, 2018 7:24 pm

Re: presetThrottle & Altitude in Waypoint

Post by KnightHawk75 »

What version?

You need to add the DesiredAltitude I think (1147.4x) as just the presets without will not work as the desired gets set by the gui process you must add it yourself when manipulating course tables on your own. Probably need the description spelled right too, and comma was missing in the course entry for #1 after presetAltitude.

IE this works in 1147.4x (note DesiredAltitude is in meters):

Code: Select all

local probeCourse = {
    [1] = {description='1-High', latitude='55.5613458922204', longitude='17.7358573281829', presetAltitude='HIGH25000', presetThrottle='military',DesiredAltitude='7620.0'},
    [2] = {description='2-Low', latitude='55.6885769813964', longitude='16.7903917927341', presetAltitude='LOW2000', presetThrottle='afterburner',DesiredAltitude='609.6'} ,
    [3] = {description='target', latitude='56.2017352448754', longitude='16.1747209083475'} -- deze nog on-top!
}
local homebase = ScenEdit_GetUnit({name='Chernyakhovsk Air Base', guid='DA4EJL-0HMLKS285SKR0'});
local ac1 = ScenEdit_AddUnit({name='Golub #1', side='Russia', DBID=600, LoadoutID=1473, type='aircraft', latitude='37.6177049426136', longitude='-93.7828231889477', altitude=3500, heading=270, presetThrottle='cruise'});
ac1.base = homebase;
ac1.course = probeCourse;
Parel803
Posts: 891
Joined: Thu Oct 10, 2019 3:39 pm
Location: Netherlands

Re: presetThrottle & Altitude in Waypoint

Post by Parel803 »

Knighthawk thank you for time and answer.
Sorry for the messy stuff.
best regards GJ
Post Reply

Return to “Lua Legion”