Jump to content

LUA - Check if a unit received a radio transmission?


Igneous01

Recommended Posts

Is there a way to check if a unit has received a radio transmission, or query a units current radio frequency and active radio to validate that they can send said message to a unit?

 

I have some radio items that I add for the player, which are used to communicate with some ai units on various frequencies and channels. What I would like to do is validate that the player is on the correct radio and frequency before executing the radio task trigger and removing the radio action (otherwise keep the action there).

 

I have this setup with a bunch of triggers per message:

 

1. Radio action (Flag 1, val:1)

2. (Action Used + Cockpit Arguments) Trigger detects when flag1 equals 1, and cockpit arguments are in range for radio knobs, sets flag 2 to true

3. (Valid Transmission - Send Message) Trigger checks if flag1 is 1, and flag 2 is true, sends message to player via radio transmission and removes radio item

4. (Invalid Transmission - Expire Message) Trigger checks if flag1 has been equal to 1 for more than 3 seconds, resets to 0 (essentially a radio expired trigger)

 

I find this gets quite complex when you have lets say 3 or more of these actions (now you have 12 triggers you need to manage in your mission, and I find the triggers list gets really unwieldy after 20). I'd like to cut away the cockpit arguments check/expire check so that I really only need the radio action and the valid/invalid trigger with a reusable script so there's less debugging involved.

 

I was looking at ways of creating triggers via lua but I cant find any documentation for it. Also cant find any info about checking valid radio setup.

 

Is what I am asking for possible?

Developer of Kaukasus Insurgency - a customizable Dynamic PvE Campaign with cloud hosting and stats tracking. (Alpha)

 

http://kaukasusinsurgency.com/

Link to comment
Share on other sites

Not currently. Knowing cockpit arguments is one of the few things that isn't accessible to the scripting engine.

The right man in the wrong place makes all the difference in the world.

Current Projects:  Grayflag ServerScripting Wiki

Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread)

 SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum

Link to comment
Share on other sites

  • Recently Browsing   0 members

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