Jump to content
Sign in to follow this  
trini scourge

Secondary Ops Manager Module Discussion

Recommended Posts

I still can not get the SOM running on dedicated servers :( Does anyone have an idea?? Looks like other modules have the same problem. Like the First Aid stuff. The normal way with Placing and Syncing in the editor isnt working on dedicatet servers. any help would be nice.

Share this post


Link to post
Share on other sites

As far as I know modules are messy and should be avoided as much as you can afford.

Share this post


Link to post
Share on other sites

@BlackAlpha ... ive used your settings and now I can set spawn distance alot farther.

The problem now is I used this: http://www.armaholic.com/page.php?id=7197 mission test to use a menu to select and request what you want instead of random secop. The problem is Im not sure now how to init the secop module to set spawn distance and also use this menu.

Anyone know how to just set the max/min spawn distance but not have secop run from start but also then call what you want from menus (see the mission link)? Ive tried a number of ways but spawning simply gets ignored and reverts to default which I feel is far too close.

I tried this from the init.sqf (being called the way BlackAlpha showed on page 19):

private ["_secOpDistances"];

//Min Max distance of sec ops.

//Default: [300, 700]

_secOpDistances = [2000, 2500];

_settings = [_secOpDistances];

//som1 is module name.

som1 setVariable ["settings", _settings];

Thinking this would pass to the module the spawn setting on init. Then the menu would kick in and from that point anything I run would spawn over 2000 minimum, but it gets ignored. I tried this in the init of the module via the editor also ... so I cant quite marry the two to work together.

PS the module name/variable name all match up ok for this and the menu script.

Edited by mrcash2009

Share this post


Link to post
Share on other sites

Any one know how to delay a player from requesting arty/uav/transport over and over and over?

Possibly a time limit function of say around 5 or 10 mins or something?

Cheers for your help. :yay:

Share this post


Link to post
Share on other sites

I use triggers and logics to enable the player to call the support requests, so just put in delays in the trigger like this:

triggero.th.jpg

click to enlarge

I used this so the support options wouldn't become available until the intro movie was over, but the concept can be used after that too

Share this post


Link to post
Share on other sites

Too bad SecOps doesn't stay away from rivers and puts objectives in them... (tested on Island Panthera v2.0).

Share this post


Link to post
Share on other sites
Too bad SecOps doesn't stay away from rivers and puts objectives in them... (tested on Island Panthera v2.0).

That is a very sad thing indeed. I'm planning to make a SecOp mission I had on Chernarus to Panthera Island...

Share this post


Link to post
Share on other sites

You can modify the SecOps FSM/scripts yourself now easily.

Share this post


Link to post
Share on other sites
You can modify the SecOps FSM/scripts yourself now easily.

Any FSM tutorials or walkthroughs out yet? I tried the editor and my face melted. :)

Share this post


Link to post
Share on other sites

Is it possible to have more than one player using the SOM to call for support in multiplayer? I am synchronizing the SOM to the leaders of each group but only 1 leader is able to call in airstrikes or arty.

Share this post


Link to post
Share on other sites

1. IS there a way to call up SOM with trigger

ie: I want to use the support features thoughout the mission without SECOP missions. Once the primary objective is destroyed I want SECOP to start sending me mission.

I know theres an easy code to this but I cant find it.

The other part is, I am using the Secop version of USSUPPORT so the script is generating the module, it is not placed via the editor so the script/code must be in the init.sqf not a line in the physical module. Or probably in them trigger.

2. What is the maximum duration for first call and interval in the secop settings. I would like to be called about every 10 mins but it seems that any number greater tha 299 (sec?) defaults to 30 even though it should be random.

I dont want to be constantly bothered but I do like the atmosphere created between SOM and ACM. Its make the mission diffrent everytime and creates a bigger theater of war.

UPDATE: sorted it out buy putting the whole script instead of the code, all the settings seem to take affect when adjusted now.

Still would like to know how to active midway through the mission though

Edited by tractorking

Share this post


Link to post
Share on other sites

Sorry for that last post - too many threads open and got misplaced.

Now, I came back, after fooling around with the settings, to explain my successes for those who are trying to activate this stuff and do so at a specific moment in the mission, e.g. only when you enter the hostile area.

