AIplayer Teleported Beyond Scope Leaves Mounted Objects Behind

There are no stupid questions, just stupid answers.
1 post Page 1 of 1
Steve_Yorkshire
Posts: 247
Joined: Tue Feb 03, 2015 10:30 pm
 
by Steve_Yorkshire » Thu Feb 08, 2018 12:12 am
Whilst playing around with teleporting Aiplayers randomly around the level I found that sometimes they abandon their mountedObjects. (note server is local)

I put this down to the Ai being sent a distance greater than theLevelInfo.visibleGhostDistance. Inside this distance and mountedObjects stick to the aiplayer, beyond it mounted objects are abandoned at their previous position. If the aiplayer teleports back the mounted objects are still abandoned. If function is called on the mounted objects, they will resume to the aiplayer's current location: eg: %aiplayer.unmountObject(%mountPoint);

I got around this by simply telling the aiplayer to check for mounted objects and set their positions to the current one.
//example
function AIPlayer::teleportMounts(%aiplayer, %xyz)
{
   //use the mountedObject array 
   %num = %aiplayer.getMountedObjectCount();

   for(%i = 0; %i < %num; %i++)
   {
      %mount = %aiplayer.getMountedObject(%i);
       
      if(isObject(%mount))
         %mount.setPosition(%xyz);
   }
}
However I'm thinking this would probably be best automated in C++ by forcing object to setPosition when host object is setTransform/setPosition itself.
Or just have really big visibleGhostDistance set in theLevelInfo. ;)

Anyhow, it's just a behaviour which I have observed.
1 post Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest