Jump to content
johnnyboy

[Release] JBOY Say Module Sentence

Recommended Posts

Here's another script from my Property of Mabunga mission.  If you've tried that mission, please rate and comment on Steam.  I'm hoping to get enough ratings to merit "stars" on steam before Apex/Tanoa is released (once Tanoa is released, Altis missions will get less attention).

 

This script encapsulates the 4 or 5 lines needed to make any unit in your mission say the radio commands used by the Support Modules (i.e., Call in Artillery, CAS, Transport Request, etc.).  This scripts advantages are:

 

1)  Single procedure call can be used anywhere

2) Time delay parameter allows you to execute multiple sentences from a trigger, with time delays (so radio calls don't overlap).  This solves problem where Sleep statement not allowed in a trigger.

 

Credit:  A great post from Larrow made it easy to understand the kbTopic commands.

 

(BTW, here's a better clip of the Mabunga Voodoo Dancers if you want to see it. :) )

 

In a trigger, put these 2 lines of code to execute a Request followed by an Acknowledgement.  Note 5 second delay parameter in second line.

nul=[player, player, 0, "CAS_Bombing_Request"] execvm "Scripts\JBOY_SayModuleSentence.sqf";  
nul=[airSupportHQdude, player, 5, "CAS_Bombing_Acknowledged"] execvm "Scripts\JBOY_SayModuleSentence.sqf"; 

Create a file in you mission directory called  and put this code in it:

//////////////////////////////////////////////////////////
// JBOY_SayModuleSentence.sqf 
// By: johnnyboy
// Credits:  Larrow for very helpful posts on this topic:  https://forums.bistudio.com/topic/171557-radio-sound-files-from-hq/
//
// Why use this?  It encapsulates 4 lines of code into a single procedure call, and allows you to use it from a trigger
//                with a sleep delay (triggers don't allow sleep statements).
//
// Examplle:  Put these 2 lines in a trigger.  Bombing request sentence executes immediately, and Bombing Acknowledged sentence waits 5 seconds allowing first sentence to complete.
// nul=[player, player, 0, "CAS_Bombing_Request"] execvm "Scripts\JBOY_SayModuleSentence.sqf"; 
// nul=[driver wBomber1, player, 5, "CAS_Bombing_Acknowledged"] execvm "Scripts\JBOY_SayModuleSentence.sqf";
//////////////////////////////////////////////////////////
_speaker = _this select 0;  
_receiver  = _this select 1;
_delay     = _this select 2;
_sentenceName  = _this select 3; 

// Add the topic to the speaker if he doesn't have it already.
if !(_speaker kbHasTopic "supports") then 
{
     _speaker kbAddTopic ["supports", "\a3\modules_f\supports\kb\protocol.bikb", "\a3\modules_f\supports\kb\protocol.fsm"];  
};    
sleep _delay;    
_speaker kbTell [_receiver, "supports", _sentenceName, "SIDE"];   

I hope someone finds this useful.  Johnnyboy out.

  • Like 3

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×