I have a question regarding GetLifeTimeReplicatedProps.
Can you change conditions for replication for subclasses? Is this supported? If so what is the intended way to go about this?
Do i need to bypass parent which defines replication condition? Or should I just call up the tree with Super?
Also I would be interested in knowing where this is called in code, I can’t seem to find it.
Edit: So I found DOREPLIFETIME_CHANGE_CONDITION, I’m assuming this is what is intended to be used? I am assuming I can safely call Super with this?
Okay, so with further investigation I have found some things out, this is how I understand some of these macros.
In UnrealNetwork.h, we have:
DOREPLIFETIME_CHANGE_CONDITION - This is to change replication condition for subclasses
DOREPLIFETIME_ACTIVE_OVERRIDE - This can be used in the PreReplication method to actively (gameruntime) customize conditions, I am assuming this still takes into account what was set in GetLifetimeReplicatedProps if the condition is true?
DOREPLIFETIME_CONDITION_NOTIFY - Allows to set notify to run always even if client value is the same as replicated ( this is interesting because it seems to imply that OnRep functions will not be called if value is changed on client prereplication and the value is the same as what has been sent down by server?
DOREPLIFETIME_DIFFNAMES - This one I am not quite clear on…?
So the DOREPLIFETIME_CHANGE_CONDITION is what I wanted. I am assuming I can use this to also change parent LifetimeProperty that was not set to a condition? Looks that way…
I am still not sure where GetLifeTimeReplicatedProps is called in code, the main reason I wanted to know is if this is done once only, I got my reply from this post → Network Tips and Tricks - Unreal Engine, which says the information is baked as early as possible.
Just a heads up for anyone looking up how to override inherited DOREPLIFETIME() variables, you now have to use one of the following.
RESET_REPLIFETIME()
RESET_REPLIFETIME_CONDITION()
RESET_REPLIFETIME_FAST()
RESET_REPLIFETIME_CONDITION_FAST()
RESET_REPLIFETIME_FAST_STATIC_ARRAY()
RESET_REPLIFETIME_WITH_PARAMS()
The rest of the potential overrides (Resets) can be found at line 453 in UnrealNetwork.h as of 5.4.2
1 Like