Jump to content

net_entity doesn't update when using for ShardNetwork


Philip.
  • Closed

It looks like the net_entity after being set doesn't change on the slave shards at all. Other netvar types as net_byte or net_bool work as expected.

Not sure if this is some intended behaviour or I am missing something important but it seems inconsistent at least.


Steps to Reproduce
  1. Create an entity with shard network on the Master shard and all the slave shards (inst.entity:AddShardNetwork()).
  2. Setup an entity network variable using net_entity(...), and also a network boolean variable by calling net_bool(...).
  3. Register event listeners for all the slave shards.
  4. Set a table for the net_entity on the Master shard.
  5. See that nothing has changes on the slave shards and no events have been pushed.
  6. Now set the net_bool variable to true on Master and see that it changes on the slave shards as expected.



User Feedback


It is unable to network entities like this because the other shard would not know what to do with an entity number where it has no copy of it on its instance. For your mod you will want to use another method to send whatever data you are wanting to replicate over and recreate it on the other side as a special case.

Changed Status to Closed

  • Like 1
  • Thanks 1

Share this comment


Link to comment
Share on other sites

7 hours ago, JesseB_Klei said:

It is unable to network entities like this because the other shard would not know what to do with an entity number where it has no copy of it on its instance. For your mod you will want to use another method to send whatever data you are wanting to replicate over and recreate it on the other side as a special case.

Changed Status to Closed

Ah, so as I expected, shards do not support networked entities.

I will have to stick with the shard RPCs and zipped encoded json string of the entity's save record then.

Anyway, thanks for clearing things up!

Share this comment


Link to comment
Share on other sites



Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
  • Create New...