Matrix Games Forums

Forums  Register  Login  Photo Gallery  Member List  Search  Calendars  FAQ 

My Profile  Inbox  Address Book  My Subscription  My Forums  Log Out

LUA Base support

 
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 >> Tech Support >> LUA Base support Page: [1]
Login
Message << Older Topic   Newer Topic >>
LUA Base support - 6/8/2017 7:02:21 PM   
AlphaSierra

 

Posts: 132
Joined: 2/13/2017
Status: offline
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'})

_____________________________

I wish to have no connection with any ship that does not sail fast; for I intend to go in harm's way. -John Paul Jones
Post #: 1
RE: LUA Base support - 6/9/2017 6:45:09 AM   
michaelm75au


Posts: 13500
Joined: 5/5/2001
From: Melbourne, Australia
Status: offline
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


_____________________________

Michael

(in reply to AlphaSierra)
Post #: 2
RE: LUA Base support - 6/9/2017 9:59:57 AM   
AlphaSierra

 

Posts: 132
Joined: 2/13/2017
Status: offline
I shall give that a try

Thank you

_____________________________

I wish to have no connection with any ship that does not sail fast; for I intend to go in harm's way. -John Paul Jones

(in reply to michaelm75au)
Post #: 3
RE: LUA Base support - 6/9/2017 3:25:20 PM   
AlphaSierra

 

Posts: 132
Joined: 2/13/2017
Status: offline
No luck there either even ScenEdit_SetUnit does not seem to support base wow

_____________________________

I wish to have no connection with any ship that does not sail fast; for I intend to go in harm's way. -John Paul Jones

(in reply to AlphaSierra)
Post #: 4
RE: LUA Base support - 6/10/2017 2:16:31 AM   
Dan109

 

Posts: 175
Joined: 4/27/2017
Status: offline
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

(in reply to AlphaSierra)
Post #: 5
RE: LUA Base support - 6/10/2017 2:33:42 AM   
michaelm75au


Posts: 13500
Joined: 5/5/2001
From: Melbourne, Australia
Status: offline

quote:

ORIGINAL: AlphaSierra

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

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

_____________________________

Michael

(in reply to AlphaSierra)
Post #: 6
RE: LUA Base support - 6/10/2017 9:19:02 AM   
Dan109

 

Posts: 175
Joined: 4/27/2017
Status: offline
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.

(in reply to michaelm75au)
Post #: 7
RE: LUA Base support - 6/10/2017 9:30:12 AM   
michaelm75au


Posts: 13500
Joined: 5/5/2001
From: Melbourne, Australia
Status: offline
As things are released, I'll move them to normal page.

_____________________________

Michael

(in reply to Dan109)
Post #: 8
RE: LUA Base support - 6/10/2017 10:29:38 AM   
AlphaSierra

 

Posts: 132
Joined: 2/13/2017
Status: offline
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!

_____________________________

I wish to have no connection with any ship that does not sail fast; for I intend to go in harm's way. -John Paul Jones

(in reply to michaelm75au)
Post #: 9
RE: LUA Base support - 6/10/2017 10:32:45 AM   
AlphaSierra

 

Posts: 132
Joined: 2/13/2017
Status: offline
good to know! Thank you

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

_____________________________

I wish to have no connection with any ship that does not sail fast; for I intend to go in harm's way. -John Paul Jones

(in reply to michaelm75au)
Post #: 10
Page:   [1]
All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Tech Support >> LUA Base support 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.158