Jump to content

Interactive radio communications?


TheHighwayman

Recommended Posts

I am working on a mission that involves one pilot speaking to another. I'd like the interaction to be a little dynamic. Specifically, the player gets to choose between 1-2 or three responses, and a "correct" response improves the outcome while an "incorrect" response contributes to a consequence.

 

I would then need to link the player selections to triggers or flags.

 

But how do I implement this? I have not tampered with radio communications before. However, I have seen custom responses in a user designed mission, although that was about 1-2 installs ago.

 

Thanks for your help.

Link to comment
Share on other sites

"Add radio items". Each radio item is associated with a flag that you can use to trigger whatever you want. You can also use "Remove Radio Item" so the F10 menu, which is item limited, does not get clogged with replies.

 

Thank you. I've +1 repped you for helpful information. :)

Link to comment
Share on other sites

You are given a little more flexibility with the scripting engine. Primarily you can create submenues which are quite handy if you have a lot of radio options you want to have in a mission.

 

http://wiki.hoggit.us/view/DCS_func_addSubMenu

  • Like 1

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

Thank you.

 

I'm not sure I know how to read and understand what those lines do?

 

I mean, is there a Rosetta stone kind of resource/key where it explains what each bit does? I need to learn the language.

 

I understand triggers quite well. But scripting is new to me. I know you can do a lot with it.

 

Thanks!

Link to comment
Share on other sites

With the wiki I've tried to organize everything so it should be pretty easy to understand. Part of the problem is you also need a basic understanding of programming, specifically lua, to start to have fun with it. You can look at this thread: https://forums.eagle.ru/showthread.php?t=120355 to give you some basic resources to look at.

 

On the wiki the functions are color coded to represent what is returned and what the input values are for each function. Orange is what is returned, black is the function name. Blue required values. Green are optional. For blue and green anything in bold is the type of value it is, while italics is just a short description of what could be in there. From the page for addCommand there function is listed as: missionCommands.addCommand(string name, table/nil path, function functionToRun , any anyArguement)

name is what the function will appear as in the menu

path is if it needs to be in a submenu

function is the name of the function to be called

anyArgument is anything that needs to be passed to the function.

 

 

 

I expanded the example from the wiki to help you understand whats going on...

 

local function doRequestFunction(input)
if input.type == 'SEAD' then

elseif input.type == 'CAS' then

elseif input.type == 'CAP' then

end
end

local requestM = missionCommands.addSubMenu('Request Asset')
local rSead = missionCommands.addCommand('SEAD', requestM, doRequestFunction, {type = 'SEAD"})
local rCAS = missionCommands.addCommand('CAS', requestM, doRequestFunction, {type = 'CAS"})
local rCAP= missionCommands.addCommand('CAP', requestM, doRequestFunction, {type = 'CAP"})

 

So this makes a submenu listed as "Request Asset..." in the menu. The ... is added at the end and indicates there are options nested within. If you select it you will then see "SEAD", "CAS", and "CAP" listed in the menu. If you select one of them it will call the function doRequestFunction and pass the argument. In this instance it is just passing where which command was sent to the function, which can do whatever it wants with that information from there.

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