Jump to content
Sign in to follow this  
Beerkan

Waypoint Parameters Help

Recommended Posts

My parameters..

On my map I create 3 locations.

"Heli_Spawn"

"Heli_Crew"

"Dropoff_location"

I want to spawn a helo and crew, on demand @ "Heli_Spawn" and "Heli_Crew" on my map. I then want them to move to my "Dropoff_location" which I will specify.

After the helo reaches "Dropoff_location" I want it to return to land at "Heli_Spawn" where I wish to delete all crew and craft.

All works well except the helo and crew will not delete. They just land and get out.

The following script moves my Helo from it's "Heli_Spawn" location to "Dropoff_location", and back to "Heli_Spawn" location, however, it will not delete them all.

Also, for debugging purposes, I'd like to know when my Helo has arrived at it's location. This line doesn't work but something like this.

[_heligrp, 1] setWaypointStatements ["true",hint "Debugging, Helo has arrived at Drop_location"];

In the meantime, here's my current script

if (isServer) then {
_actype = "MH60S";
_amtype = "USMC_Soldier_Pilot";
_side = createGroup WEST;
_heli1 = _actype createVehicle (getMarkerPos "Heli_Spawn");
_spwn = getmarkerpos "Heli_Crew";
_dl1 = getmarkerpos "Drop_location";
_pilot = _side createUnit [_amtype,_spwn, [], 0, "NONE"];
[_pilot] join _sideNull;
_heligrp = group _pilot;
_pilot moveinDriver _heli1;

sleep 1;

_heligrp addwaypoint [_dl1, 1];
_heligrp addwaypoint [getmarkerpos "Heli_Spawn", 2];
[_heligrp, 2] setWaypointType "GETOUT";
[_heligrp, 2] setWaypointStatements ["true", "{{deleteVehicle _x} forEach crew _x;} foreach units _side;"];

};

Any help would be much appreciated..

Thanks.

Edited by Beerkan

Share this post


Link to post
Share on other sites

I had to change spawned unit local variables to global variables.

_sidenull to grpnull

_side in setwaypointstatements to heligrp

includes several way to do it and how to include hint, any thing that has "quotes" around in needs extra ""quotes""

if (isServer) then {
_actype = "MH60S";
_amtype = "USMC_Soldier_Pilot";
_side = createGroup WEST;
heli1 = _actype createVehicle (getMarkerPos "Heli_Spawn");
_spwn = getmarkerpos "Heli_Crew";
_dl1 = getmarkerpos "Drop_location";
pilot = _side createUnit [_amtype,_spwn, [], 0, "NONE"];
[pilot] join grpNull;
heligrp = group pilot;
pilot moveinDriver heli1;

sleep 1;

heligrp addwaypoint [_dl1, 1];
heligrp addwaypoint [getmarkerpos "Heli_Spawn", 2];
[heligrp, 2] setWaypointType "getout";
//[heligrp, 2] setWaypointStatements ["true", "{{deleteVehicle _x} forEach crew _x;} foreach units heligrp;deletevehicle heli1"];
//[heligrp, 2] setWaypointStatements ["true", "{deleteVehicle _x} foreach units heligrp;deletevehicle heli1;"];
//[heligrp, 2] setWaypointStatements ["true", "{deleteVehicle _x} foreach units heligrp;deletevehicle heli1;hint ""Chopper has been deleted"""];
[heligrp, 2] setWaypointStatements ["true", "deleteVehicle pilot;deletevehicle heli1;hint ""Chopper has been deleted"""];

};

Share this post


Link to post
Share on other sites

many thanks brother.

Worked like a charm.

+1 Beers to you.

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  

×