Jump to content
Sign in to follow this  
joa666

Adding waypoint to a scripted vehicle

Recommended Posts

Hi everybody,

 

I'm trying to spawn a vehicle with crew via script and add one or more waypoionts to it.

 

eerything works fine if the spawnd unit is an infantry group. But if the group contains a vehicle it dosen't work.

 

After searching the net for a solution I found dozends of topics bout it. But they all didn't help me with my problem.

 

Here is the script I use:

---------------------------------------------------------------------------------------------------------------------------

if(!isServer)exitWith{};

 

G001 = createGroup east;

 

_veh = createVehicle ["CUP_O_BMP_HQ_RU",getMarkerPos "X1",[],0,"NONE"];
[
    _veh,
    [
        ["CUP_O_RU_Soldier_VDV_EMR","driver"]
    ]
] call BIS_fnc_initVehicleCrew;


WP001 = G001 addWaypoint [getMarkerPos "X1a", 0];
WP001 setWaypointType "MOVE";
WP001 setWaypointSpeed "LIMITED";
WP001 setWaypointBehaviour "SAFE";

 

------------------------------------------------------------------------------------------------------------------------------

 

The vehicle spawns after I have activated the script, but the unit doesen't care about the waypoint.

 

I'm pretty shure I have forgotten something, but I really don't know what.

 

Maybe one of you can help me with that.

 

Thanks for helping me

 

Greetz

 

Joa

Share this post


Link to post
Share on other sites
// init.sqf
waitUntil {time > 0};

player addAction ["Spawn BMP", {
	private _veh = createVehicle ["O_APC_Wheeled_02_rcws_F",getMarkerPos "X1",[],0,"NONE"];
	createVehicleCrew _veh;
	
	private _grp = group commander _veh;	
	private _wpp = _grp addWaypoint [getMarkerPos "X1a", 0];
	_wpp setWaypointType "MOVE";
	_wpp setWaypointSpeed "LIMITED";
	_wpp setWaypointBehaviour "SAFE";
}];

Sample mission: Link

 

BIS_fnc_initVehicleCrew seems broken in my client.

Share this post


Link to post
Share on other sites

Thanks for your quick help ... it works fine ...

 

My choosen BMP is not working, but with most of the other vehicles it's working fine.

 

Don't know why but thats a problem I could handle.

 

Thanks again.

 

Share this post


Link to post
Share on other sites

You add your waypoint to group G001 but I ask you is that the group the crew belongs to? 

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  

×