Scripting command "ActivateBeacon" - ED Forums
 


Notices

Reply
 
Thread Tools Display Modes
Old 08-13-2019, 05:12 AM   #1
sunski34
Member
 
Join Date: Mar 2015
Location: France - Montpellier
Posts: 658
Default Scripting command "ActivateBeacon"

Hi,

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

Code:
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
Attached Files
File Type: pdf VOR-Frequencies-to-TACAN-Channel-list.pdf (59.9 KB, 10 views)
sunski34 is offline   Reply With Quote
Old 08-13-2019, 12:44 PM   #2
Hardcard
Member
 
Hardcard's Avatar
 
Join Date: May 2013
Posts: 606
Default

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

Last edited by Hardcard; 08-13-2019 at 12:50 PM.
Hardcard is offline   Reply With Quote
Old 08-13-2019, 03:03 PM   #3
sunski34
Member
 
Join Date: Mar 2015
Location: France - Montpellier
Posts: 658
Default

I tried that without succes. modeChannel doesnt change anything
sunski34 is offline   Reply With Quote
Old 08-13-2019, 08:32 PM   #4
Hardcard
Member
 
Hardcard's Avatar
 
Join Date: May 2013
Posts: 606
Default

Well, I took that directly from a mission file, if it doesn't work, perhaps there's some kind of conflict going on (or missing data).

Can you post the exact code you're using in your tests?
Hardcard is offline   Reply With Quote
Old 08-14-2019, 04:39 AM   #5
sunski34
Member
 
Join Date: Mar 2015
Location: France - Montpellier
Posts: 658
Default 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

Last edited by sunski34; 08-14-2019 at 04:44 AM.
sunski34 is offline   Reply With Quote
Old 08-14-2019, 07:16 AM   #6
Hardcard
Member
 
Hardcard's Avatar
 
Join Date: May 2013
Posts: 606
Default

Well, good luck with this
Hardcard is offline   Reply With Quote
Old 08-14-2019, 07:49 AM   #7
Zayets
Member
 
Join Date: Oct 2005
Location: Australia
Posts: 307
Default

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:

Quote:
["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.
__________________
OK
Zayets is offline   Reply With Quote
Old 08-14-2019, 09:08 AM   #8
sunski34
Member
 
Join Date: Mar 2015
Location: France - Montpellier
Posts: 658
Default

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 :

Code:
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.

Last edited by sunski34; 08-14-2019 at 09:11 AM.
sunski34 is offline   Reply With Quote
Old 08-14-2019, 09:28 AM   #9
Zayets
Member
 
Join Date: Oct 2005
Location: Australia
Posts: 307
Default

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.
__________________
OK
Zayets is offline   Reply With Quote
Old 08-14-2019, 10:59 AM   #10
sunski34
Member
 
Join Date: Mar 2015
Location: France - Montpellier
Posts: 658
Default

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

Last edited by sunski34; 08-14-2019 at 11:03 AM.
sunski34 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT. The time now is 01:56 PM. vBulletin Skin by ForumMonkeys. Powered by vBulletin®.
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.