LUA to delete a group of units? (Full Version)

All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Mods and Scenarios >> Lua Legion



Message


hellfish6 -> LUA to delete a group of units? (2/27/2018 6:59:57 AM)

I'd like to be able to delete an airbase and its defenses, which are grouped together, when an amphibious assault force arrives in an area. Is it possible to do a LUA to delete the whole group, or do I have to delete each and every component?

Thanks




michaelm75au -> RE: LUA to delete a group of units? (2/28/2018 7:03:11 AM)

You should be able. The default mode of ScenEdit_DeleteUnit() is to do one unit.
There is an option on the command to do all units in the group
ScenEdit_DeleteUnit( {table} , true) --- the 'true' should take all the units. [This should be in the current build as it was added during 1.13]




hellfish6 -> RE: LUA to delete a group of units? (2/28/2018 6:15:24 PM)

So in the table to I need to list each component unit or just the name of the group?




michaelm75au -> RE: LUA to delete a group of units? (3/1/2018 7:55:48 AM)

To delete a group 'mygroup'
ScenEdit_DeleteUnit( {side='myside', name='mygroup'} , true)




hellfish6 -> RE: LUA to delete a group of units? (3/2/2018 3:17:37 AM)

Awesome. Thank you very much.




AlphaSierra -> RE: LUA to delete a group of units? (3/2/2018 1:31:12 PM)

I have a Group that I use to teleport units to "randomize it's starting point.

Each unit in the Group has a mission.

I can manually delete/dissolve the group during play (by selecting the group then delete key) causing each unit to "steer" on it's mission.

How can I dissolve the group but maintain the units?

Thank you.







michaelm75au -> RE: LUA to delete a group of units? (3/2/2018 2:05:51 PM)

Just clear the group on the unit.
unit = SE_GetUnit(...)
unit.group =''

quote:

ORIGINAL: AlphaSierra

I have a Group that I use to teleport units to "randomize it's starting point.

Each unit in the Group has a mission.

I can manually delete/dissolve the group during play (by selecting the group then delete key) causing each unit to "steer" on it's mission.

How can I dissolve the group but maintain the units?

Thank you.









AlphaSierra -> RE: LUA to delete a group of units? (3/2/2018 8:02:13 PM)

Great Idea Thanks




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.78125