Author Topic: TNManager hierarchy and RCCs?  (Read 4785 times)

danfoo

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 2
  • Posts: 93
    • View Profile
TNManager hierarchy and RCCs?
« on: March 03, 2014, 07:45:02 AM »
Hi,

We will be spawning objects via RCCs, and have read that the functions should be located on the same object as TNManager or on a child. However, some of the functions will only make sense in game (and not in menu scenes, etc.). Will adding child objects to TNManager after scene load still enable TNManager to find functions on these in the event of RCCs?
Ie.
1. Game starts in menu. TNManager present but no child objects
2. After load of a game scene, a few manager objects are added to the TNManager object, some of these containing RCCs
3. On game exit, these managers are killed and only TNManager remains when returning to the menu scene.

Would that work as intended? Thanks!

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: TNManager hierarchy and RCCs?
« Reply #1 on: March 04, 2014, 01:10:17 AM »
This limitation was lifted in 1.8.5. You can now place RCCs anywhere, as long as you register your object that has RCCs using TNManager.AddRCCs(...) before the function is actually needed.

danfoo

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 2
  • Posts: 93
    • View Profile
Re: TNManager hierarchy and RCCs?
« Reply #2 on: March 04, 2014, 05:49:33 AM »
This limitation was lifted in 1.8.5. You can now place RCCs anywhere, as long as you register your object that has RCCs using TNManager.AddRCCs(...) before the function is actually needed.
Perfect! Thanks!
How is removal handled, between sessions? Are they purged on level load, or is there a risk they may add up after multiple sessions? IE:

1. New game is started
2. RCCs added
3. game ends, clients may disconnect - or not. Channel lives on.
4. Return to menu scene - TNManager still allive
5. New game
6. ?  :)

Edit: Unrelated question: Can we safely assume that RFCs are 1) ordered properly on all clients, 2) will always arrive? Searched a bit for that but did not find a clear answer.
« Last Edit: March 04, 2014, 08:21:59 AM by danfoo »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: TNManager hierarchy and RCCs?
« Reply #3 on: March 05, 2014, 08:35:38 AM »
RCCs don't get removed right now, so you have to be careful -- but it's generally not an issue because you should set them to be static functions anyway. Static functions don't need an instance of an object in order to work.

RFCs always arrive in the same order they were sent. They will always arrive as long as the object they're associated with still exists.