Home   Help Search Login Register  

Author Topic: SOM module discussion  (Read 7651 times)

0 Members and 1 Guest are viewing this topic.

Offline bardosy

  • Honoured Contributor
  • ***
  • campaign designer
    • CartooDiv
SOM module discussion
« on: 26 Jun 2009, 11:26:41 »
SOM is very interesting and very underdocumented on Biki.

http://community.bistudio.com/wiki/Secondary_Operations_Manager

But I found some info, and I guess I shate it with you and hope we can know more about this stuff.

Well, SOM is needed if you want use the Arty Modul or want use the Airtaxi (StarForce 21 in campaign) in your missions. But If you just put it to the map and syncron with tha player group, it will generate secondary missions for the player. It could be fun, but if you have a strong idea about YOUR mission and no need secondary (BIS generated) missions, just put this line into the SOM's Init field:

Code: [Select]
this setVariable ["settings", [[], true, nil, nil, false]];


And if you want second objectives, but different callsigns or not all kind of second objectives, you can use this code very early in your mission...

Code: [Select]
private ["_pool", "_hq", "_callsigns", "initialDelay", "_autoReinforce", "_settings"];
_pool =
[
"ambush"
];
 
_hq = false;
 
//Team text, team speech, H.Q. text, H.Q. speech.
_callsigns = ["Razor", ["Razor"], "Frostbite", ["Frostbite"]];
 
//Delay in seconds before starting random SecOps selection.
_initialDelay = 60;
 
//Should an automatic Reinforce be triggered when there are casualties?
//Default is true.
_autoReinforce = false;
 
_settings =
[
_pool,
_hq,
        _callsigns,
        _initialDelay,
        _autoReinforce
];
 
_som setVariable ["settings", _settings];
Fix bayonet!

Offline Case

  • Members
  • *
Re: SOM module discussion
« Reply #1 on: 31 Jul 2009, 16:40:50 »
Great info bardosy,

I am working on a mission that will be run on a dedi-server and am having problems (as mentioned before) about when the player that has the SOM synced to him dies, it pretty much breaks the module.

I was thinking though, could you create the SOM via script and sync it to a player that way?  Then you could check if the current player with the SOM synced to them is dead, and if so, recreate the SOM synced to a new player.

Have you seen any code samples on creating a SOM via script, and not in the editor?  I haven't been able to find anything like that yet.

Cheers!

EDIT:  I just tested your second bit of code in my init.sqf.  My module is named 'BIS_SOM'.  I used this code: 
Code: [Select]
waitUntil {!isNil {BIS_SOM getVariable "initDone"}};
waitUntil {BIS_SOM getVariable "initDone"};

Then inserted your code, but changed the last line you had to
Code: [Select]
BIS_SOM setVariable ["settings", _settings];
This doesn't seem to be changing any of the parameters of the SOM.

Anyone have any ideas?

« Last Edit: 31 Jul 2009, 17:19:01 by Case »

Offline nominesine

  • Former Staff
  • ****
  • I'm NOT back!
    • The IKB Forum
Re: SOM module discussion
« Reply #2 on: 07 Aug 2009, 13:16:30 »
I don't want my SOM Module to give my squad secondary objectives upon mission start, so I put this in the init.sqf to switch it off

Code: [Select]
waitUntil {!isNil {BIS_SOM getVariable "initDone"}};
waitUntil {BIS_SOM getVariable "initDone"};
this setVariable ["settings", [[], true, nil, nil, false]];

But I want to switch the full range of randomized secondary objectives on later in the same mission. I suspect that I must modify this setVariable ["settings", [[], true, nil, nil, false]]; to make it work. But how?
OFPEC | Intel Depot
RETARDED Ooops... Retired!

Offline nominesine

  • Former Staff
  • ****
  • I'm NOT back!
    • The IKB Forum
Re: SOM module discussion
« Reply #3 on: 11 Aug 2009, 02:07:37 »
I got it to work and in order to continue sharing I'll post my findings here. My SOM Module is named nomin_SOM1 and this goes in it's Init line:

