Jump to content

Trigger when player tuned to a specific frequency?


ScopeDope

Recommended Posts

What the title says, is it possible to have a trigger for when the player is tuned to a specific frequency?

 

I'm trying to make a mission with semi-realistic radio management. Example: I want to tune to ground control frequency, and when tuned, have the F10 radio menu add an option to request taxi. Basically I want to bypass the terrible in-game ATC with something more realistic.

 

Does the "cockpit param" do this? If so, what's the Param?

Link to comment
Share on other sites

Another option is to use zones and "transmit sound over frequency" triggered unit actions. I have done this in missions where on startup, the tower directs the player to tune a specific freq. Once the player taxis out of the zone, a local unit transmits a message on that freq. It can simulate hand offs and such, or interactions with a JTAC for instance. It is limited to the transmission range of the unit.

Moe "Moespeeds" Colontonio

vVMA 231

http://www.vvma-231.com/

Looking for a serious US based Harrier Squadron? We are recruiting!

 

Link to comment
Share on other sites

Another option is to use zones and "transmit sound over frequency" triggered unit actions. I have done this in missions where on startup, the tower directs the player to tune a specific freq. Once the player taxis out of the zone, a local unit transmits a message on that freq. It can simulate hand offs and such, or interactions with a JTAC for instance. It is limited to the transmission range of the unit.

 

That works fine for listening, but I don't want to inject the F10 option to request taxi until they actually tune the frequency. I forsee people without radio management experience just mashing request taxi, and then getting frustrated that tower isnt saying anything because they aren't on the right freq. Then they figure it out and now tower wont say anything because the trigger already fired.

Link to comment
Share on other sites

Understood. The way around this is to send a message/sound to the player when they enter the jet using "Sound to Group". Something like "Shank 1 you are cleared for startup, taxi right and hold short for runway 17, then tune 143 mhz and contact the tower on F10." This gets them started on the chain. Once they start moving the aircraft, into or out of a zone, you can then trigger the radio item add to request takeoff, and play the sound/message over 143 MHZ. From there you can just direct them to each handoff using zones and or actions. To my knowledge, there is no way to trigger an action by tuning a specific freq.

Moe "Moespeeds" Colontonio

vVMA 231

http://www.vvma-231.com/

Looking for a serious US based Harrier Squadron? We are recruiting!

 

Link to comment
Share on other sites

ScopeDope, if you do ever figure it out, please let us know. I really wanted to do something like this, but ended up just scripting the comms automatically when a player entered a zone. It's evident in my Red Flag or Eastern Friendship missions. High realism, but no interaction. :-)

 

Thanks guys. I enjoyed your missions too btw Sedlo. If you ever need a consult with a RL ATCer, I'm your guy. Few years USAF, current FAA center controller.

Link to comment
Share on other sites

Yes, the caveat is that those triggers only work for a "Player" type aircraft and thus, only in single player.

The parameter itself you need to look for will vary from module to module. I believe you can view all cockpit arguments and their ranges in the model viewer.

I've wanted to do this, too, and haven't been able to find the model viewer.

 

 

Where is it?

Very Respectfully,

Kurt "Yoda" Kalbfleisch

London

"In my private manual I firmly believed the only time there was too much fuel aboard any aircraft was if it was fire." --Ernest K. Gann

 

Link to comment
Share on other sites

  • 4 weeks later...

I've been messing around with this idea today.... And I can't seem to figure it out!

 

Specifically for the Hornet, since it's got a digital display for the frequency digits and channel indicators, I think we need to have the

 

"X Cockpit Indication Text is Equal to:"

 

I cannot find a way to determine the INDICATOR ID or the ELEM NAME values.... I've been beating my head against the wall, I'm thinking it requires CONSOLE, which doesn't seem available to the general public.

 

Can anyone determine these values for the Hornet?

Link to comment
Share on other sites

  • 1 month later...

