Jump to content

Scripting command "ActivateBeacon"


Recommended Posts

Hi,

 

I try to set a TACAN channel on a spawned tanker; That is good with :

 

local controller = group:getController()
local command = { 
id = 'ActivateBeacon', 
params = { 
	type = 4, 
	system = 4, 
	callsign = "TKR", 
	frequency = 1092000000,
}
}
	
controller:setCommand(command)

 

to activate channel 5X Air/air (see linked pdf)

But how to change the mode 5X to 5Y because frequency is the same for both ?

Thanks in advance

VOR-Frequencies-to-TACAN-Channel-list.pdf

Link to comment
Share on other sites

This is a more complete table for 'ActivateBeacon':

local Activate_TACAN = {        
                 
["id"] = "ActivateBeacon",
["params"] = {
  ["type"] = 4,
  ["AA"] = true,  [color="blue"]-- No idea of what it does, probably not required[/color]
  ["callsign"] = "TKR",
  ["modeChannel"] = "X", [color="blue"] -- Maybe this is what you're looking for?[/color]
  ["channel"] = 1, [color="blue"] -- Maybe you're looking for this as well?[/color]
  ["system"] = 4,
  ["unitId"] = 1,  [color="Blue"]-- Probably not required?[/color]
  ["bearing"] = true,
  ["frequency"] = 1088000000,
 }                                            
}


Edited by Hardcard
Link to comment
Share on other sites

DCS Scripting functions

 

Hi Hardcard,

 

Thank for your help.

 

I know that your code is extracted from a mission, but did you test your proposal ?

 

I did some tries with all those parameters. What I now is mission code and scripting functions parameters are sometimes different.

 

But I will try again today to be absolutly sure.

 

My code is working fine for X mode. I think there s a limitation in scripting functions, or one or more parameters are missing in the wiki description.

 

 

  • 5X AA is equivalent of 68X (freq 1092MHz, see the pdf) an AA (Air/Air channel) is the difference between 68 and 63 which result is 5.
  • The frequency is defined in the pdf file. As you can see, 1088 MHz is for 64X. 64 - 63 = 1, so channel 1X (your example)
  • Two more frequencies are needed to set the mode and bearing (VOR Frequency, and RECV frequency - see pdf file).

 

 

 

Sunski


Edited by sunski34
Link to comment
Share on other sites

It is very difficult to make tacan work through scripting but the best way is to do it is to copy miz snippets and adapt them to your situation. These been said, I have struggled for a week to make a beacon activate via scripting for a tanker. I ended up copying the relevant code after I added a ghost tanker on the map with all parameters set. What you will need though is full parameter list:

 

["type"] = 4, -- keep 4 if you are looking for TACAN beacon

["AA"] = true, -- If a tanker then keep true, ships and airports false

["callsign"] = "TKR", -- this will show in your hud

["modeChannel"] = "X", -- X or Y here the only options

["channel"] = 1, -- channel number. It depends on how many channels the aircraft have

["system"] = 4, -- This is TACAN Tanker, keep it 4 if AA is true

["unitId"] = 1, -- Unit id to which beacon is attached. Good if you have a group. Tankers can't be in groups so you can leave this one out. Due to this, it will be very tricky if you want to attach a beacon to a newly spawned unit through scripting

["bearing"] = true, -- similar to the bearing checkbox in ME. Will provide bearing/range

["frequency"] = 1088000000, -- now this is something I am not sure about. This is clearly the frequency but does DCS have FIXED frequencies for all TACAN channels? Because if it's so then you will need to be very precise here or your TACAN won't work.

[sIGPIC]OK[/sIGPIC]

Link to comment
Share on other sites

Hi,

 

I think we don't speak about the same thing.

 

You can set TACAN before using addGroup (spawn) and in that case, surely, what you said is good.

 

In my case, I spawn a tanker without setting TACAN and after, and only after, setting the TACAN using setCommand. That's working perfectly in X mode.

 

I retried today with those parameters :

 

local command = { 
id = 'ActivateBeacon', 
params = { 
	type = 4
	system = 4, 
	callsign = "TKR", 
	frequency = 1092000000,
	AA = true,
	channel = 5,
	bearing = true,
	modeChannel = "Y",
}
}
	
controller:setCommand(command)

 

No change, Y mode isn't set, it's still X mode. So that doesn't work.

 

For sure, TACAN frequencies seem to be OK in DCS . The tests I've done confirm that work perfectly. But I can't change the mode due to a limitation or to a parameter I don't know.

 

Grimes, if you read that thread, do you have an answer?

 

Thanks in advance.


Edited by sunski34
Link to comment
Share on other sites