Code: [Select]
this setVariable ["settings", [ [], true, ["Swordsman", ["Swordsman"], "Battlemage", ["Battlemage"]], 120, false]];
Swordsman is callsign of the group synched with the SOM Module. It needs to be repeated twice. Battlemage is the HQ. Using names borrowed from the campaign gives you the correct sound files, when you use the SOM Module. You may exchange these names for anything, but then the AI will skip the callsign during voice communication.

More importantly. The code quoted above ensures that the SOM Module does not give me any random missions, but I may still call for support with a radio trigger. The triggers Activation field looks like this:

Code: [Select]
[["transport"], player] call BIS_SOM_addSupportRequestFunc;
Several other support missions are available. You may replace "transport" with any or all of the following:
Code: [Select]
[["transport", "aerial_reconnaissance", "supply_drop", "tactical_airstrike", "artillery_barrage"], player] call BIS_SOM_addSupportRequestFunc;

My first example gives me a helicopter for transportation anywhere on the map. The game will spawn a vehicle for you if you don't place one in the editor. I prefer the editor placed version and thus I must define it in a separate script that I call nomin_somScript.sqf. It looks like this:
Code: [Select]
waitUntil {!isNil {nomin_SOM1 getVariable "initDone"}};
waitUntil {nomin_SOM1 getVariable "initDone"};

nomin_SOM1 setVariable ["TSS_vehicle_custom", nomin_evac];

nomin_evac in the example above is the name of my transport helicopter. Theoretically you may replace it with any type of vehicle. Needless to say you may also name it whatever you wish. Planes will find it difficult to land and pick you up, unless you're at an airport when you call them. A truck or an APC works fine, though. The APC's will also be able to extract your teams from forested areas, wich helicopters cannot do.

It is also quite simple to have the SOM Module as a random mission generator while the mission is running. In itäs default mode it will give you a new random assignment every five minutes. I prefer to controlthe randomization myself, and hence I run a script called nomin_secOpsMissions.sqs:

Code: [Select]
? !(isServer): exit

_randomMission = random 9;

? _randomMission <= 1: ["destroy", true, nomin_SOM1] call BIS_SOM_requestSecOpFunc; 
? _randomMission > 1 AND _randomMission <= 2: ["ambush", true, nomin_SOM1] call BIS_SOM_requestSecOpFunc;
? _randomMission > 2 AND _randomMission <= 3: ["attack_location", true, nomin_SOM1] call BIS_SOM_requestSecOpFunc; 
? _randomMission > 3 AND _randomMission <= 4: ["trap", true, nomin_SOM1] call BIS_SOM_requestSecOpFunc; 
? _randomMission > 4 AND _randomMission <= 5: ["rescue", true, nomin_SOM1] call BIS_SOM_requestSecOpFunc; 
? _randomMission > 5 AND _randomMission <= 6: ["defend_location", true, nomin_SOM1] call BIS_SOM_requestSecOpFunc; 
? _randomMission > 6 AND _randomMission <= 7: ["search", true, nomin_SOM1] call BIS_SOM_requestSecOpFunc; 
? _randomMission > 7 AND _randomMission <= 8: ["escort", true, nomin_SOM1] call BIS_SOM_requestSecOpFunc;
? _randomMission > 8: ["patrol", true, nomin_SOM1] call BIS_SOM_requestSecOpFunc;

If you just want to start an ambush, or any other of the seven mission types that comes with the SOM, you can issue the required command from a trigger instead. Example:

Code: [Select]
["ambush", true, nomin_SOM1] call BIS_SOM_requestSecOpFunc;

A lot of useful SOM information is available in the missions.pbo of the original game. The SOM has an entire folder for itself withinit. That should get anyone started using the SOM Module I believe. I'll post more info when I find it. Now I'm going to force the ACM open. Happy editing.
 :cool2:
« Last Edit: 11 Aug 2009, 08:32:47 by nominesine »
OFPEC | Intel Depot
RETARDED Ooops... Retired!

Offline Case

  • Members
  • *
