Steve_Yorkshire Posted February 7, 2018 Share Posted February 7, 2018 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.