That is exactly what I have said. And probably Hardcard as well. That is, it is not straightforward to add a TACAN beacon on a newly spawned unit. Whether you use Y or X does not matter. How do you spawn the group? Is it an existing group invisible on the map and you clone its parameters or you create it from scratch? Because if you do the later then the list of the parameters you may miss is quite long. Have you tried MOOSE? They have a very comprehensive functions library and I'd be surprised if they don't have a function to add a TACAN beacon on a unit.

[sIGPIC]OK[/sIGPIC]

Link to comment
Share on other sites

I use my own framework Atme (more than 23000 lines of lua). I don t want to use another framework. Mine works perfectly . That isn t the subject.

 

Spawning is good. Setting the tacan in X mode is ok. So please, if you know how to change tacan mode from X to Y, using setCommand just tell me.

 

Thanks


Edited by sunski34
Link to comment
Share on other sites

local command = { 
id = 'ActivateBeacon', 
params = { 
	type = 4
	system = [b][color="Red"]5[/color][/b], 
	callsign = "TKR", 
	frequency = 1092000000,
	AA = true,
	channel = 5,
	bearing = true,
	modeChannel = "Y",
}
}
	
controller:setCommand(command)

A warrior's mission is to foster the success of others.

i7-8700K | Asus RTX 2080Ti Strix OC | 32 GB Ram 3200 MHz DDR-4 | Asus Maximus Hero X | Samung EVO 960 Pro SSD | VKB Gunfighter Pro | MFG Crosswind | Rift S

RAT - On the Range - Rescue Helo - Recovery Tanker - Warehouse - Airboss

Link to comment
Share on other sites

@funkyfranky : Not possible man, system = 5 correspond to ILS_LOCALIZER

You believe everything you read on the internet?

The right system types are in the BeaconSites.lua in the DCS World OpenBeta\Scripts\World\Radio folder:

--Identifiers of the beacon systems
SystemName = {
PAR_10 = 1,
RSBN_4H = 2,
TACAN = 3,
TACAN_TANKER_MODE_X = 4,
TACAN_TANKER_MODE_Y = 5,
VOR = 6,
ILS_LOCALIZER = 7,
ILS_GLIDESLOPE = 8,
PRMG_LOCALIZER = 9,
PRMG_GLIDESLOPE = 10,	
BROADCAST_STATION = 11,
VORTAC = 12,
TACAN_AA_MODE_X = 13,
TACAN_AA_MODE_Y = 14,
VORDME = 15,
ICLS_LOCALIZER = 16,
ICLS_GLIDESLOPE = 17,
}

And if system = 4 that doesn't work as I said before.

No, of course it does not and I told you why :music_whistling:

Just try it and you will see

Oh, I'm using it for years and it works like a charm ;)

A warrior's mission is to foster the success of others.

i7-8700K | Asus RTX 2080Ti Strix OC | 32 GB Ram 3200 MHz DDR-4 | Asus Maximus Hero X | Samung EVO 960 Pro SSD | VKB Gunfighter Pro | MFG Crosswind | Rift S

RAT - On the Range - Rescue Helo - Recovery Tanker - Warehouse - Airboss

Link to comment
Share on other sites

Oh...

 

I don't believe all I read on Internet, but DCS wiki sources are generaly ok. So I will test. I think you don't need other thing than frequency.

 

If that is ok, I will write that here.

 

Thanks in advance if the lua struct you send me is the good one.

Sunski

Link to comment
Share on other sites

I use my own framework Atme (more than 23000 lines of lua). I don t want to use another framework. Mine works perfectly . That isn t the subject.

 

Spawning is good. Setting the tacan in X mode is ok. So please, if you know how to change tacan mode from X to Y, using setCommand just tell me.

 

Thanks

 

Apologizes for trying.

[sIGPIC]OK[/sIGPIC]

Link to comment
Share on other sites

That's ok...

 

A great thanks for funkyfranky. :thumbup:

 

That's ok.

 

For Y mode for tanker, in that case 5Y :

 

local command = { 
id = 'ActivateBeacon', 
params = { 
	type = 4
	system = 5, 
	callsign = "TKR", 
	frequency = 1092000000,
}
}
	
controller:setCommand(command)

 

So I will try to do the same with Stennis.

 

Hope the DCS wiki will be update !

Link to comment
Share on other sites

Non AA Tacan uses the Recv frequencies defined in the pdf file (see first post).

 

Both X and Y works (because recv freq are different for each mode X or Y), but when using Y mode, no bearing.

 

I can set ICLS either on the stennis using ActivateBeacon :

 

local freq = 15415000000 + 30000000 * ((channel - 1) % 10)
				
local command = { 
id = 'ActivateBeacon', 
params = {
        type = 131328,
        system = 16,
	frequency = freq,
}
}
				
controller:setCommand(command)
				
command = { 
id = 'ActivateBeacon', 
params = {
	type = 131584,
	system = 17,
	frequency = freq,
}
}
				
controller:setCommand(command)

 

channel is the ICLS channel you want to use.

 

Hope that help.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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