Jump to content
Sign in to follow this  
barbolani

Heli Scripted Waypoints TR UNLOAD & GETOUT not working

Recommended Posts

Hello!

Getting mad with this. Tried everything I know and helo or just stops in ground without unloading troops or as soon as it lands, flies away:

_pad = createVehicle ["Land_HelipadEmpty_F", _landpos, [], 0, "NONE"];
	_grupo = [_orig, EAST, (configfile >> "CfgGroups" >> "East" >> "OPF_F" >> "Infantry" >> "OIA_InfSquad")] call BIS_Fnc_spawnGroup;
	{_x assignAsCargo _veh; _x moveInCargo _veh;} forEach units _grupo;

	_wp0 = _grupoheli addWaypoint [_landpos, 0];
	_wp0 setWaypointType "TR UNLOAD";
	_wp0 setWaypointStatements ["true", "(vehicle this) land 'GET OUT';"];
	[_grupoheli,0] setWaypointBehaviour "CARELESS";
	_veh setBehaviour "CARELESS";
_wp3 = _grupo addWaypoint [_landpos, 0];
	_wp3 setWaypointType "GETOUT";
	[_grupo, 0] synchronizeWaypoint [_grupoheli, 0];

_wp4 = _grupo addWaypoint [_posicion, 1];
	_wp4 setWaypointType "MOVE";


 	_wp1 = _grupoheli addWaypoint [_posicion, 1];
	_wp1 setWaypointType "SAD";
	[_grupoheli,1] setWaypointBehaviour "AWARE";
	_wp2 = _grupoheli addWaypoint [_orig, 2];
	_wp2 setWaypointType "MOVE";

Please gurus, help!

Share this post


Link to post
Share on other sites

The script worked ok for me, I suspect the problem your having is related to the bits we can't see.

Make sure the _grupoheli is set correctly and markers are using getmarker

Share this post


Link to post
Share on other sites
The script worked ok for me, I suspect the problem your having is related to the bits we can't see.

Make sure the _grupoheli is set correctly and markers are using getmarker

In your case your troops disembark?

Share this post


Link to post
Share on other sites

Oh damm.... In mine they stay on the heli even when I join the player to the cargo group, I see a clear "GETOUT" on the waypoint. Chopper lands but no one exits. The leader does not issue the "All, get out" command.

Cant understand how it worked for you, the waypoint sync had a typo...

A half solution I found is to issue a GETOUT waypoint for both groups, but that makes the pilots getout, not very nice...