Re: SOM module discussion
« Reply #4 on: 11 Aug 2009, 17:18:59 »
Thanks for the improved 'init' line nominesine, I will switch mine over to use something similiar.

Just yesterday I got something like yours working, but built a function that I call from a trigger to generate a random (mission types selectable in function) SecOp.  Right now, the function also only has a 50% chance of firing, so if you want it to always fire, you can remove the 'if' logic.

Code: [Select]
//Possible values for _missions array:
// "ambush", "attack_location", "trap", "rescue", "patrol", "escort", "defend_location", "destroy", "search"

_occ = random 2;
_occ = _occ - (_occ % 1);

if (_occ < 1) THEN
{
_missions = ["search", "ambush", "attack_location","destroy"];
_rnd = random count _missions;
_rnd = _rnd - (_rnd % 1);

[_missions select _rnd, true, BIS_SOM] call BIS_SOM_requestSecOpFunc;
}

Offline nominesine

  • Former Staff
  • ****
  • I'm NOT back!
    • The IKB Forum
Re: SOM module discussion
« Reply #5 on: 12 Aug 2009, 11:34:48 »
You may also make custom menues in the Communication Field, using the SOM Module. I managed to compile the following example using codesnippets found at the Official Forums:

Code: [Select]
waituntil {!isnil "bis_fnc_init"};

BIS_MENU_GroupCommunication = [

["User menu",false],
["Not active", [2], "", -5, [["expression", "player setdamage 1"]], "1", "0"],
["Active", [3], "", -5, [["expression", "player setdamage 1"]], "1", "1"]

];

showCommandingMenu "#USER:BIS_MENU_GroupCommunication";

The quoted ad hoc example should kill your player. Not very useful, but you may of course replace the player setDamage 1 part with any code you like. You may also replace "Active" and "Not Active" with titles of your own choice.

My limited testing implies that The "Not Active" option is not available to select in the Comunication menu because the last digit is set to 0 (zero). It becomes slectable when "Active" is changed to 1. Due to an unrelated CTD I am unable to do more testing at the moment (no electricity in my house last night). Any findings regarding this function is more than welcome though.
« Last Edit: 12 Aug 2009, 11:42:21 by nominesine »
OFPEC | Intel Depot
RETARDED Ooops... Retired!

Offline sharkattack

  • Former Staff
  • ****
Re: SOM module discussion
« Reply #6 on: 31 Aug 2009, 14:47:55 »
Does the SOM feature work on dedicated server? 
i cant seem to load missions with it included no problems locally    ???
"HOLY SARDINE" - see Shark-Attack meet his match

Offline nominesine

  • Former Staff
  • ****
  • I'm NOT back!
    • The IKB Forum
Re: SOM module discussion
« Reply #7 on: 01 Sep 2009, 12:43:57 »
My testing implies that neither the SOM unit nor the ACM works on a dedicated server. They almost work in a hosted MP game, though. If you want to use the SOM to call artillery or air support in a MP game, the module should be synched to the hosts player unit. Otherwise they won't work.

Both modules are nice addition to the game, but they are also perfect examples of the half-assed, semi-finished approach BIS takes to their game these days. I fear that neither the SOM nor the ACM would have been approved, had they been submitted to Ofpopec's beta-boards
 :)
OFPEC | Intel Depot
RETARDED Ooops... Retired!

Offline Doolittle

  • Contributing Member
  • **
  • _this select 0
Re: SOM module discussion
« Reply #8 on: 01 Sep 2009, 18:43:41 »
Ouch.. that's harsh.

Could we specify what exactly doesn't work? For example, there's a lot of talk of this module or that not working... but for what release? Not working how? On respawn?

Issues I know of: as of 1.03: First Aid Module will make it so enemies don't fire at you if you Respawn while laying down wounded. SOM will only work for the LEADER of a group, and if the entire group dies, the SOM shuts down. Not good if the whole group dies at once. ACM.. haven't tested.

Moderators, or someone: can we have a chart somewhere that lists all the Arma2 modules and... where they fall short? Could look like this:

