HeroEngine Forums
Welcome, Guest. Please login or Register for HeroCloud Account.

Author Topic: [Resolved] Where to associate nodes on client?  (Read 915 times)

Legacy

  • General Accounts
  • *
  • Posts: 117
    • View Profile
[Resolved] Where to associate nodes on client?
« on: Jan 11, 12, 04:22:37 AM »

Hi there, back with another technical question :)

I have a server class that replicates to a client class. I create a node from this class on server like in the Replication tutorial on wiki, it replicates to the client just fine. However, I need that node to be persistent, so I create it like that in EDIT instance, associate it with area root (GetRootNode() external) and sure, it gets saved and I can find it via my scripted tools. However, the CLIENT node is not created automatically when I enter the area, which I need of course.

I assume I could hard-associate the client node with some well known node on the client and it would get loaded when I enter the area, is it so? If yes, what node should I use, because the GetRootNode() function is not available in client scripts. Or is there another solution to this?

Currently I have a chat command that calls the _GetReplicationGroup of all server nodes with my association and that gets the nodes replicated to clients, but it is supposed to be just a temporary hack :)

Thanks for any ideas
« Last Edit: Nov 03, 12, 09:18:03 PM by HE-Cooper »
Logged

HE-Cooper

  • *****
  • Posts: 2221
    • View Profile
Re: Where to associate nodes on client?
« Reply #1 on: Jan 11, 12, 06:27:20 AM »

I'm not sure if this is the right answer, but have you checked out the concept of "system areas" in the wiki?
Logged

Legacy

  • General Accounts
  • *
  • Posts: 117
    • View Profile
Re: Where to associate nodes on client?
« Reply #2 on: Jan 11, 12, 06:44:32 AM »

I'm not sure if this is the right answer, but have you checked out the concept of "system areas" in the wiki?

Yeah I read about that. Since my nodes are related to area itself (its not cross-area thing like a guild for example) I decided to associate the server nodes with area root directly and it works just fine. The only problem is the nodes don't automatically replicate to clients when they enter said area :( So I'd just like to know how can I force the system to automatically replicate some server nodes to clients when the area instance is entered.

I need the same thing that is done by default clean engine NPCs - appear on screen when player enters area :) I am in midst of deciphering the code but cannot really get to the point. Sorry to bother you.

EDIT: finally found something useful - it seems the _OnAreaLoad code does the very same thing as my cheat - calls _GetReplicationGroup for all NPCs :) So I wasn't that far away. Will report back once I'm able to test it
« Last Edit: Jan 11, 12, 06:49:16 AM by Legacy »
Logged

Legacy

  • General Accounts
  • *
  • Posts: 117
    • View Profile
Re: Where to associate nodes on client?
« Reply #3 on: Jan 12, 12, 12:46:11 AM »

Okay it worked :) Can mark this as solved
Logged