LUA Command to Drop Contact (Full Version)

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



Message


tmoilanen -> LUA Command to Drop Contact (12/14/2021 12:01:51 PM)

How do you drop a contact via LUA?

I created a Unit Remains in Area Trigger for x time, after which the airfield group changes to the red side via the code below. The airfield still remains as a contact on the red side after this event, and I would like to add syntax that drops the contact.

local myside = 'AIRCOM'
local mynewside = 'VKS'
local myname = {'Kirkenes Airport'}

for i = 1, #myname
do

ScenEdit_SetUnitSide({side=myside,name=myname[i],newside=mynewside})

end


Any help would be appreciated.




KnightHawk75 -> RE: LUA Command to Drop Contact (12/15/2021 1:05:03 AM)

Once you get the contact wrapper from the side in question's perspective you can just call wrapperVar:DropContact();

local c = GetContact(side='oldside',guid='TheContactGuidHere') --reminders it's not the same as unit guid.
c:DropContact()

While back you can find example of something similar:
https://www.matrixgames.com/forums/tm.asp?m=4821501 (#10 shows cleaning up the contact)




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.6875