Module1.03
First AidIf manual respawn then player not detected by enemies
Sec Op ManagerOnly usable by leader & when group dies, SOM turns off

Offline JamesF1

  • Editors Depot Staff
  • *****
    • JamesBurgess.co.uk
Re: SOM module discussion
« Reply #9 on: 01 Sep 2009, 19:46:47 »
My testing implies that neither the SOM unit nor the ACM works on a dedicated server.
ACM, I'll agree with.  SOM, I have working fine in a mission on a dedicated server - I get operations all the time, and they complete fine, etc.

Offline nominesine

  • Former Staff
  • ****
  • I'm NOT back!
    • The IKB Forum
Re: SOM module discussion
« Reply #10 on: 01 Sep 2009, 20:30:17 »
Admittedly a bit harsh. Please ignore my irritated tone. I've been trying to solve this problem for quite sometime now.

The SOM works perfectly when it comes to handing out side missions. No problems there for me either so far. But when you try to use it to call in transport and artillery  in MP it behaves in a totally different fashion (se link above for details). Everything works in SP.

I believe that there must be a scripting workaround for this, but due to non existent documentation it's hard to know. It was in fact the lack of proper manuals/documentation that justified the half assed and semi-finished invectivein the first place.
« Last Edit: 01 Sep 2009, 20:33:31 by nominesine »
OFPEC | Intel Depot
RETARDED Ooops... Retired!

Offline jones

  • Members
  • *
Re: SOM module discussion
« Reply #11 on: 02 Sep 2009, 08:11:43 »
I haven'y had any issues with the SOM, I have been using it on a dedicated server not a local host.
But I would think the principle is the same

However I have a little work around for the ACM
Just created two invincible priest that walk around town and hang out at a church in  my mission I synced the module to them and haven't had any issues with it. It doesn't center the combat on you the player but it does make for some very interested situations.

I'll post an example mission if you want to look at it

Offline Zombie

  • Members
  • *
  • Beware the night, the zombie walks among you
    • USI
Re: SOM module discussion
« Reply #12 on: 02 Sep 2009, 11:04:31 »
My testing implies that neither the SOM unit nor the ACM works on a dedicated server. They almost work in a hosted MP game, though. If you want to use the SOM to call artillery or air support in a MP game, the module should be synched to the hosts player unit. Otherwise they won't work.
  I haven't tried on a dedicated, but locally I don't have the issues you are.  I can host and my friends join and serve as squad leader and all the functions work as advertised.  I don't doubt you are having issues though.  Have you put a server gamelogic in?  It's an old habit I always use for mp missions, I don't know if it is required, but somehow it seems to solve problems without causing any.
  For me, the "TRAP" missions seems bugged.  We usually can't find the downed airman and mission doesn't ever end, so we don't get another mission.  I edited that particular out so they never offer it.
  What doesn't work for air support?  Do they never show, or just not attack when they do?  We can get them to show, but attacking something is another issue.  Try this mission I made and see if you see something that helps.  http://rapidshare.com/files/274608818/co_random_specops.Chernarus.pbo  other than a weather synch, everything seems to work.

Offline sharkattack

  • Former Staff
  • ****
Re: SOM module discussion
« Reply #13 on: 02 Sep 2009, 18:30:17 »
for me any mission with the SOM module present wont load up on our server ...
only have issues on a dedicated server ...  have made simple affairs for testing  puposes and it will not load them ... no errors returned  just kicks us back to select mission screen ...   missions play fine with local host ...  real shame its an excellent feature (in principal)
"HOLY SARDINE" - see Shark-Attack meet his match

Offline Trexian

  • Members
  • *
Re: SOM module discussion
« Reply #14 on: 10 Sep 2009, 17:25:23 »
With much thanks to this thread, I have the SOM operating in a mission such that the player can call in arty, air strike, or transport.  However, particularly with the arty, they can only do so 1x.

Is there some way to have a delay before the arty is available again, but still make it available again?

Thanks!
Sic semper tyrannosauro.