A Hamburgler Posted May 10, 2018 Posted May 10, 2018 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.
edokg Posted May 10, 2018 Posted May 10, 2018 Check this... http://wiki.hoggit.us/view/DCS_func_destroy [sIGPIC]https://forums.eagle.ru/signaturepics/sigpic128931_4.gif[/sIGPIC] SO:Win10 64bit CPU:Intel i7 8700K@3.7 RAM:DDR4 46GB G.Skill Trident 3200MHz CL14 GPU:Nvidia EVGA GTX1080Ti FTW iCX MB:ASRock Z370 Extreme4 HDD: 512GB Samsung 970 PRO SSD M.2 NVMe + 250GB Samsung 850 EVO SSD + 2x500GB Seagate Barracuda 7200RPM
A Hamburgler Posted May 10, 2018 Author Posted May 10, 2018 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 )
Habu_69 Posted May 13, 2018 Posted May 13, 2018 (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 May 13, 2018 by Habu_69
A Hamburgler Posted May 14, 2018 Author Posted May 14, 2018 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.
Recommended Posts