The entire script as it is now (I didn't sent it before because it uses some global variables and markers):

if (!isServer) exitWith{};

_marcador = _this select 0;

_soldados = [];
_vehiculos = [];
_grupos = [];

_posicion = getMarkerPos (_marcador);
_orig = getPos refuerzos;

_veh = "O_Heli_Light_02_F" createVehicle _orig;
_vehiculos = _vehiculos + [_veh];
_veh lock 3;
_veh addEventHandler ["killed",{xp = xp + 2;}];
createVehicleCrew _veh;
_grupo = group (crew _veh select 1);
_soldados = _soldados + crew _veh;
CSAT = CSAT + crew _veh;
_grupos = _grupos + [_grupo];

_grupoheli = group (driver _veh);


_closestdist = 0;
_landpos = [];

while {(_closestdist < 400)} do
{
	_landpos = [_posicion, 300, 500, 10, 0, 0.3, 0] call BIS_Fnc_findSafePos;
	mrkfin = createMarker ["BREnd", _landpos];
mrkfin setMarkerShape "ICON";
mrkfin setMarkerType "hd_destroy";
mrkfin setMarkerColor "ColorRed";
_closest = [marcadoresFIA, _landpos] call BIS_fnc_nearestPosition;
_closestdist = (getMarkerPos _closest) distance _landpos;
};
_landPos set [2, 0];

_pad = createVehicle ["Land_HelipadEmpty_F", _landpos, [], 0, "NONE"];
_grupo = [_orig, EAST, (configfile >> "CfgGroups" >> "East" >> "OPF_F" >> "Infantry" >> "OIA_InfSquad")] call BIS_Fnc_spawnGroup;
{_x assignAsCargo _veh; _x moveInCargo _veh; _soldados = _soldados + [_x]; [_x] execVM "COUNTER\CSATinit.sqf"} forEach units _grupo;

_wp0 = _grupoheli addWaypoint [_landpos, 0];
_wp0 setWaypointType "TR UNLOAD";
_wp0 setWaypointStatements ["true", "(vehicle this) land 'GET OUT'"];
[_grupoheli,0] setWaypointBehaviour "CARELESS";
_wp3 = _grupo addWaypoint [_landpos, 0];
_wp3 setWaypointType "UNLOAD";
_wp0 synchronizeWaypoint [_wp3];

_wp4 = _grupo addWaypoint [_posicion, 1];
_wp4 setWaypointType "MOVE";

_wp1 = _grupoheli addWaypoint [_posicion, 1];
_wp1 setWaypointType "SAD";
[_grupoheli,1] setWaypointBehaviour "AWARE";
_wp2 = _grupoheli addWaypoint [_orig, 2];
_wp2 setWaypointType "MOVE";

Edited by barbolani

Share this post


Link to post
Share on other sites

I see your using createVehicleCrew _veh;

This seems to be the problem and it's a little odd.

They seem to obey most of the waypoints except the TR unload action, leaving the waypoints untouched but spawning the chopper with a crew works fine.

I've tried all sorts of combinations, having the crew join a group, addvehicle, group leader _veh and none of them seem to work when you use createVehicleCrew.

//null=["orig","land","SAD"] execvm "landing.sqf"


_orig = getmarkerpos  (_this select 0); 
_landpos = getmarkerpos (_this select 1);
_posicion = getmarkerpos (_this select 2);  

_vehicle=[_orig, 0, "O_Heli_Light_02_F", EAST] call bis_fnc_spawnvehicle;
_veh = _vehicle select 0;
_vehCrew = _vehicle select 1;
_grupoheli = _vehicle select 2;
_vehDriver = driver _veh;
_veh setpos [getpos _veh select 0,getpos _veh select 1,0];


_pad = createVehicle ["Land_HelipadEmpty_F", _landpos, [], 0, "NONE"];
	_grupo = [_orig, EAST, (configfile >> "CfgGroups" >> "East" >> "OPF_F" >> "Infantry" >> "OIA_InfSquad")] call BIS_Fnc_spawnGroup;
	{_x assignAsCargo _veh; _x moveInCargo _veh;} forEach units _grupo;
     _veh setvariable ["wait",_grupo];

	_Hwp0 = _grupoheli addWaypoint [_landpos, 0];
	_Hwp0 setWaypointType "TR UNLOAD";
	_Hwp0 setWaypointStatements ["true", "(vehicle this) land 'land';"];
	_Hwp0 setWaypointBehaviour "CARELESS";

	_veh setBehaviour "CARELESS";
_veh disableAI "AUTOTARGET";

_Gwp0 = _grupo addWaypoint [_landpos, 0];
	_Gwp0 setWaypointType "GETOUT";
	_Gwp0 synchronizeWaypoint [_grupoheli, 0];

_Gwp1 = _grupo addWaypoint [_posicion, 1];
	_Gwp1 setWaypointType "MOVE";


 	_Hwp1 = _grupoheli addWaypoint [_posicion, 1];
	_Hwp1 setWaypointType "SAD";
    	_Hwp1 setWaypointBehaviour "AWARE";

	_veh enableAI "AUTOTARGET";
	_Hwp2 = _grupoheli addWaypoint [_orig, 2];
	_Hwp2 setWaypointType "MOVE";

I set it up using 3 markers

"orig" = start position

"land" = where to drop off units and

"SAD" = where I'm moving the group to

Share this post


Link to post
Share on other sites

Thanks a lot. Will try ASAP with function instead of createVehicle.

Sounds werid, because the problem does not seem to be in the heli group, as it waits (in my last version) for the other group to issue the "Getout" order just as allways.

Question: what's the purpose of this?: _veh setvariable ["wait",_grupo];

Share this post


Link to post
Share on other sites

It's not part of the code it was something else I was trying just delete it.

Yes when I use createVehicleCrew _veh they just wait and the other group never get out.

There just seems to be some strange failure with this command.

Edited by F2k Sel

Share this post


Link to post
Share on other sites

WORKS!!

Than you very much! Without your help I would probably make 1.000 attempts (more) before trying to change the spawning method.

I owe you a spirit!

Share this post


Link to post
Share on other sites

Sorry to post this in a two year old thread, but this came up first when googling the error, so...

 

I have found just recently that if you have the script attached to the vehicle instead of the pilot/squad leader/etc (easy to do in the editor by accident), the GETOUT/TR UNLOAD waypoints won't work correctly.

 

Fix this by either making sure you have the pilot selected when you attach the script, or by using

driver VEHICLENAME

to select the driver, not the vehicle.

 

*lurks away*

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  

×