TheHighwayman Posted August 23, 2017 Share Posted August 23, 2017 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 More sharing options...
BaD CrC Posted August 23, 2017 Share Posted August 23, 2017 "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. 1 https://www.blacksharkden.com http://discord.gg/blacksharkden Link to comment Share on other sites More sharing options...
TheHighwayman Posted August 23, 2017 Author Share Posted August 23, 2017 "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 More sharing options...
Grimes Posted August 23, 2017 Share Posted August 23, 2017 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 1 The right man in the wrong place makes all the difference in the world. Current Projects: Grayflag Server, Scripting 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 More sharing options...
TheHighwayman Posted August 24, 2017 Author Share Posted August 24, 2017 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 More sharing options...
Grimes Posted August 24, 2017 Share Posted August 24, 2017 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 Server, Scripting 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 More sharing options...
TheHighwayman Posted August 26, 2017 Author Share Posted August 26, 2017 Thank you, this is exactly what I needed! Link to comment Share on other sites More sharing options...
Recommended Posts