Jump to content
Sign in to follow this  
Frencherman

SOM - Activation

Recommended Posts

Hey Guys,

I am new here and my intention was to learn more about Arma2 scripting before starting our next "Arma2-Lan-Match" :)

Currently I am creating a Special-Forces mission where I would like to activate the Secondery-Operation-Module after passing one specific waypoint or the destruction of one specific target (in this case a russian radar-station). Right now I am only able to use the SOM from the beginning of the mission... :(

Do you have any useful tips for me?

Thanks in advance, guys!

Share this post


Link to post
Share on other sites

Hi Frencherman!

To activate the SOM manager on an event put a trigger in the editor that activate itself when a certain condition is reached (i.e. when the russian radar-station is blown up)..then put in its 'On Activation' field this code:

"SecOpManager" createUnit [[0,0,0], beta, "som1 = this; som1 synchronizeObjectsAdd [player]"]; 
som1 setVariable ["settings", [["ambush","attack_location","defend_location","destroy"], true, ["Razor", ["Razor"], "H.Q.", ["HQ"]], 60, false, 10, 1, [400, 700]]];

this little piece of code create a SOM manager, synchronize it to the player and initialize it with a few Secop mission (not all). In the editor you have to put even a Game Logic Object (wherever you want) and put in its init field this line:

beta = group this

this is a must to do because the createUnit command create the defined object (in your case the SecOpManager) only if it can add that object to an existing group (in this example at the group named beta).

P.S. remember: this code works well in SinglePlayer only..for MP games there are some changes to do ;)

Edited by goliath86

Share this post


Link to post
Share on other sites

Can anyone confirm this works? Since I haven't gotten it to work. In fact unless the SOM module is synched to someone from the start of the mission, I haven't been able to make it work at all. :-/ What am I doing wrong?

Regards,

Wolfrug

Share this post


Link to post
Share on other sites

Yes, this code works! I have tested it a lot! With this code you DON'T need to put the SOM module in the mission editor because the module is created at the trigger activation (i.e. on Radio Alpha trigger activation).

try this:

1.put in editor a GameLogic object and put in its initline this:

beta = group this

2.put a unit (player) in the editor

3.put a trigger (Radio Alpha activation) and in its 'On activation' field write this code:

"SecOpManager" createUnit [[0,0,0], beta, "som1 = this; som1 synchronizeObjectsAdd [player]"]; 
som1 setVariable ["settings", [["ambush","attack_location","defend_location","destroy"], true, ["Razor", ["Razor"], "H.Q.", ["HQ"]], 60, false, 10, 1, [400, 700]]];

That's it. Call in Radio Alpha (0-0-1) and after about 60 seconds from the trigger's activation you will start to receive the Secondary Ops. ;)

It works for me.

Share this post


Link to post
Share on other sites

that command doesn't seem to be working for me. the secop doesn't come up after 60seconds with me hitting the radio, and also does activating it just turn it on and it will keep giving one after the other, or do i need to keep hitting the radio every time i want a new secop? Also if the secop is removed how to you keep the arty command to get arty and supply drop exc..?

Share this post


Link to post
Share on other sites
that command doesn't seem to be working for me. the secop doesn't come up after 60seconds with me hitting the radio, and also does activating it just turn it on and it will keep giving one after the other, or do i need to keep hitting the radio every time i want a new secop? Also if the secop is removed how to you keep the arty command to get arty and supply drop exc..?

Blunt, if you just want the SOM to work, and no need for a radio call, like with using a trigger, just put the SOM module in your mission, then put something in it, like:

this setVariable ["settings", [["attack_location", "escort", "destroy", "rescue"], "true", ["Alpha", ["Alpha"], "H.Q.", ["HQ"]], "300", "true", "1800", "0.4", [1500, 3000]]];

Read the info in the wiki about that each thing in that line means. For instance, the 1500 and 3000 is spawn distance for the SecOp missions.

Oh, and name your SOM module.

Share this post


Link to post
Share on other sites

The above method will start the Secop Manager at the trigger's activation (in my example at Radio Alpha activation). On Radio Alpha it will create a SecOp object and initialize it with few parameters. The SecOp Manager will start to 'spawn' missions every 60 seconds (you can change this number) and you don't need to call Radio Alpha every time to call a SecOp. You can also set the SOM variables to make it give you only the support options (artillery, transport etc.). In wiki you can find a complete explanation of the SOM and all its parameters :D

Share this post


Link to post
Share on other sites

Blunt, and in my post above, I did not mention to link the SOM to your player unit. (I just assumed you knew that. Sorry.) Link, not group, to the player unit.

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  

×