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 Command to Drop Contact

 
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 Command to Drop Contact Page: [1]
Login
Message << Older Topic   Newer Topic >>
LUA Command to Drop Contact - 12/14/2021 12:01:51 PM   
tmoilanen

 

Posts: 72
Joined: 10/19/2011
Status: offline
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.
Post #: 1
RE: LUA Command to Drop Contact - 12/15/2021 1:05:03 AM   
KnightHawk75

 

Posts: 1450
Joined: 11/15/2018
Status: offline
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)

< Message edited by KnightHawk75 -- 12/15/2021 1:06:45 AM >

(in reply to tmoilanen)
Post #: 2
Page:   [1]
All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Mods and Scenarios >> Lua Legion >> LUA Command to Drop Contact 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.703