So, first you disable the module at the beginning of the game by means of putting:

this setVariable ["settings", [[], true, nil, nil, false]];

in the initialization field of the module (as explained earlier in the thread)

To activate SOM, you can then use a trigger to define the area/moment when the sec-ops should initialize (again, pretty simple and a different topic so not explained here) and in the "on activation" of those triggers you then manually set the particular variable using the following template code:

(player getVariable "mainScope") setVariable ["[i]thenameofthevariable[/i]", [i]thevariable[/i]]

again, as already previously explained earlier in this thread.

As CodeRedFox quoted these are the names of the variables to use in the above code:

These are the options from the secopmanager.fsm

"private [""_settings"", ""_pool"", ""_hqEnabled"", ""_callsigns"", ""_initialDelay"", ""_autoReinforce"", ""_secOpSpacing"", ""_randomActivation"", ""_secOpDistances""];

or when adding to the SOM inti:

this setVariable ["settings", "_pool"", "_hqEnabled", "_callsigns", "_initialDelay", "_autoReinforce", "_secOpSpacing", "_randomActivation", "_secOpDistances"];

And of course you need to specify the variable itself. The large list of configurable settings to use with the above names of variables are all over this thread with explanations already included so I won't copy it here.

So, as an example, what I was trying to do was to activate the Secops module by a territorial trigger, for several types of missions to begin and then have those missions be spread apart by at least 300 seconds and at most 600. So I used the following code in the "on activation" field of the trigger:


(player getVariable "mainScope") setVariable ["pool", ["ambush", "attack_location", "patrol", "destroy"]]; (player getVariable "mainScope") setVariable ["secOpSpacing", ((random 300) + 300)];

And of course you can disable the thing by emptying the pool, using the following code in, for example, the deactivation field of a trigger (make sure the trigger is set to "repeatable").

(player getVariable "mainScope") setVariable ["pool", []];

Tested this code twice and seems to work (after the first secop at least 5 minutes pass (300 sec) before the next mission is given.) You may have to play with "" and () when creating these codes if something doesn't seem to work.

P.S. I don't know why the code field in the forums is so short and people have to scroll to see the whole code.

Edited by Jedo

Share this post


Link to post
Share on other sites
Is it possible to know whether we have a SecOp mission active or not?

Not sure if this is specific to SECOP but I have never seen it happen so much in missions I write myself.

Transport helos crash into trees almost every time I call them. Sometimes we get picked up and then he crashes and sometimes he crashes before he even gets to us.

Even when I call in a pick up in a wide open field. The asshat will inevitably find a tree to hit.

I think it's a simple case of telling the pilots to rise to at least 60 feet or so before trying to move. At the moment they seem to dive to around 15 feet as they move forward.

Just an observation.

Eth

Edited by BangTail

Share this post


Link to post
Share on other sites
Is it possible to know whether we have a SecOp mission active or not?

in the request support menu it will say active if it is active

Share this post


Link to post
Share on other sites
in the request support menu it will say active if it is active

yes it is, but I was wondering if there is a variable for it, so

if (secOp active) then{

do something

}else{

do something

}

sorry if I wasnt very clear earlier

Share this post


Link to post
Share on other sites

found this script buried in the arma2 addons folder haven't had time to dissect it but I think the answer lies here. Maybe someone who understands sqf's better can help

/*
File: isAvailableSupportRequest.sqf
Author: Joris-Jan van 't Land

Description:
Returns whether or not a certain support request is available at this time.
It also updates and cleans the registry when a support request is no longer available.

Parameter(s):
_this select 0: name of the support request (String)
_this select 1: SOM main scope (Object)

Returns:
Boolean
*/

private ["_supReqName", "_mainScope", "_available"];
_supReqName = _this select 0;
_mainScope = _this select 1;

_available = false;

//Fixed times of availability of each support request.
private ["_availTime"];
_availTime = [_supReqName, "timeAvailable"] call BIS_SOM_returnCfgSecOpsEntryFunc;

//Fetch this request's gain times or create a new list (also for parameters).
private ["_varName", "_gainTimes", "_varNameParams", "_params"];
_varName = "gainTimes_" + _supReqName;
_varNameParams = "params_" + _supReqName;
_gainTimes = _mainScope getVariable _varName;
if (isNil "_gainTimes") then 
{
_gainTimes = [];
_params = [];
} 
else 
{
_params = _mainScope getVariable _varNameParams;
};
_gainTimesNew = +_gainTimes;

//Check all times at which this support was gained against the current time.
//Remove any times (and parameters) that are now outdated.
for "_i" from 0 to ((count _gainTimes) - 1) do 
{
private ["_gainTime", "_gainedTime"];
_gainTime = _gainTimes select _i;
_gainedTime = time - _gainTime;

//Some requests cannot expire.
if ((_gainedTime <= _availTime) || (_gainTime == -1) || (_availTime == -1)) then 
{
	_available = true;
} 
else 
{
	_gainTimesNew set [_i, -2];
	_params set [_i, -1];
};
};

_gainTimesNew = _gainTimesNew - [-2];
_params = _params - [-1];

//Update the main registry of gain times and parameters.
_mainScope setVariable [_varName, _gainTimes];
_mainScope setVariable [_varNameParams, _params];

answer could also be in this script

/*
File: addSupportRequest.sqf
Author: Joris-Jan van 't Land

Description:
Adds one or more support request for the SOM's team.
In case you pass a Number, its value determines the amount of random Support Requests added.

Parameter(s):
_this select 0: name of the support request (String, Array of Strings or Number)
_this select 1: SOM main scope reference (Object)
_this select 2: (optional) parameters (Array)
_this select 3: (optional) never expire toggle (Boolean - default: false)
*/

//Validate parameter count.
if (isNil "_this") exitWith {debugLog "Log: [addSupportRequest] Function requires 2 parameters!"; false};
if ((count _this) < 2) exitWith {debugLog "Log: [addSupportRequest] Function requires 2 parameters!"; false};
if (({isNil "_x"} count _this) != 0) exitWith {debugLog "Log: [addSupportRequest] Function requires all parameters to be defined values!"; false};

private ["_supReqs", "_mainScope", "_supReqName"];
_supReqs = _this select 0;
_mainScope = (_this select 1) call BIS_SOM_returnSOMFunc;

//Fetch optional parameters.
private ["_paramsNew", "_neverExpire"];

//Convert single name to array with 1 element.
if ((typeName _supReqs) == (typeName "")) then 
{
_supReqs = [_supReqs];
};

//Convert number to selection of random requests.
if ((typeName _supReqs) == (typeName 0)) then 
{
private ["_supReqsTmp"];
_supReqsTmp = [];
for "_i" from 0 to (_supReqs - 1) do 
{
	_supReqsTmp = _supReqsTmp + [["transport", "supply_drop", "aerial_reconnaissance", "tactical_airstrike", "artillery_barrage"] call BIS_fnc_selectRandom];
};
_supReqs = +_supReqsTmp;
_supReqsTmp = nil;
};

if ((count _this) > 2) then
{
_paramsNew = _this select 2;
};

//No parameters were passed, so generate a big enough list of empty parameters.
if (isNil "_paramsNew") then {_paramsNew = []};

//Make sure there are enough parameter lists.
if ((count _supReqs) > (count _paramsNew)) then  
{
for "_i" from (count _paramsNew) to ((count _supReqs) - 1) do 
{
	_paramsNew = _paramsNew + [[]];	
};	
};

if ((count _paramsNew) < (count _supReqs)) exitWith {debugLog "Log: [addSupportRequest] The number of parameter lists (2) should match the number of support requests (0)!"; false};


if ((count _this) > 3) then 
{
_neverExpire = _this select 3;
};

if (isNil "_neverExpire") then {_neverExpire = []};

if ((count _supReqs) > (count _neverExpire)) then  
{
for "_i" from (count _neverExpire) to ((count _supReqs) - 1) do 
{
	_neverExpire = _neverExpire + [false];
};	
};


private ["_addedMsg"];
_addedMsg = "";

for "_i" from 0 to ((count _supReqs) - 1) do 
{
_supReqName = _supReqs select _i;

//Check to see this request exists.
if (([_supReqName, "supportRequest"] call BIS_SOM_returnCfgSecOpsEntryFunc) == 1) then 
{	
	//Remove obsolete gain times.
	[_supReqName, _mainScope] call BIS_SOM_isAvailableSupportRequestFunc;

	//Fixed count of availability of each support request.
	private ["_maxCount"];
	_maxCount = [_supReqName, "maxCount"] call BIS_SOM_returnCfgSecOpsEntryFunc;

	//Fetch this request's gain times and parameters or add new lists.
	private ["_varName", "_gainTimes", "_varNameParams", "_params"];
	_varName = "gainTimes_" + _supReqName;
	_varNameParams = "params_" + _supReqName;
	_gainTimes = _mainScope getVariable _varName;
	if (isNil "_gainTimes") then 
	{
		_gainTimes = [];
		_params = [];
	} 
	else 
	{
		_params = _mainScope getVariable _varNameParams;
	};

	//Some requests should never expire.
	private ["_newGainTime"];
	if (_neverExpire select _i) then {_newGainTime = -1} else {_newGainTime = time};

	//Add if the maximum count was not exceeded.
	if ((count _gainTimes) < _maxCount) then 
	{
		_gainTimes = _gainTimes + [_newGainTime];
		_params = _params + [_paramsNew select _i];
	} 
	else 
	{
		//Replace the earliest gain time.
		if ((count _gainTimes) > 0) then 
		{
			private ["_arrayExtreme"];
			_arrayExtreme = ([_gainTimes, 0] call BIS_SOM_findArrayExtremeFunc) select 0;
			_gainTimes set [_arrayExtreme, _newGainTime];
			_params set [_arrayExtreme, _paramsNew select _i];
		};
	};

	//Update the list of gain times and parameters with the new request.
	_mainScope setVariable [_varName, _gainTimes];
	_mainScope setVariable [_varNameParams, _params];

	private ["_title"];
	_title = [_supReqName, "title"] call BIS_SOM_returnCfgSecOpsEntryFunc;
	_addedMsg = _addedMsg + "\n" + _title;

	["supreq", _mainScope] call BIS_SOM_updateCommsMenuFunc;
} 
else 
{
	debugLog (format ["Log: [addSupportRequest] This support request (%1) does not exist!", _supReqName]);
};
};

//Alert the leader the new requests were added, if they were.
if (isNil "BIS_WF_Client") then
{//disabled hint when in WF (we have right side indications instead)
 if (_addedMsg != "") then 
 {
 	private ["_msg"];
 	_msg = (localize "STR_SOM_SUPPORT_REQUEST_ADDED") + _addedMsg;

 	[[_mainScope getVariable "leader"], [_msg], {hint (_this select 0)}, {player == _x}] call BIS_SOM_sendCodeFunc;
 };
};

true

Edited by {USI}_Zombie

Share this post


Link to post
Share on other sites

I've just tried the SOM last night and i like it, gives some extra action to your mission.

I got one problem though, not sure if it has been answered in this thread before i didn't bother reading through all the pages :p

Here's the problem:

I add the SOM to my mission and sync it to my player and it works fine until i die and respawn using norrins revive script. So when i die i get no more secondary missions, how can i re-sync the SOM to the new spawned player on the fly??

Share this post


Link to post
Share on other sites

Impresive thread that got me out from my missery about creating a chopper to load and unload me, thx a lot guys. Even tho, now I got myself with some other problems:

1. How can I make that chopper talk? When I req for him to come and get me he is not saying anything, but when I ask for a airstrike or anything else H.Q is talking to me. (or how do I get what unit I want to have a voice)

2. I wanna make a rts map (coz I didn't find any), but I'm rly lost doing all this scripting, can someone help? just a start for placing base, building units, how can I make a town to be conquerble and I will go on from there.

I am a noob, I barely made this scripts from what I readed from around here and pls get easy on me if they are not right

init.sqf info

execVM "somsettings.sqf";

somsettings.sqf info

//Initilize the system
//Configure SOM module with custom settings. Must run during the first 2 seconds of a mission.

waitUntil {!isnil {player getVariable "mainScope"}};
SOM_mainScope = player getVariable "mainScope";

// Put this in the init field of your SOM module to prevent any random things from happening, only what we declare above will be available.
// this setVariable ["settings", [[], true, nil, nil, false]];

// Grant the player access to Transport or other things like airstrike and artillery_barrage.
[["transport", "supply_drop", "tactical_airstrike", "artillery_barrage"], player] call BIS_SOM_addSupportRequestFunc;


// Set Variables for the SOM module, named SOM in this case.
SOM setVariable ["TSS_vehicle_custom", Frostbite];  // Frostbite is the preplaced unit that will be used for transport.  Comment this line out to use default Huey.
SOM setVariable ["TSS_allowed", ["pickup", "unload"]];  // Commands allowed by the transport vehicle.
SOM setVariable ["TSS_plannedLZ", [0,0,0]];  // Defaut landing zone, will be set via map click after pickup.

// Transport vehicle settings.
Frostbite setVariable ["supPool", [Razor], TRUE]; // "name" is the unit that can use this.
Frostbite setVariable ["supPhase", 0, TRUE];  // Default variable for what phase of transport it's on.
Frostbite setVariable ["onMission", objNull, TRUE];  // Default variable for it it's busy or not.
Frostbite setVariable ["stuck", FALSE, TRUE]; // Default variable for if it's stuck or not
Frostbite setVariable ["callsign", [star Force 21]];

private ["_hq", "_callsigns", "_settings"];

//List of secops.
//Default: ["ambush", "attack_location", "defend_location", "destroy", "escort", "patrol", "rescue", "search", "trap"]
//_pool = ["ambush", "attack_location", "destroy", "escort", "patrol", "rescue", "search", "trap"];

//Enable or disable HQ.
//Default: true
_hq = true;

//Team text, team speech, H.Q. text, H.Q. speech.
//Default: ["ALPHA", ["Alpha"], "H.Q.", ["HQ"]]

//Delay in seconds before starting random SecOps selection. Only seems to affect the first secops.
//Default: 30
//_initialDelay = ((random 300) + 300);

//Should an automatic Reinforce be triggered when there are casualties?
//Default is true.
//_autoReinforce = true;

//??? Delay between sec ops?
//Default: 30
//_secOpSpacing = ((random 300) + 300);

//??? From 0 to 1. 0 means no secops starting. With 1 they do start. Some kind of chance variable?
//Default: 0.7
//_randomActivation = 0.4;

//Min Max distance of sec ops.
//Default: [300, 700]
//_secOpDistances = [1500, 2000];

_settings = [_hq, _callsigns];

//BIS_SOM is module name.
SOM setVariable ["settings", _settings];

I know where are // in front of a text that text will not be used but I keep them to help me get around.

With this I have everything working like airstrike and arty even if I didn't placed any arty on map or planes, but they are coming from somewhere :)

Now I'm working to understand this ones:

"private [""_settings"", ""_pool"", ""_hqEnabled"", ""_callsigns"", ""_initialDelay"", ""_autoReinforce"", ""_secOpSpacing"", ""_randomActivation"", ""_secOpDistances""];

or when adding to the SOM inti:

this setVariable ["settings", "_pool"", "_hqEnabled", "_callsigns", "_initialDelay", "_autoReinforce", "_secOpSpacing", "_randomActivation", "_secOpDistances"];

Do I have to replace "_callsigns" with something to make a unit to have a callsign? I realy don't understand how this works and maybe somebody wanna explain that to me with a example. Please treat me like a complete noob about scripting, until now I was playing just with the normal editing and I know I'm not alone, thx a lot and sorry to bother

Edited by Ezethiel

Share this post


Link to post
Share on other sites

I add the SOM to my mission and sync it to my player and it works fine until i die and respawn using norrins revive script. So when i die i get no more secondary missions, how can i re-sync the SOM to the new spawned player on the fly??

I've never used Norrin's script, won't get in to why right now :p , but resynching the som module after any respawn doesn't seem to work. I haven't noticed any solutions for this.

Also the modules, sadly, seem to be broken on dedicated servers but work fine on local hosted/lan games.

Hope you find an answer....

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
Sign in to follow this  

×