A note on groups

All discussions & material related to Command's Lua interface

Moderators: RoryAndersonCDT, michaelm75au, angster, MOD_Command

Post Reply
User avatar
Gunner98
Posts: 5998
Joined: Fri Apr 29, 2005 12:49 am
Location: The Great White North!
Contact:

A note on groups

Post by Gunner98 »

On the Command Lua page there is a note in the Unit table:

group Group The unit's group (if applicable). Can be changed assigning an existing or new name. It will try to create a group if new (experimental)

So the experimental bit does not seem to be working but if the group already exists it all works fine. I built a work-around but it would be nice if you could add a bunch of units and have the group form with them.

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/
KnightHawk75
Posts: 1850
Joined: Thu Nov 15, 2018 7:24 pm

RE: A note on groups

Post by KnightHawk75 »

Code: Select all

 local u
 u = ScenEdit_AddUnit({type = 'Aircraft', name = 'F-22 single43', loadoutid = 4526,
     heading = 0, dbid = 3821, side = 'Blue', Latitude="N00.50.00",Longitude="E0.50.00",
     altitude="40000 ft",autodetectable="false",holdfire="true",proficiency=4,speed=350});
 u.group='test1'
 u = ScenEdit_AddUnit({type = 'Aircraft', name = 'F-22 single44', loadoutid = 4526,
     heading = 0, dbid = 3821, side = 'Blue', Latitude="N00.50.00",Longitude="E0.50.01",
     altitude="40000 ft",autodetectable="false",holdfire="true",proficiency=4,speed=350});
 u.group='test1'
 
Has been working for me, and 'test1' group did not exist prior, is it a problem with just a particular unit type?
User avatar
michaelm75au
Posts: 12465
Joined: Sat May 05, 2001 8:00 am
Location: Melbourne, Australia

RE: A note on groups

Post by michaelm75au »

It should try to create a new Group as shown above. In the old days, I wasn't sure if it was going to do the right thing. Should correct that in the Lua page.
Michael
User avatar
Gunner98
Posts: 5998
Joined: Fri Apr 29, 2005 12:49 am
Location: The Great White North!
Contact:

RE: A note on groups

Post by Gunner98 »

Thank you

Works great.
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 Reply

Return to “Lua Legion”