Replication and TArray with static size.

Hey i have replicated dynamic arrays in the past with no problem.
The only “issue” i found is that in order to have it replicate a array with structs.
And you change a variable in that struct it will not neceserely replicate so workaround was a interger that always gets changed if some member is changed. (No item was added or removed just changed values.)

But now i am in need of a more static array but the integer dont seem to do the trick anymore.
Am assuming this is becuse size is stile the same.

Is there any way to set the sensetivaty of array replication on certen members?
I want this to replicate any changes how ever small.

Thanks for any advice.

Bumping this thread since i can`t find any documentation on this.
Cheers.

Hello, im having the same issue, i would love some advice too. Thx

Yes stile looking for a way to do this my self.
Am sure there are some tid bit of information out there that explains it.
Just need to find it. :stuck_out_tongue:

Hey, i found what was my issue, maybe it is the same as you : “Clients should not add or remove elements on replicated arrays.” https://docs.unrealengine.com/latest/INT/Gameplay/Networking/Replication/Implementation/DynamicArrays/index.html

Hei i am aware of that thanks :slight_smile:

Did you get it replicating?

A static array that never changes the amount of elements in the array?

Array.Num() == AlwaysTheSame and only element itself is changed?

Yeah i got it working, i have an array of a struct, at begin play i add to the array and never touch it again, i simply get/set the variables i need and it replicates just fine. Everything is handled on the server.

Ok great to have that confirmed.
When you say add at Begin Play do you mean that its uninitelized and at launche, you add a static amount of elements you want?

Or is it the static amount of elements set in the constructor?

e.g: YourArray.SetNum(int32 ); or YourArray.SetUninitelized(int32 ); ?

Thanks for the continues help.
Much aprichiated.

Im doing it in blueprint.

Ok, but what is the element count before your game starts?

I just tried with both ways : with empty array before game start then adding to it and with populating the array with default values in the editor so the array elements are added before the game start. Both ways work for me.

Ok thank you so much Raikoh i must have some other problem then.
Aprichiate all the help.

Cheers!

You’re welcome, good luck.