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 to delete a group of units?

 
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 >> Mods and Scenarios >> Lua Legion >> LUA to delete a group of units? Page: [1]
Login
Message << Older Topic   Newer Topic >>
LUA to delete a group of units? - 2/27/2018 6:59:57 AM   
hellfish6


Posts: 833
Joined: 6/15/2008
Status: offline
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

_____________________________

Post #: 1
RE: LUA to delete a group of units? - 2/28/2018 7:03:11 AM   
michaelm75au


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

_____________________________

Michael

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


Posts: 833
Joined: 6/15/2008
Status: offline
So in the table to I need to list each component unit or just the name of the group?

_____________________________


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


Posts: 12791
Joined: 5/5/2001
From: Melbourne, Australia
Status: offline
To delete a group 'mygroup'
ScenEdit_DeleteUnit( {side='myside', name='mygroup'} , true)

_____________________________

Michael

(in reply to hellfish6)
Post #: 4
RE: LUA to delete a group of units? - 3/2/2018 3:17:37 AM   
hellfish6


Posts: 833
Joined: 6/15/2008
Status: offline
Awesome. Thank you very much.

_____________________________


(in reply to michaelm75au)
Post #: 5
RE: LUA to delete a group of units? - 3/2/2018 1:31:12 PM   
AlphaSierra

 

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





_____________________________

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 #: 6
RE: LUA to delete a group of units? - 3/2/2018 2:05:51 PM   
michaelm75au


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







_____________________________

Michael

(in reply to AlphaSierra)
Post #: 7
RE: LUA to delete a group of units? - 3/2/2018 8:02:13 PM   
AlphaSierra

 

Posts: 132
Joined: 2/13/2017
Status: offline
Great Idea Thanks

_____________________________

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 #: 8
Page:   [1]
All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Mods and Scenarios >> Lua Legion >> LUA to delete a group of units? 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

0.133