Author Topic: Setting variables on created objects  (Read 1792 times)

Scobbo

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 29
    • View Profile
Setting variables on created objects
« on: March 31, 2014, 12:02:19 AM »
Hi,
I have a game where the server is an instance of the game that is responsible for creating instances of objects for AI. These objects when created need to have certain variables set including who owns them and what colour they are. The problem is when I create them I can't give them anything because they can't be set to a reference, and the only way I can think to do this is to have the objects look to the server controller for the variables it needs but if there are several people doing this at once then things get messy and problems start occurring such as wrong team being set. Is there a standardized way of doing this?

Kindest regards and many thanks,
Scobbo

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Setting variables on created objects
« Reply #1 on: March 31, 2014, 06:58:55 AM »
You can pass any number of parameters in a Create call by using CreateEx functionality as explained in the sticky post: http://www.tasharen.com/forum/index.php?topic=5416.0