HeroEngine Forums
Welcome, Guest. Please login or Register for HeroCloud Account.

Author Topic: _OnReplicationFieldUpdated not being called - Resolved  (Read 1251 times)


  • General Accounts
  • *
  • Posts: 24
    • View Profile
_OnReplicationFieldUpdated not being called - Resolved
« on: Sep 21, 15, 09:10:35 PM »

I was struggling with this issue all day and figured out why this shared function wasn't being called despite setting appropriate replication parameters for the noderef and its fields and assuring the replication group was working with the correct client destinations. In the end, it turned out that my noderef inherited from multiple classes and one of the other inherited class method scripts had the shared function _OnReplicationFieldUpdated.

If your _OnReplicationFieldUpdated function is not being called, be sure that your noderef doesn't have any other inherited shared functions of the same type (check all parent class method scripts). There can only be one!

EDIT: Jrome pointed out the _OnReplicationFieldUpdated entry on this wiki page holds the answer: http://hewiki.heroengine.com/wiki/Replication_Script_Interface

Called on ClassMethods scripts for classes (OR the first ancestor class that implements it) on the node that contain the field. Only called when the source field definition has Change Callback set to true. These callbacks happen for value changes after _OnReplicationNodeAdded (i.e. they are not called for Initial Set updates) is called and will happen no more than 1 time per class that makes up the node (i.e. the base class and each GLOMmed class assuming they or one of their ancestors implements the function).
« Last Edit: Sep 21, 15, 09:29:00 PM by _Omzy_ »
Odyssey of Ydris