Page 1 of 1

A note on groups

Posted: Tue May 19, 2020 5:03 pm
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.


RE: A note on groups

Posted: Wed May 20, 2020 3:53 am
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?

RE: A note on groups

Posted: Wed May 20, 2020 4:03 am
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.

RE: A note on groups

Posted: Wed May 20, 2020 3:33 pm
by Gunner98
Thank you

Works great.