Home   Help Search Login Register  

Author Topic: SOM module discussion  (Read 7871 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.

Offline jones

  • Members
  • *
Re: SOM module discussion
« Reply #15 on: 10 Sep 2009, 22:51:42 »
you could do it via action menu, when the scripts executes remove the action then use something like
Code: [Select]
["supply_drop",  unit] call BIS_SOM_addSupportRequestFunc;
_waittime = _time;
waituntil {_waittime == 120}
unit addaction.........................

not sure if it would work just jotted it down
_time variable is a reserved local variable that tracks time after the script fires. I think it would work in the instance

Offline Zombie

  • Members
  • *
  • Beware the night, the zombie walks among you
    • USI
Re: SOM module discussion
« Reply #16 on: 10 Sep 2009, 23:57:33 »
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!

  i added a radio trigger to make the arty available again...

Code: [Select]
[[""artillery_barrage""], player, [[RIPPER, [1,2,3,4,5,6,7,8,9]]]] call BIS_SOM_addSupportRequestFunc;

This assumes your arty module is named Ripper and you are using a howitzer, the mortar and mlrs/grad won't fire all the shell types the cannons will.

Offline Trexian

  • Members
  • *
Re: SOM module discussion
« Reply #17 on: 11 Sep 2009, 14:15:25 »
Great ideas, guys. :)

I'd prefer not to add to the addActions - personal preference only, in that it seems like that gets cluttered rather quickly.

I'm also wondering if I can dynamically create the radio triggers.  You could have the array of types of SOM support, and select a random number of them, then add those radio calls.  They could call a script that sets them up, then delays before adding the radio call back in....

EDIT: BTW, I'm using the arty in "virtual mode" through the SOM.
« Last Edit: 11 Sep 2009, 15:31:06 by Trexian »
Sic semper tyrannosauro.

Offline Zombie

  • Members
  • *
  • Beware the night, the zombie walks among you
    • USI
Re: SOM module discussion
« Reply #18 on: 12 Sep 2009, 11:52:13 »
it appears that triggers CAN be dynamically created, I found this http://community.bistudio.com/wiki/createTrigger in the wiki but admittedly I haven't tried to use it.

Offline SaOk

  • Missions Depot Staff
  • *****
    • My youtube profile
Re: SOM module discussion
« Reply #19 on: 12 Sep 2009, 14:05:11 »
Dynamically created triggers work great and are easy to make. I used this code in my latest mission:

Code: [Select]
_trg=createTrigger["EmptyDetector",getPos player];
_trg setTriggerArea[0,0,0,false];
_trg setTriggerActivation["HOTEL","PRESENT",true];
_trg setTriggerStatements["this", '[] exec "reschat.sqs"', ""];
_trg setTriggerText "Call in NAPA fighters";

After activation the trigger was be deleted with:

Code: [Select]
deletevehicle _trg;

Offline Trexian

  • Members
  • *
Re: SOM module discussion
« Reply #20 on: 14 Sep 2009, 14:56:20 »
Here's what I tried to create a SOM-connecting dynamic trigger.

Code: [Select]
_artyTrig = createTrigger ["EmptyDetector", (getpos Player)];
_artyTrig setTriggerArea [0, 0, 0, false];
_artyTrig setTriggerActivation ["ALPHA", "PRESENT", true];
_artyTrig setTriggerStatements ["this", "nul = [_artyTrig] execVM 'JTD_artyCall.sqf'", ""];
_artyTrig setTriggerText "Connect to Ripper 1";
[["artillery_barrage"], player, [[[1,2,3,4,5,6,7,8]]]] call BIS_SOM_addSupportRequestFunc;

But I got an error that it is missing a ] in the setTriggerStatements line (which, by experience, could mean a missing " or ' or } or ; or ) ....) :)  It occurs to me that the setTriggerStatement my automatically pass the id of the trigger?

Edit - ahh, regardless, I see your setTriggerStatements has a different combination of ' and " than I do. :)

Edit 2: And voila! That did the trick!

I don't really know how or why it works, but I now dynamically create a trigger in the init:
Code: [Select]
_artyTrig = createTrigger ["EmptyDetector", (getpos Player)];
_artyTrig setTriggerArea [0, 0, 0, false];
_artyTrig setTriggerActivation ["CHARLIE", "PRESENT", true];
_artyTrig setTriggerText "Connect to Ripper 1";
_artyTrig setTriggerStatements ["this", 'nul = [_artyTrig] execVM "JTD_artyCall.sqf"', ""];

The artycall script is:
Code: [Select]
private ["_trig"];

_trig = _this select 0;
[["artillery_barrage"], player] call BIS_SOM_addSupportRequestFunc;


And my initial tests seems like it works.  I guess the repeating nature of the trigger keeps it coming back.  It does seem to wait an appropriate amount of time before allowing more arty, which is good.
« Last Edit: 15 Sep 2009, 05:33:45 by Trexian »
Sic semper tyrannosauro.

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re: SOM module discussion
« Reply #21 on: 12 Jan 2010, 22:57:07 »
Since this is very much connected to the SOM module, I wanted to add to the discussion (and remind people of this nice little module and its possibilities in editing):

There is, AFAIK, NO way to initialize and use the SOM module -unless- it is synchronized from mission start with the player. This is I think the same reason it's not really working in MP. I need this for a situation where the player is not the player at the start of the mission, but will rather be created and then selected using selectPlayer. However this makes the use of the SOM module impossible since you can't use the synchronizedObjectsAdd command to synch the SOM module with the "new" player!

If anyone knows how to make this work, through any workaround, please let me know. It is very frustrating since there's no alternative for me: the player will simply not be "the player" when the mission starts (it's a campaign script, and if the main character dies then teamswitch kicks in, meaning the next mission might have -any- of the characters as the "player").

I really don't understand how BIS dropped the ball on this one, it's quite confusing. You can do it with the ACM, the first aid modules, ALICE, etc. They all work fine out of the box. But not SOM.  >:(

Help?

Wolfrug out.

"When 900 years YOU reach, look as good you will not!"

Offline Trexian

  • Members
  • *
Re: SOM module discussion
« Reply #22 on: 13 Jan 2010, 14:27:23 »
I messed around with syncing the SOM to "new" units - in my case, they were spawned.  Couldn't get it to work.  There's a few lines of code that seem to work to sync First Aid modules with new players, but I couldn't sort out how to make it work with SOM.

For your purposes, would it be possible to have the units elsewhere on the map, sync them from the start with SOM, but then move and group them together when you need it?  Maybe a scripted setPlayable for the units?

SOM might see them as sync'd from the beginning?
Sic semper tyrannosauro.