Sync variables within object within object


I was wondering if it is somehow possible to have an object Sync-ed without sending the entire object.


class1 {

@Sync class2 object


class2 {

@Sync var var

@Sync var var2

var var3 // not sending this




The sync system isn’t meant to be used yet, its kind of a work in progress.

To answer y our question, the entire object is not sent, that is the whole purpose of the @Sync directive, to mark a class member as being synchronized across network so anything not marked isn’t sent.

I tried doing it, like I described but its not working. It syncs the entire object, instead of just the @Sync variables (in the @Sync object).

I think you don’t understand what I’m meaning; I have an object(1) which has some @Sync variables (float, string, integer say) which synchronize great. However I also have an @Sync object(2) in the object(1), which I do not want to send entirely, but just the @Sync variables in the object(2).

Btw, I think the syncsystem is working quite nicely already, I was impressed!

Okay I see what you mean. This is not how the system works right now

Can you explain what you’re trying to do? I might implement this

I have different kinds of intelligence: player,opponent and empty. Each of these have a unit assigned to them. I wan’t to sync the intelligence object with the unit, but not the units (graphics)node and other stuff…

I could setup the system differently but this way would be the best.

I think it can be done by adding a special SyncType, and then by checking for its presence in the read function in the SyncSerializer, if present have the read function run again (recursive) (on the object with the special SyncType)? But I might be way off…