When trying to replicate a variable of type array<EntityID>, the elements end up as null pointers on the receiver.
Description
Description
Details
Details
- Severity
- None
- Resolution
- Open
- Reproducibility
- Always
- Operating System
- Windows 11 x64
- Category
- General
Steps To Reproduce
- Open workbench
- Add the code below to a script file
//------------------------------------------------------------------------------------------------ modded class SCR_BaseGameMode : BaseGameMode { //------------------------------------------------------------------------------------------------ override protected void OnPlayerSpawned(int playerId, IEntity controlledEntity) { EntityID entityID = controlledEntity.GetID(); array<EntityID> entityIDs = {entityID}; RpcDo_PrintEntityIdBroadcast(entityID, entityIDs); Rpc(RpcDo_PrintEntityIdBroadcast, entityID, entityIDs); } //------------------------------------------------------------------------------------------------ [RplRpc(RplChannel.Reliable, RplRcver.Broadcast)] protected void RpcDo_PrintEntityIdBroadcast(EntityID entityID, array<EntityID> entityIDs) { SCR_ChatComponent chat = SCR_ChatComponent.Cast(GetGame().GetPlayerController().FindComponent(SCR_ChatComponent)); if (!chat) return; chat.ShowMessage(string.Format("entityID = %1 vs entityIDs = %2", entityID, entityIDs)); } }
- Compile and load MpTest.ent in the world editor
- Go to play mode with one peer client
- Check reported EntityID in chat on the peer client.