Folks, for the Harrier or Hornet, this is what you're looking for:

 

TYPE: COCKPIT PARAMETER EQUAL TO:

PARAM: COMM1_FREQ

VALUE: 123.45

 

(note the underscore between COMM1 and FREQ above)

 

Substitute COMM2 for the rightside radio. The value is whatever frequency you desire (as long as it's tuneable by the radio, it should work)

 

For the UH-1 and F-5E, the PARAM Value is different. Haven't tried this so far on other modules.

 

TYPE: COCKPIT PARAMETER EQUAL TO:

PARAM: UHF_FREQ

VALUE: 364.2

 

It took me several hours of scouring the forums and the lua code for this, plus a lot of trial and error to figure it out.

 

I hope this helps everyone, and I hope helps mission builders create more realistic missions.

 

BOLD CHEETAH will feature this kind of stuff, for sure! :-)

  • Like 3
Link to comment
Share on other sites

Folks, for the Harrier or Hornet, this is what you're looking for:

 

TYPE: COCKPIT PARAMETER EQUAL TO:

PARAM: COMM1_FREQ

VALUE: 123.45

 

(note the underscore between COMM1 and FREQ above)

 

Substitute COMM2 for the rightside radio. The value is whatever frequency you desire (as long as it's tuneable by the radio, it should work)

 

For the UH-1 and F-5E, the PARAM Value is different. Haven't tried this so far on other modules.

 

TYPE: COCKPIT PARAMETER EQUAL TO:

PARAM: UHF_FREQ

VALUE: 364.2

 

It took me several hours of scouring the forums and the lua code for this, plus a lot of trial and error to figure it out.

 

I hope this helps everyone, and I hope helps mission builders create more realistic missions.

 

BOLD CHEETAH will feature this kind of stuff, for sure! :-)

 

Seldo, this is an awesome puzzle solve! Well done! Thank you...

 

It's a shame there isn't an equally elegant way to remove the F10 Radio menu option once tuned away from the given frequency.

I've tried a few various options but, alas, they did not work at all or were really laborious and still didn't have quite the desired effect.

 

The most likely candidate is the 'COCKPIT PARAMETER IN RANGE' condition, but that doesn't allow the same 'VALUE' inputs as the 'EQUAL TO' condition. A shame.

 

Having the option to easily add and remove F10 'other' menu entries based on tuned frequency would be an awesome tool for mission building and immersion.

 

Thanks to your work and digging we have one half of the equation, however. :thumbup:

9700k@5.2Ghz | GTX 1080ti | 32gb Ram@3200Mhz | 512gb M.2 NVME SSD

Oculus Rift S | VKB GF Pro Mk.II+MCG Pro (rotary wing) | BRD DS-Raven (fixed wing) | MFG Crosswind V2 | Jetseat+SSA/SSM | SimLab GT1 80/20 Rig | NLR Motion Platform V3 | Quad Bass Shaker Setup

DIY Control Panels: 'White Rhino' Throttle | UFC | MFBB Left | MFBB Right | MFBB Centre | WEP-TECH ACP | HYD-MECH LDG | SYS-ELEC | AN/ARC Radio

Link to comment
Share on other sites

  • 2 weeks later...

Just an update, the above works with a caveat. It seems that when the frequency has more than one digit after the decimal, tuning the radio via the presets will not trigger the action. You can manually plug a frequency in, but if it has more than 2 digits after the decimal, presets won't work.

 

ie: 245.55 no go for presets

245.5 will work with presets

  • Thanks 1
Link to comment
Share on other sites

  • 3 weeks later...
  • 1 month later...

Hey Heatblur and anyone who might know.... I'm trying to port the F-14 to another series of missions I've built. In those, I am able to set a flag when a player is tuned to a specific frequency. I do this by using the Cockpit Parameter condition in the ME.

 

For the Hornet, the radio cockpit parameters are COMM1 and COMM2

 

