View Full Version : [Script] MS-2000(M)

05-09-2012, 10:30 PM
Some folks may know I did a Takistan 65 player Domination that is on the RPS server, well I'm currently working through fixing bugs and adding a couple of new features.

One of those features is a small set of scripts I've wrote for a MS-2000 IR strobe that is given to players if the mission is started during or is getting into the night hours. The MS-2000 is a strobe light that players can use via their action menu so others on their team know he/she is a 'good guy', it is attached to the players left shoulder and strobes every second.

The strobe however will only be picked up by NVG, not Thermal and the further away from a 'strober' you are the more you see it, so it works well for infantry/vehicles and pilots.
It is currently set as AddActions given to each player but I am looking into giving it it's own key press to turn on and off.

Anyway the point of this thread is, after I wrote it I also figured it would possably be useful for other missions or sessions, and wanted to know if you ladies and gentlemen would like me to post the scripts or an example mission?

Regards Hawk.

Update 06/09/12:

Example mission: http://www.mediafire.com/?b913leab1h2jxfl (Requires Operation Arrowhead)

Screenshots from example mission: 300m / 50m / 10m
http://i689.photobucket.com/albums/vv260/Phil_J_Dawson/th_MS2000_Example1.jpg (http://s689.photobucket.com/albums/vv260/Phil_J_Dawson/?action=view&current=MS2000_Example1.jpg)http://i689.photobucket.com/albums/vv260/Phil_J_Dawson/th_MS2000_Example2.jpg (http://s689.photobucket.com/albums/vv260/Phil_J_Dawson/?action=view&current=MS2000_Example2.jpg)http://i689.photobucket.com/albums/vv260/Phil_J_Dawson/th_MS2000_Example3.jpg (http://s689.photobucket.com/albums/vv260/Phil_J_Dawson/?action=view&current=MS2000_Example3.jpg)
They are clickable for full size, however they don't really do the scripts justice.
You would be better downloading the example mission.

Just the scripts:

Script call:

MS2000On = player addAction ["MS-2000(M) On","MS_2000Start.sqf"];

Example: Stick the above line of code into your init.sqf


// ************************************************** **************
// Special Forces ACR MS-2000(M) IR Script For Armed Assault Two
// Created by: Hawk_Silk
// ************************************************** **************

player removeAction MS2000On;
Sleep 0.1;
MS2000Off = player addAction ["MS-2000(M) Off", "MS_2000Stop.sqf"];
MS2000Active = true;
player addEventHandler ["killed", {MS2000Active = false}];
player say3d "Click01";
sleep 0.1;
while {MS2000Active} do {
_MS2000IR = "NVG_TargetC" createVehicle getpos player;
_MS2000IR attachTo [player,[0.06,0,0.09],"LeftShoulder"];
Sleep 0.8;
detach _MS2000IR;
deleteVehicle _MS2000IR;
Sleep 0.1;};

// ---------------- Script End ----------------
// ************************************************** **************
// Special Forces ACR MS-2000(M) IR Script For Armed Assault Two
// Created by: Hawk_Silk
// ************************************************** **************

player removeAction MS2000Off;
Sleep 0.1;
MS2000On = player addaction ["MS-2000(M) On","MS_2000Start.sqf"];
MS2000Active = false;
player say3d "Click04";
sleep 0.1;
player removeEventHandler ["killed", 0];
detach _MS2000IR;
_MS2000IR setPosATL [-10000,-10000,100000];
deleteVehicle _MS2000IR;

// ---------------- Script End ----------------

You are free to use these scripts in any missions you make, only stipulation is the standard non commercial use.
As for credit, well as far as I'm concerned not necessary, but it would be nice if you choose to do so.

Regards Hawk.

05-09-2012, 11:18 PM
I'd advise against a custom keypress; there are too many ways for people to configure their key layout in Arma to choose a key that wont get in the way (for example my NVG is on G, my gear on H and compass/clock/gps on T).

I can't say how useful it is as I haven't seen it in action but I surely sounds nifty, can't hurt to post the script?

Black Mamba
06-09-2012, 12:09 AM
Definitely. There's aMS-2000 in ACE and it's really a nice thing to have for night ops. If it could reduce the amount of blue on blue, i'm all for it.
Now, we don't play much Specops type missions either, so... Kinda hard to include i guess.

06-09-2012, 01:28 AM
We could do with a few smaller count spec ops missions though.

06-09-2012, 08:43 AM
We could do with a few smaller count spec ops missions though.

So does ACRE friday ;D

06-09-2012, 12:51 PM
First post updated.

Wolfenswan is correct about the keys, so I haven't done that (yet) but if I do in future it will be a different version to this one, not a replacement. Incidently I was thinking of using 'Alt Gr' as the key. Any thoughts on that?

Regards Hawk.

06-09-2012, 01:10 PM
Could you make it configurable, like the custom keys in ACE/ACRE? Even having to edit a text file would be OK

Black Mamba
06-09-2012, 01:11 PM
Out of curiosity, I have two questions.

Why did you not choose to use the OA IRStrobe, which already flashes on and off, instead of creating/attaching/detaching/deleting a NVG_Target?

Why turn off the stuff when the player dies?

An third (yup), i haven't tested this yet, so forgive me if i'm wrong, but i don't see anything preventing another player to activate or deactivate my strobe. Maybe something like

if (local player) then {

MS2000On = player addAction ["MS-2000(M) On","MS_2000Start.sqf"];

Just to be clear, these are legitimate questions, not some "you're stupid and should have done that instead" bullshit.

06-09-2012, 01:24 PM
Would it be possible to expand the addAction call, so that it locks down the scope of who can invoke the actions (e.g. the player, and not the people around her/him)? This is how we do it for the JIP options. Stops your addActions menu filling up with identical entries when you're around other players (making it impossible to see which one is *yours*).

Edit: Also, because I forgot my manners, comrade: Nice work :)

06-09-2012, 01:25 PM
Harlander: I haven't got to adding custom key presses yet, but if/when I do I will look into your request.

Black Mamba: Your welcome, now your questions,

1) Why did you not choose to use the OA IRStrobe...

So it would work with regular Arma 2 and because "NVG_TargetC" will be targeted by Independent AI, however this script was originally wrote for Domination where it is East vs West and no Independents.

2) Why turn off the stuff when the player dies?

Domination = Respawn, plus it just tidies the battlefield of one less (now) useless object. If you want it to remain on even when a player is dead in your mission(s) just remove "player addEventHandler ["killed", {MS2000Active = false}];" from MS_2000Start.sqf.

3) but i don't see anything preventing another player to activate or deactivate my strobe.

This is where the 'Player' command comes in useful, as when you play Singleplayer you are the player (obviously) however in Multiplayer each player is local to his machine only, there for if you activate the script you are the 'player' on your machine meaning the script only works for you there. Basically no other players can only activate/deactivate their own strobe lights.

Fer: Thanks and in my tests with JRides #3 answer to Black Mamba applies. If it behaves differently on a Dedicated server let me know.

Regards Hawk.

Black Mamba
06-09-2012, 01:35 PM
My bad. Wrong understanding of the player command in MP, it seems. Means most of the stuff i made contains useless code then.