LUA Base support (Full Version)

All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Tech Support



Message


AlphaSierra -> LUA Base support (6/8/2017 7:02:21 PM)

Is it possible to change a base with lua?

No Joy with ScenEdit_UpdateUnit({name='USS Illinois (SSN-786)', guid='b2a4bed1-5d69-4f8f-a759-f9b4a4832646',base='NewBase'})




michaelm75au -> RE: LUA Base support (6/9/2017 6:45:09 AM)

From memory, the new base needs to be a 'unit' object
Firstly, you are using wrong command. UpdateUnit() is used to update the components (weapon/sensors) of the 'unit'.
quote:

local unit = ScenEdit_GetUnit({name='USS Illinois (SSN-786)', guid='b2a4bed1-5d69-4f8f-a759-f9b4a4832646'})
local newbase = ScenEdit_GetUnit({name='NewBase'})
unit.base = newbase




AlphaSierra -> RE: LUA Base support (6/9/2017 9:59:57 AM)

I shall give that a try

Thank you




AlphaSierra -> RE: LUA Base support (6/9/2017 3:25:20 PM)

No luck there either even ScenEdit_SetUnit does not seem to support base wow




Dan109 -> RE: LUA Base support (6/10/2017 2:16:31 AM)

Try ScenEdit_HostUnitToParent. Here are the results from a test I did. Probably doesn't do what you want, to change base while deployed and not 'teleport' to the new base. Maybe there should be a bool flag on this SE function, to physically move it or not.

>> my_unit = ScenEdit_GetUnit({name='Green Pawn #1', guid='49bb27a4-7107-4a95-9402-8d5f05d432f7'})
print(my_unit)
ScenEdit_HostUnitToParent({HostedUnitNameOrID='Green Pawn #1',SelectedHostNameOrID='CVN 77 George Bush [Nimitz Class]'})
print(my_unit)


unit {
type = 'Aircraft',
subtype = '8201',
name = 'Green Pawn #1',
side = 'US Navy',
guid = '49bb27a4-7107-4a95-9402-8d5f05d432f7',
proficiency = 'Regular',
latitude = '26.1435543761475',
longitude = '-80.0242708081714',
altitude = '0',
speed = '46.66667',
throttle = 'Loiter',
autodetectable = 'False',
base = 'LCS 17 Indianapolis [Freedom LCS]',
mounts = '0',
magazines = '0',
unitstate = 'Unassigned',
fuelstate = 'None',
weaponstate = 'None',
}
unit {
type = 'Aircraft',
subtype = '8201',
name = 'Green Pawn #1',
side = 'US Navy',
guid = '49bb27a4-7107-4a95-9402-8d5f05d432f7',
proficiency = 'Regular',
latitude = '26.2126470332819',
longitude = '-79.8800780252283',
altitude = '0',
speed = '46.66667',
throttle = 'Loiter',
autodetectable = 'False',
base = 'CVN 77 George Bush [Nimitz Class]',
mounts = '0',
magazines = '0',
unitstate = 'Unassigned',
fuelstate = 'None',
weaponstate = 'None',
}

Results from the UI, the aircraft was 'teleported' from the LCS to the CV, which is not very applicable during a scenario execution




michaelm75au -> RE: LUA Base support (6/10/2017 2:33:42 AM)


quote:

ORIGINAL: AlphaSierra

No luck there either even ScenEdit_SetUnit does not seem to support base wow

Sorry my mistake.[:o]
Being able to set it direct has been made for the future so you don't need to use the 'HostToParent'




Dan109 -> RE: LUA Base support (6/10/2017 9:19:02 AM)

Any idea when there will be some additional LUA from the beta doc page will be added to the general release? I just learned of the beta page, and am looking forward to the things I'm seeing there.




michaelm75au -> RE: LUA Base support (6/10/2017 9:30:12 AM)

As things are released, I'll move them to normal page.




AlphaSierra -> RE: LUA Base support (6/10/2017 10:29:38 AM)

This is the direction I was heading :)

I am doing some testing with this to see if I can get my bombers to drop and then change their base

Thanks Man!




AlphaSierra -> RE: LUA Base support (6/10/2017 10:32:45 AM)

good to know! Thank you

playing with the host to parent is a no brainer for moving your assets around a base




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
2