Convoy mission looping

Hello there,

I am trying to make a convoy going from a base to another. If the convoy makes it alive then they start over.
To do this I use the “unitDoBailout” action when the units enter an area. Then I use “unitRespawn” on the starting area.

It does work perfecly fine until the unit is destroyed on the way. Then when it spawns back the unit stay stuck at the starting area, not following it’s waypoints.

Does anyone knows what I am doing wrong here?

I tried to use the “unitSetRoute” after the “unitRespawn” action but that only work if the unit never died on the way. Also the “teleportToStart” doesn’t seems to work

This is probably a bug. We can see that wheeled vehicles destroyed in a unit are never fully resurrected. One of their attributes remains broken no matter what you do (unitRespawn, unitRestore, sleep/wake-up, etc.).

You can even see smoke from their last destruction on some models when you respawn them, even though the vehicle you respawned appears intact.

This isn’t a problem with the setRoute, which seems to be preserved (even a new unitMove action doesn’t make them move at that point), but rather an internal attribute that isn’t being reset.

That would totaly make sense. Though, I managed to make it work, even if it’s not 100% functional.

To do this I have to:

  • make an unitRestore with the option resserectIfDead set to True.
  • use unitSetRoute with the route’s name, teleportToStart set to true and a pos (I use an area for that)
  • then I use unitFollowWaypoints with followWaypoints set to True and resetWaypoints set to False.

With those action set in that order, only then the units will follow the waypoints correctly. I then only use unitPutToSleep/unitWakeUp according to the situation I need.

The only down side of that is, if the unit dies and dont get to the destination. When they will be ressurected, the unit’s 3D model will stay at the same place it died for a while. But the unit’s true position is actualy at the spawn and moving on the way.

It finaly updates after a few seconds but I am not sure if this is because the unit reached the position where it died or if it’s just a matter of time

Hopefully that would help some other people here trying to do the same thing as me

Update on this issue, it seems the 3D model only update it’s position and movement when the actual object reaches it…

Edit: You can fix this by using unitPutToSleep, Wait for 1s and then unitWakeUp.
With that set, your unit will both spawn at the correct location AND the 3D model will follow the object correctly