Jump to content

AIplayer Teleported Beyond Scope Leaves Mounted Objects Behind


Steve_Yorkshire

Recommended Posts

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
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.

×
×
  • Create New...