Jump to content

Recommended Posts

Posted

Been searching and searching for a function to remove or delete certain units in my mission. Im not talking about doing it with triggers but with script. I have all my code in place and it works just need a function or something to delete my spawned group.

Posted

PERFECT that's what I need. I just need help using it I can make it work with editor places units but cant with scripted spawned units.

 

Example here my spawn code

ReHeli1 = SPAWN:New( "REHeli" )
ReHeli_Group = ReHeli1:Spawn()

how do I get the group name from that unit. I tried

local myGroup = Group.getByName( ReHeli_Group )
Group.destroy( myGroup )
Group.destroy( ReHeli_Group )

And lots more way ended up using this as a work around for now but its not really a good method incase the spawn name changes.

local myGroup = Group.getByName( "REHeli#001" )
Group.destroy( myGroup )

Posted (edited)

Have you checked out MOOSE? Following MOOSE methods should work:

 

UNIT:FindByName(UnitName)

UNIT:Destroy()

 

 

Something like:

My_Unit = UNIT:FindByName( "ME Unit Name" )
    My_Unit:Destroy()

 

 

How does one turn off the damn smilies??

Edited by Habu_69
Posted
Have you checked out MOOSE? Following MOOSE methods should work:

 

UNIT:FindByName(UnitName)

UNIT:Destroy()

 

 

Something like:

My_Unit = UNIT:FindByName( "ME Unit Name" )
    My_Unit:Destroy()

 

 

How does one turn off the damn smilies??

 

Ya I ened up using this method.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...