For the life of me, I cannot find the ones for the Tomcat. Can anyone help out? I"ve tried all sorts of iterations and have gone through a lot of the lua but cannot seem to find the values I'm looking for.

 

Please help if you can!

  • Thanks 1
Link to comment
Share on other sites

  • 2 years later...
  • 3 weeks later...

I'm going to keep pushing forward with my necromancy practices here and bring this thread forth from the grave once more. Further more to this discussion from yesteryear, would someone happen to know what the condition parameter for the Hind radio's would be?

  • Like 1
Link to comment
Share on other sites

12 hours ago, Gunnar81 said:

I'm going to keep pushing forward with my necromancy practices here and bring this thread forth from the grave once more. Further more to this discussion from yesteryear, would someone happen to know what the condition parameter for the Hind radio's would be?

@Gunnar81they are:

VHF_AM_FREQ
HF_AM_FREQ
UHF_FREQ


Edited by Sedlo
Link to comment
Share on other sites

  • 2 months later...

Related to more realistic radio comms: 

 

Old thread but problem remains. I started to post this in the "wish list" but want to run it by you all here first to see if anyone's found a way around it. I have what @ScopeDope hinted at working but it's limited.  Also, if @Grimes has any insight I'd appreciate it.

NOTE: This is about finding a solution WHOLLY contained with the ME/Scripting engine; NOT requiring any changes to any lua files settings or external apps/processes - just drop it in and hit "fly".

First my question (that I was going to post) in the Wish List thread:

An API to query what frequency the PLAYERS's radio is currently set to. As I understand it right now, all you can do is ask, in the ME via a trigger, if a specific frequency is set on a specific radio when a flag is set (assuming you know the 'code' for the equipment). 

Example:

local frequency = xxx:getFrequency(COMM1_FREQ) < for the Hornet for example.

This would make it MUCH easier to have a 'conversation' with the AI - if you don't have the correct frequency set when you click a menu item (to say something to the AI) then they won't answer you. Currently I have to set a flag; wait for the ME to respond, testing for that specific frequency value

---------------------

What I've done - it's offensive to even my limited skills but the only way I've been able to get something that resembles the "real world":

