Jump to content
Sign in to follow this  

Disembarked AI getting stuck

Recommended Posts

Hello all,


I've been working on a mission akin to Shapur Siege, with slightly more challenge and less suicidal maniacs.


Generally speaking I'm building on my constant OPFOR replacement script, but instead of just spawning the AI enemy infantry groups in, they're now ferried from logical locations and from different directions. This is working OK so far, but I've hit a snag that keeps me from release.


Order of operations is as follows:


1. The spawn loop checks the amount of enemies on the map.

2. If it's under a certain threshold it will spawn a group.

3. The selection type of group is randomized. It could be dismounted infantry, it could be motorized infantry, mechanized even.

4. The infantry squad is spawned.

5. The vehicle is spawned.

6. The squad is assigned to the vehicle, then put into the vehicle by script.

7. The infantry group is given a "GETOUT" waypoint near the objective, then an attack waypoint.

8. The vehicle is given a "TRUNLOAD" waypoint at the dismount waypoint and depending on the type of vehicle, will either get a move waypoint back to it's starting location to retreat or goes with the squad to attack.


The issue lies with the dismounting infantry. Some of the units will just get stuck on the spot they disembark. Depending on type and vehicle, the amount of stuck units changes. I'm not sure what causes this, as I've other missions use a similar method without flaw.


If anyone has an idea please let me know. If you want to take a look, they prototype is available here:




The script governing the spawning/assigning of waypoints etc is L3\L3_spawngroupcdf.sqf



Share this post

Link to post

I have resolved this.


When units are spawned and for any reason need to play an animation (reload, self-treatment etc) and are immediately moved into cargo, they will exhibit the getting stuck behavior.


Adding a sleep of ~20 after spawning the group and before moving them into the vehicle will circumvent the problem.

Share this post

Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Create New...