Jump to content
Sign in to follow this  
Prv_Jezz

Helicopter Crash Tracker

Recommended Posts

Hi Guys,

i actually make a Multiplayer mission where many units will fly to the Battlefield by Helicopter and the Helis will bring the reinforcements

after a while to the frontline too. But now sometimes a Helicopter Crashes while the human Pilot fly to creapy or he will be shot down.

So what i wannt is if a Helicopter will crash (there 4 Blackhawk Helicopters) the Rescue Team should know that and the Crash position too.

But it dont works. Maybee some body can help me out. :(

So i put in the init of all Helicopters

this addEventHandler ["HandleDamage", {_this execVM "alert.sqf"}];

and in the alert.sqf


//Alert Part 
private ["_namesArray","_marker"];

_namesArray = ["rescue1", "rescue2", "rescue3", "rescue4"];
{
   if((player in _namesArray) && (player distance _x < 30000)) then {
       [player, _x, "loc", rSIDECHAT, "Helicopter Crasht! Look at the Map for the CrashPosition"] call RE;
   };
} forEach playableUnits;

//MarkerPart
nearest = _this;
_gridPos = mapGridPosition nearest;
_marker = createMarkerLocal [_gridPos, nearest]; 
_marker setMarkerShapeLocal "ICON"; 
_marker setMarkerTypeLocal "DOT";
_marker setMarkerColorLocal "ColorRed"; 

//Delete the Marker
sleep 300;
deleteMarkerLocal _marker;

greetings Jezz

Share this post


Link to post
Share on other sites

You don't need the private array at the top, this is only useful if one array name is found multiple times in 1 script.

The nearest array is invalid. If you passed on [player] to the script you need to use select 0 (this is 0 index based so it starts at 0) for it to work properly.

nearest is also used as offset here and that makes no sense. If you have a gridpos of 1536 you will have a marker offset of 1536 aswell. Also due to createMarkerLocal only the crew of the helo will be able to see the marker. Use createMarker instead.

Share this post


Link to post
Share on other sites

By the way, you might still have problems with the choppers. AFAIK they don't do well with that particular EventHandler (won't fire when crash-to-fireball).

Maybe try the MPkilled eventhandler (will save you the locality issues) or just a trigger.

Share this post


Link to post
Share on other sites

Thanks for the replay tryteyker & BlackMamb,

i tryed both and the MPkilled ev dont really works better. So i have a new idea to master the challenge. :D

So i wannt to use a GPS/Transponder "thing". So i added the Helicopter an addaction entry with a Script behind that should show the position on the Map.

But it dont will work pretty smart maybee you got some ideas to fix it. So that it will run on the Deticated Server. I think the problem is that its

4 Helicotpers and not just one. :(

And is it possible to activate the GPS/Transponder if some body will enter the Pilot slot in the Heli? -.-

Add Action in the Heli:

_Transponder = [nil,nil,"per",rADDACTION,["Activate the Transponder",transponder.sqf"]] call RE;

And the GPS/Tracking Script: transponder.sqf


_Trans = _this select 0
_caller = _this select 1
_id = _this select 2
sleep 1;
_Trans removeAction _id

//MarkerPart
nearest = _this;
_gridPos = mapGridPosition nearest;
_marker = createMarker [_gridPos, nearest]; 
_marker setMarkerShape "ICON"; 
_marker setMarkerType "DOT";
_marker setMarkerColor "ColorRed"; 

//Delete the Marker
sleep 300;
deleteMarker _marker;

I think i am to stupid for the arma coding. :(

greetings

Jezz

Share this post


Link to post
Share on other sites

After searching the forums for several hours last night and this morning and finding nothing that helps (this thread is the closest ive been able to find) i was hoping someone could give me a nudge in the right direction.

I made a sp mission where im taking a city from insurgents. I have chopper support, but sometimes one or more of my choppers gets shot down.

My question is this: when a chopper gets shot down i want to make an objective that shows the pos of the chopper and tells me to check the wreckage for survivors. I also want it when i reach the crash site to check off the objective as complete. As the crash site will always be dynamic, i have no idea how to do it in a trigger.

Any help code wise or pointing me to the right thread (i thought a few hours searching here and at armaholic would be enough) will be greatly appreciated.

------EDIT------

found a way to do it for SP in case anyone is interested.

as for the crash site location, i made a trigger with the ((!alive heli1)) condition and had it create a task. instead of using getMarkerPos in the task destination i used getPos "heli1". that created a marker on the map of the site.

I made a second trigger and named it triggerheli1, grouped it to my player, opened the trigger again and set the radius to 10 and set the activation type from vehicle (which it shows when you group the trigger to your player) to "any team member" then put a task SUCCEEDED in the activation field. then in my heli1 init field i put triggerheli1 attachTo[heli1, [0,0,0]];

so now if a chopper gets shot down, a task gets created showing me the location of the crash site, and if myself or any of my team members gets within 10m of it the task will be completed.

hope this helps someone

cheers

Edited by Elzorrogris74
found solution

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  

×