- Limit the number of frequencies ('freq's') as I have to 'poll' (REPEAT CONDITION| via X:COCKPIT PARAM EQUAL TO)... and I don't want to have one of these for every possible freq, naturally. In practice it is 'okay' to limit the number since within a mission I'm only using 4 -5 freq's anyway. The tactical ones are 'coded' (BLUE1, RUBY2, etc). Allows me to use the same freq's in the ME (editing them is a pain) but change the 'code' elsewhere. Just for some semblance of variety.

- "Establish Comms" or establish a "connection" between the player (this is all for SP) when you get transferred to a freq via the F10 | "Check On" mechanism.

- Now the fun part (note the code below isn't an exact translation in the hopes of making it somewhat readable)

Using the X:COCKPIT PARAM EQUAL TO thingy - When the player clicks "Check On" (I use the same generic string for all to allow use in VAICOM) this ends up happening:

Spoiler

[EDIT: I REPEAT trigger here but plan to change to SWITCHED CONDITION...]

XXX.MenuResponse = Function(_params)

    XXX.FreqTrasmittedOn = 0 -- reset everything for this transmission

    -- scale the freq to effectively make it a whole number: flags don't seem to allow a floating point value 

    local setVal = XXX.Agent.freq.uhf * Comms.freqFlagScale

    -- set a flag to that value thereby 'firing' the REPEAT CONDITION

    trigger.action.setUserFlag(FLAG_FREQCHECK, setVal)

    -- Now we have to wait for the CONDITION to respond to our query. 1.0 seconds as that is the rate these things are processed; may need fine tuning.
    timer.scheduleFunction( _params.fxn,  _params.val,  timer.getTime() + 1.0)
end

-- If the REPEAT CONDITION fires from the ME we "DO SCRIPT" on this fxn, passing the freq value.

XXX.ME_PlayerTransmittingOnFreq = function(_val)

   if _val == Agent.freq.uhf then

        XXX.FreqTrasmittedOn = _val -- else it still == 0

   end

end

-- fxn (_params.fxn above) used for establishing comms between player and AI. Used for both chekcing ON (true) and OFF (false - a request for "off freq" happens in the real world and makes other parts of the system easier)

XXX.EstablishComms = function(_checkingOn) 

    trigger.action.setUserFlag(FLAG_FREQCHECK, 0) -- stop the REPEAT CONDITION in ME

    if XXX.FreqTransmittedOn = XXX.Agent.freq.uhf then

        if _checkingOn then

            XXX.Agent.PlayerIsCheckedOn = true

           XXX.Agent.SaySomethingWittyWhenPlayerChescksON()

       else

            XXX.Agent.PlayerIsCheckedOn = false

            XXX.Agent. SayRogerReportBackUp()

        end

    end

end

The AI will now be free to transmit other applicable stuff to the player because in it's feeble brain it knows you are "there". It wont, for example, say anything to you if Agent.PlayerIsCheckedOn == false. Any further directives/info goes into a stack, waiting for this to be true. And of course the AI won't 'hear' you if you've clicked the transmit item but the radio isn't set to that AI's freq.

This is ugly and not precise but in practice works "ok". A simple: getCockpitParam(_param) in the scripting engine would seem to eliminate a lot of the the above machinations.

If ANYBODY see this and goes, "why didn't you do it THIS way" please feel free to point out my ignorance.

Thanks

JR


Edited by jross194

i6700k 4.4mhz, 32Gb, nVidia 1080, Odyssey+, CH Products, Derek Speare Designs button box, Bass shaker w/SimShaker For Aviators

Link to comment
Share on other sites

  • 10 months later...
Am 21.12.2018 um 03:35 schrieb Sedlo:

Folks, for the Harrier or Hornet, this is what you're looking for:

 

TYPE: COCKPIT PARAMETER EQUAL TO:

PARAM: COMM1_FREQ

VALUE: 123.45

 

(note the underscore between COMM1 and FREQ above)

 

Substitute COMM2 for the rightside radio. The value is whatever frequency you desire (as long as it's tuneable by the radio, it should work)

 

For the UH-1 and F-5E, the PARAM Value is different. Haven't tried this so far on other modules.

 

TYPE: COCKPIT PARAMETER EQUAL TO:

PARAM: UHF_FREQ

VALUE: 364.2

 

It took me several hours of scouring the forums and the lua code for this, plus a lot of trial and error to figure it out.

 

I hope this helps everyone, and I hope helps mission builders create more realistic missions.

 

BOLD CHEETAH will feature this kind of stuff, for sure! 🙂

Did you also know the PARAM for the other UH-1 Radios? The VHF and the FM Radio? 

I tried a couple of combinations like VHF_FREQ but did not get it to work. Where did you find it in the lua? 

Link to comment
Share on other sites

On 3/13/2019 at 6:10 PM, Sedlo said:

For the life of me, I cannot find the ones for the Tomcat. Can anyone help out?


Sorry, just became aware of this thread today … the parameters for the F-14B are:

COMM1_FREQ

COMM2_FREQ

 

For work: iMac mid-2010 of 27" - Core i7 870 - 6 GB DDR3 1333 MHz - ATI HD5670 - SSD 256 GB - HDD 2 TB - macOS High Sierra

For Gaming: 34" Monitor - Ryzen 3600X - 32 GB DDR4 2400 - nVidia GTX1070ti - SSD 1.25 TB - HDD 10 TB - Win10 Pro - TM HOTAS Cougar - Oculus Rift CV1

Mobile: iPad Pro 12.9" of 256 GB

Link to comment
Share on other sites

  • Recently Browsing   0 members

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