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 OutOfComms

 
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 OutOfComms Page: [1]
Login
Message << Older Topic   Newer Topic >>
LUA OutOfComms - 10/22/2018 7:21:30 PM   
De Savage

 

Posts: 78
Joined: 6/16/2014
Status: offline
I want to simulate COM JAMMER and create area (four RP points) where enemy side will have nocomms and when they exit the area comms are back.

First I created event for unit entering, but cant figure out how to check UnitX and make it out of comms. And also I can't figure out how to get comms back after leaving area. Have anyone made this kind of LUA?

My example:

local unit = ScenEdit_UnitX()
ScenEdit_SetUnit({Side=”Japan”, unitname=UnitxX(), methodOutOfComms=”True”})

Post #: 1
RE: LUA OutOfComms - 10/23/2018 8:32:37 AM   
michaelm75au


Posts: 13197
Joined: 5/5/2001
From: Melbourne, Australia
Status: offline
I don't think I have a function to change the OOC as it is relies on several factors. The unit wrapper only shows the state of it.
Someone else asked about this the other week, and I was going to see what is involved.

_____________________________

Michael

(in reply to De Savage)
Post #: 2
RE: LUA OutOfComms - 10/23/2018 12:31:26 PM   
michaelm75au


Posts: 13197
Joined: 5/5/2001
From: Melbourne, Australia
Status: offline
I have been reviewing the code, and you should be able to turn OUTOFCOMMS on and off.

local unit = ScenEdit_UnitX()
ScenEdit_SetUnit( {side = unit.side, unitname = unit.name, outofcomms = true} )

< Message edited by michaelm75au -- 10/23/2018 12:34:41 PM >


_____________________________

Michael

(in reply to michaelm75au)
Post #: 3
RE: LUA OutOfComms - 3/28/2021 1:35:08 PM   
Parel803

 

Posts: 385
Joined: 10/10/2019
From: Netherlands
Status: offline
Good afternoon,

Hope someone can point me in the right direction and telling me what I'm doing wrong:


local Unit = ScenEdit_GetUnit({name='Protector USV [Typhoon, Armed] #1', guid='50PVO4-0HM7FN02G2FE9'})
-- out of comms
ScenEdit_SetUnit({side = Unit.side, guid=Unit.guid, outOfComms = true})
print (Unit.outOfComms)

probably something like a typo but not seeing it

with regards Gert-Jan

(in reply to michaelm75au)
Post #: 4
RE: LUA OutOfComms - 3/28/2021 6:24:19 PM   
musurca

 

Posts: 76
Joined: 7/16/2020
Status: offline
Here's the function I use internally, taking a Unit wrapper unit and a boolean commsState:

function Unit_SetOutOfComms(unit, commsState)
ScenEdit_SetUnit({guid=unit.guid, outOfComms=commsState})
end


Just tested it on 1147.18, and seemed to work okay. Your code looks close and I don't immediately see why the code you posted above wouldn't work. However I would note that you don't need to provide a side if you're also providing the GUID to _SetUnit (the GUID is unique among all units regardless of side). Possibly that's the issue?

(in reply to Parel803)
Post #: 5
RE: LUA OutOfComms - 3/29/2021 7:47:31 PM   
Parel803

 

Posts: 385
Joined: 10/10/2019
From: Netherlands
Status: offline
Thank you for your time and answer,
with regards Gert-Jan

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