Jump to content

Recommended Posts

Summary:

With the new mine detector beeping more than your favorite astromech droid I'd thought I'd give it a more alien twist.

This script "converts" the mine detector into a basic motion detector. Warning, do not use in conjunction with actual mines... or do, your choice.

 

Features:

-Beeps and boops (Credit: BIS)

-Lightweight

-Group members are detected but not so beepy.

-Only locomotion is detected, not waving away flies or checking your gun. A standard crawl will avoid detection though.

-Detects motion of vehicles too, not that you'd miss them at that range...

 

Known Issues:

-"Motion" can be a bit twitchy on the detector HUD.

-Friendly AI may spot and reveal their "motion trackers" so they won't beep. You can get around this by executing: {_x disableAI "MINEDETECTION";} forEach allUnits;

 

Singleplayer/Multiplayer:

Should in theory work for both. I haven't had the time or manpower to test properly in MP.

Let me know if you find any issues.

 

Install/Usage:

1. Create "motionDetector.sqf" in your mission folder, for contents see below.
2. In init.sqf execute that sucker like so: 0 = [] execVM "motionDetector.sqf";

3. Put a mine detector in the player's hands.

4. Profit?

 

Future plans:

None, I threw this together real quick just for fun. If you want something added post the suggestion and we'll see.

 

Files:

motionDetector.sqf

Spoiler

//motionDetector.sqf
if(!isDedicated) then {
	private _mineClass = "DemoCharge_Remote_Ammo";
	CMD_run = true;
	private _nearObjects = [];

	while { CMD_run } do {
		private _newObjects = (player nearEntities [["Man", "Air", "LandVehicle", "Ship"], 50]);

		{ 
			private _mine = _x getVariable ["CMD_attachedMine", objNull];
			deleteVehicle _mine;
			_x setVariable ["CMD_attachedMine", nil];
		} forEach (_nearObjects-_newObjects);
		
		_nearObjects = _newObjects;

		{
			if( !(player isEqualTo _x) && (vehicle _x isEqualTo _x) ) then {
				private _mine = _x getVariable ["CMD_attachedMine", objNull];
				if(abs speed _x >= 3) then {
					if(isNull _mine) then {
						_mine = _mineClass createVehicleLocal getPos _x;
						_mine attachTo [_x, [0,0,0]];
						_mine hideObject true;
						_x setVariable ["CMD_attachedMine", _mine];
						if(group _x isEqualTo group player) then {
							playerSide revealMine _mine;
						};
					};
				} else {
					if(!isNull _mine) then {
						detach _mine;
						deleteVehicle _mine;
					};
				};
			};
		} forEach _nearObjects;
		sleep 0.1;
	};
};

 

 

 

  • Like 6
  • Thanks 2

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

×