Author Topic: TNManager.Create, Loss of Information and Authority  (Read 2996 times)

Smooth P

  • Guest
TNManager.Create, Loss of Information and Authority
« on: February 05, 2013, 03:55:17 AM »
Quote
TNManager.Create does not give you a return value. The object creation is delayed, as it happens on all remote computers. If you need to set additional parameters, you need to do so via an RFC call so it's properly synchronzied.

Totally understandable.


Quote
TNManager.Create is an asynchronous call and it has no return type. If you want to do anything with it, do it in an Awake() call in a script attached to the object you're instantiating. TNManager.isThisMyObject tells you if you're the one who created it.

But is an Awake() script really the only way to set additional parameters?  Aren't RFCs ordered, and if so couldn't you return the object (at least on the host) or it's pending Id and make / defer calls on it that would happen after creation on remote machines?  There is a lot more potentially crucial information available at the time of object creation than who the creator is, not to mention that in many scenarios the host should be in charge of creating objects as he's the only one who knows the true game state.
« Last Edit: February 05, 2013, 04:29:00 AM by Smooth P »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: TNManager.Create, Loss of Information and Authority
« Reply #1 on: February 05, 2013, 09:52:34 AM »
Two different things here. Checking the isThisMyObject flag in the object's Awake() function simply tells you if you're the one who created this object or not. An example would be if you instantiated a spaceship and you want to add a player controller component, but only on the client that created this space ship.