I'm writing a Hubnet-application and I want the view of each client to depend on the turtles in that client's variable turtles I can see. In particular I want to hide all turtles not in a clients turtlesIcansee from her.
I've managed to get this to work by checking the 'mirror 2D view on clients' box in the Hubnet-control Center and adding the following code
ask turtles[hubnet-send-override [user-id] of self turtles "hidden?" [true]]
ask turtles[hubnet-send-override [user-id] of self [turtlesicansee] of self "hidden?" [false]]
Although this currently seems to work, I have two questions about the code:
1) The first row is redundant if I could take the complement of turtlesicansee in the second row (and switch false to true). Is there a way to do this, effectively saying that I want to hide all turtles not in turtlesicansee?
2) I'm not sure about the quantification in the second statement. I want to tell every turtle (client) that the only turtles she can see are the turtles in HER turtlesicansee. Is this what I'm getting? Part of what is confusing me is that I'm asking turtles to send the override messages but I don't really see why it matters which turtle the message came from (but I haven't figured out how to get the quantification right without the ask turtles command)
Anyway, can anyone help me with this?