Jump to content
evans d [16aa]

Help Getting AI to follow Scripted Waypoints

Recommended Posts

Ladies and gentlemen,

 

I'm making a nonsense mission for myself to learn some scripting and to use as a repository for any script that I may use later. Think of it as me creating a library for myself to use when I don't have internet to check scripting.

 

I'm currently trying to code up some waypoints for some AI that I've spawned in via a script. In my testing, however, the group gets into the helicopter I specify, but when I tell them to get out they seem to suffer from an agoraphobic attack and immediately get back into the helicopter rather than the boat they're supposed to.

 

Oddly enough, if I order them to get into the boat without getting into the helo first they don't mind at all, so the problem is clearly in waypoint 2.

 

So: Who can see the problem?

 

spawnSplashdown.sqf

Spoiler

splashdown = createGroup WEST;

"B_diver_TL_F" createUnit [getMarkerPos "mkr_splashdownSpawn", splashdown];
"B_diver_F" createUnit [getMarkerPos "mkr_splashdownSpawn", splashdown];
"B_diver_F" createUnit [getMarkerPos "mkr_splashdownSpawn", splashdown];
"B_diver_F" createUnit [getMarkerPos "mkr_splashdownSpawn", splashdown];

 

waypoint1.sqf

Spoiler

_wp1 = splashdown addWaypoint [getPos chariot_helo,1];
[splashdown,1] setWaypointType "GETIN";
_wp1 waypointAttachVehicle chariot_helo;

splashdown setCurrentWaypoint [splashdown,1];

 

waypoint2.sqf

Spoiler

{unassignVehicle chariot_Helo; _x action ["GETOUT",chariot_Helo]} foreach units splashdown;

_wp2 = splashdown addWaypoint [getPos splashdown_boat,2];
[splashdown,2] setWaypointType "MOVE";
_wp2 waypointAttachVehicle splashdown_boat;

splashdown setCurrentWaypoint [splashdown,2];

 

waypoint3.sqf

Spoiler

_wp3 = splashdown addWaypoint [getPos splashdown_boat,3];
[splashdown,3] setWaypointType "GETIN";
_wp3 waypointAttachVehicle splashdown_boat;

splashdown setCurrentWaypoint [splashdown,3];

 

 

Cheers chaps.

 

P.S: Bonus points if you're able to change "GetOut" to Eject. I'm not sure what I'm doing wrong but simply changing it to "EJECT", vehicle chariot_Helo doesn't seem to work for me.

 

 

 

 

EDIT: Included all scripts involved in the chain in case you can think of a neater way of doing things or if there's anything obviously wrong with the others that could be impacting this.

Share this post


Link to post
Share on other sites

It seems you don't unassign the right unit. Instead of :

{unassignVehicle chariot_Helo; _x action ["GETOUT",chariot_Helo]} foreach units splashdown;

try:

{unassignVehicle _x; _x action ["GETOUT",chariot_Helo]} foreach units splashdown;

 

 

Share this post


Link to post
Share on other sites

Cheers for the suggestion, but they're not jumping out at all now and, frustratingly, it's not throwing an error at me so I don't have a clue where it's going wrong.

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

×