Hi Geez,
We discovered a problem with replication/streaming yesterday while moving an Ai Unit into Vehicle.
This only happening if the Vehicle have turret!
// Move in compartment (Master/Server only! SpawnedEntity = AiCharacter, m_owner = owner Vehicle) SCR_CompartmentAccessComponent compartComp = SCR_CompartmentAccessComponent.Cast(SpawnedEntity.FindComponent(SCR_CompartmentAccessComponent)); if(compartComp) { BaseCompartmentSlot freeSlot = compartComp.FindFreeCompartment(m_owner, ECompartmentType.TURRET, false); if(freeSlot) { if(!compartComp.GetInVehicle(freeSlot.GetOwner(), freeSlot, true, -1, ECloseDoorAfterActions.INVALID, true)) { Print("Can not move Entity into compartment!", LogLevel.ERROR); SCR_EntityHelper.DeleteEntityAndChildren(SpawnedEntity); } } else { Print("No free compartment slot found!", LogLevel.ERROR); SCR_EntityHelper.DeleteEntityAndChildren(SpawnedEntity); } }
This will search for a free turret on the owner (Vehicle). If found, the spawned AI will move into the compartment slot.
This works well while testing in Workbench and PeerTool. But if you run it onto dedicated, the Script does not return any Print. So GetInVehicle will be true.
But, the spawned AI is desync on the clients and get not streamed correctly. On some clients the AI Unit is swimming on 0,0,0 and on other clients the Unit is in the Turret.
If you try to move the Unit by GM, it gets synced again but on 0,0,0 and not in the Turret.
Also: If you like to move more spawned Units in the same Vehicle (different compartments!), you had to delay each call by 1000ms, otherwise only the first Unit will teleport into compartment slot.