Jump to content
gt500svt

Radio Support Module Temporary Use

Recommended Posts

I’m working on a mission and I need the ability to have the radio support module only work in a certain area. I currently have it turned on by a trigger with a “ Any Player” and “Present “ activation but once activated it stays active the rest of the mission which I don’t need or want. Can I use another trigger to deactivate it once its use is completed? If so, does anyone have the script to accomplish this? 
 

of course any other ideas are greatly appreciated!!! 
 

thanks 

MM 

Share this post


Link to post
Share on other sites
1 hour ago, gt500svt said:

radio support module

Just to confirm. this is the "Support Requester" module, where you call artillery/CAS/Supplies via the communication menu?

Share this post


Link to post
Share on other sites

ok! heres what I have, tested in SP editor. not sure if itll work in MP.
J_fnc_supportAdd -- call this on your trigger's activation

Spoiler

//
//[requestModule,thisList] call J_fnc_supportAdd;
//
params [
	"_module", //REQUESTER module name
	"_trgList" //thisList of the Trigger
];

//SYNC PLAYERS IF NOT DONE ALREADY
{
	if((isPlayer _x) && !(_x in synchronizedObjects _module))then
	{
		_module synchronizeObjectsAdd [_x];
	};
}forEach _trgList;


_supportList = 
[
	"Artillery",
	"CAS_Heli",
	"CAS_Bombing",
	"UAV",
	"Drop",
	"Transport"	
];
//RESET THE SUPPORT CALLS TO THEIR LAST KNOWN NUMBER BEFORE WE SET THEM TO 0
{
	_var = _module getVariable format["J_SUPP_limit_%1",_x];
	if(!isNil "_var")then
	{
		_module setVariable [format ["BIS_SUPP_limit_%1", _x],_var];
	};
}forEach _supportList;
call BIS_SUPP_refreshMainWindow; //REFRESHES THE COMMS WINDOW

 

 

J_fnc_supportRemove -- call this in the trigger deactivation

Spoiler

//
//[requestModule] call J_fnc_supportRemove;
//
params ["_module"]; //REQUESTER MODULE

_supportList =
[
	"Artillery",
	"CAS_Heli",
	"CAS_Bombing",
	"UAV",
	"Drop",
	"Transport"
];

//GET THE CURRENT SUPPORT CALL LIMITS AND PRESERVE THEM IN CUSTOM VARIABLE SO WE CAN ADD & DELETE THEM AS NEEDED
{
	_currCalls = _module getVariable format["BIS_SUPP_limit_%1", _x];
	_module setVariable [format ["J_SUPP_limit_%1",_x],_currCalls];
	_module setVariable [format ["BIS_SUPP_limit_%1", _x],0];
}forEach _supportList;
call BIS_SUPP_refreshMainWindow;

 


If you need help configuring these as functions to call, let me know!

EDIT: I was only saving the original available calls set at the beginning of the mission. Now it will update if you've used some. (player enters the trigger >> uses 3 artillery strikes out of 10 >> player leaves the trigger >> loses artillery support >> player re-enters the trigger with 7 available artillery calls left)

Share this post


Link to post
Share on other sites

I really appreciate the response….. I’m really new to mission making so what you have laid out it probably to advanced for my abilities. I’m just sort of learning and just getting my feet wet with small easy scripts that start and stop helo and plane movements,  triggers to activate certain things, and waypoint activations…. Etc…. 

Share this post


Link to post
Share on other sites

No worries, we were all there once!
Just paste this code directly into your trigger and change the text at the top to your Support Requester module variable name;

 

On Activation:
 

Spoiler

_module = PUT YOUR REQUESTER MODULE NAME HERE;
_trgList = thisList;
{ 
 if((isPlayer _x) && !(_x in synchronizedObjects _module))then 
 { 
  _module synchronizeObjectsAdd [_x]; 
 }; 
}forEach _trgList; 
_supportList =  
[ 
 "Artillery", 
 "CAS_Heli", 
 "CAS_Bombing", 
 "UAV", 
 "Drop", 
 "Transport"  
]; 
{ 
 _var = _module getVariable format["J_SUPP_limit_%1",_x]; 
 if(!isNil "_var")then 
 { 
  _module setVariable [format ["BIS_SUPP_limit_%1", _x],_var]; 
 }; 
}forEach _supportList; 
call BIS_SUPP_refreshMainWindow;

 

 

On Deactivation
 

Spoiler

_module = PUT YOUR REQUESTER MODULE NAME HERE; 
_supportList = 
[ 
 "Artillery", 
 "CAS_Heli", 
 "CAS_Bombing", 
 "UAV", 
 "Drop", 
 "Transport" 
]; 
{ 
 _currCalls = _module getVariable format["BIS_SUPP_limit_%1", _x]; 
 _module setVariable [format ["J_SUPP_limit_%1",_x],_currCalls]; 
 _module setVariable [format ["BIS_SUPP_limit_%1", _x],0]; 
}forEach _supportList; 
call BIS_SUPP_refreshMainWindow;

 

 

Share this post


Link to post
Share on other sites

Are these 2 separate triggers. One to activate the module and a second to deactivate it? Or is this one trigger with the first code in the activation and the second in the deactivation ?

Share this post


Link to post
Share on other sites

easiest way is to put them both in one trigger. When the player is in that trigger they can use the supports, when theyre not in the trigger they cant.

Share this post


Link to post
Share on other sites

Ok… I laid down the Radio Support Module and  named it CAS1 in the variable name. 
 

I then laid down the trigger and paste the two scripts into the trigger in their correct places….adding CAS1 to each script at the top. Activation was Any Player and activation type was Present. I then sync the trigger to the Radio Support Module.

 

when I enter the trigger boundary my activation “Hint” text shows up as does the radio support module but when I leave the boundary I never get my deactivation “Hint” text and the Radio Support Module continues to stay active. 
 

am I missing a step or doing something wrong? Thank again for the help. 

Share this post


Link to post
Share on other sites

I changed the variable name to P just to make it easy and know there was no typo. Using the below settings my radio support is always active as soon as the mission starts. Going into the trigger will bring up the  hint text but never does the deactivation text show when leaving the trigger area nor does the radio support disappear from the communication menu.

 

If I link the trigger and module, the module is not active until I get into the boundary but when I leave it never deactivates 
 

Q4w18tk.jpg2xy6ocK.jpgql7lwM1.jpg 

Share this post


Link to post
Share on other sites

Ah I see. looks like youre using a modded module. my code was for vanilla. sorry about that! Not sure what you'll need to make that one work

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

×