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

Author Topic: [Solved] /mnac added class missing after reload  (Read 2342 times)

Legacy

  • General Accounts
  • *
  • Posts: 117
    • View Profile
[Solved] /mnac added class missing after reload
« on: Jan 05, 12, 06:01:30 AM »

Hi,
I am working on the very first HSL tutorial (http://wiki.heroengine.com/wiki/Your_First_HSL_Script) and I managed to complete it successfully. However, when I close and reopen HeroBlade, the cube has no longer the class applied to it by /mnac! What do I need to do to keep the client class on node?
Thanks
« Last Edit: Jan 16, 12, 12:37:59 PM by HE-Cooper »
Logged

FI-ScottZ

  • General Accounts
  • *
  • Posts: 1407
    • View Profile
    • Forever Interactive, Inc.
Re: [Problem] /mnac added class missing after reload
« Reply #1 on: Jan 05, 12, 02:00:49 PM »

This is something we have run into before.  Client-side nodes do not have persistence and so are created fresh every time you start the client.  There's a few ways to get the classes on:

One way would be to glom a class onto the server object (assuming there is one, which will be the case if you created it via the editor rather than from a prop bucket).  It typically would be the same name as the client class, though that is not necessary. The server class must have the client class as its client replication target.  I am not sure, but the node glommed onto might need its base class replicated, as well.  With a client replication target set, when the server class is glommed on, the client target class will be glommed on, as well.

Else, you could use client code to glom the class when the client enters that area.
« Last Edit: Jan 05, 12, 02:02:39 PM by ScottZarnke »
Logged
Scott Zarnke
Lead Programmer, Visions of Zosimos
CTO, Forever Interactive, Inc.

Legacy

  • General Accounts
  • *
  • Posts: 117
    • View Profile
Re: [Problem] /mnac added class missing after reload
« Reply #2 on: Jan 06, 12, 06:34:33 AM »

EDIT: ok I tried the following:

  • Create server and client class of the same name
  • Set the client class as replication target of server class
  • \mnac the server class onto node

Still nothing happens when I reload the area, HEINFO displays that there is only the server class present on node. What am I doing wrong, please?
« Last Edit: Jan 06, 12, 07:30:11 AM by Legacy »
Logged

Legacy

  • General Accounts
  • *
  • Posts: 117
    • View Profile
Re: [Problem] /mnac added class missing after reload
« Reply #3 on: Jan 06, 12, 09:12:09 AM »

Isn't there some event to server script when node is created? I could GLOM the client class there I suppose..
Logged

davidr99

  • General Accounts
  • *
  • Posts: 9
    • View Profile
Re: [Problem] /mnac added class missing after reload
« Reply #4 on: Jan 06, 12, 09:18:25 AM »

When I did this you need to GLOM it on the server side.  mnac I beleave only does the glom on the client side.
Logged

Legacy

  • General Accounts
  • *
  • Posts: 117
    • View Profile
Re: [Problem] /mnac added class missing after reload
« Reply #5 on: Jan 06, 12, 01:59:10 PM »

Well I used \mnac which works on the server side thus the class got added to server GOM. But I need to setup it so that the class is permanently on the client GOM  ???
Logged

FI-ScottZ

  • General Accounts
  • *
  • Posts: 1407
    • View Profile
    • Forever Interactive, Inc.
Re: [Problem] /mnac added class missing after reload
« Reply #6 on: Jan 06, 12, 04:05:19 PM »

My mistake. The glomming onto a server class works if that server node is being replicated to the client.  We have that happening for some of our objects.

Upon experimentation, it appears that GR2Instances (which is the class of static models on the server) do not get replicated to the client.  Instead, when a client enters the area, client nodes of class HBNode are created to correspond to the server versions, but are not replicated from them.

So, you are left with having to glom onto the client nodes whenever that client enters that area.  What we do is have a class glommed onto the server _Account system node (you can use E_Account if you don't want to create your own) and an override of the method HE_PostCharacterActivated.  You then have that method call a client function (or system node method using %) which will do the client glomming.

If your model nodes are not going to change, you can have their ID numbers hard-coded into the client function: assign those to an HBNode ref and glom onto that.  Alternatively, you could have HE_PostCharacterActivated determine the ids in question, put them in a List of ID and send that to the client function for processing.

This was our approach; there could be a better one if anyone can think of one.
Logged
Scott Zarnke
Lead Programmer, Visions of Zosimos
CTO, Forever Interactive, Inc.

Legacy

  • General Accounts
  • *
  • Posts: 117
    • View Profile
Re: [Problem] /mnac added class missing after reload
« Reply #7 on: Jan 07, 12, 11:03:59 AM »

Ok thanks for answer, I moved a bit furter - I am now creating a server node that replicates on client (as in the Replication tutorial on wiki) and once I get the geometry from prop bucket, I glom my test class (the movement on mouse over from first HSL tut) on it. I can see the class is glommed properly, but the object does not receive mouse events (yes I switched MousTargetable and so). Also, its GUID is somehow strange, just a very short number like 11240124 but usual nodes have something like 912941395134234.

Is there a way I can add geometry to existing client node? That would solve it pretty much. If this can't be done,  is there any difference between "normal" nodes and prop bucket created ones? Anything that would prevent it to catch mouse events?

Thanks
Logged

Legacy

  • General Accounts
  • *
  • Posts: 117
    • View Profile
Re: [Problem] /mnac added class missing after reload
« Reply #8 on: Jan 07, 12, 02:29:56 PM »

Ok I got it :D Had to set PhysicsShape to "EXACT_MESH" and it's finally working! Thanks for help
Logged

XCalPro

  • General Accounts
  • *
  • Posts: 105
  • 3D Artist & HSL Coder
    • View Profile
    • Excalibur Productions
Re: [Problem] /mnac added class missing after reload
« Reply #9 on: Jan 13, 12, 01:05:27 PM »

I am also having similar difficulties.. I have followed both the First HSL Script and the Replication Tutorial and have reached the same problem. According to http://hewiki.heroengine.com/wiki/Prop_Bucket if I Create an Instance from Bucket, then Activate Instance, will I then be able to manipulate the object like in First HSL or will I lose all DRO functionality and replication?
Logged
Tony Oliveira aka XCalPro
HeroEngine Projects: Traveller 6 Online - www.traveller6.com/forum/
Portfolio: www.xcalpro.com/art

Legacy

  • General Accounts
  • *
  • Posts: 117
    • View Profile
Re: [Problem] /mnac added class missing after reload
« Reply #10 on: Jan 13, 12, 02:09:24 PM »

I am also having similar difficulties.. I have followed both the First HSL Script and the Replication Tutorial and have reached the same problem. According to http://hewiki.heroengine.com/wiki/Prop_Bucket if I Create an Instance from Bucket, then Activate Instance, will I then be able to manipulate the object like in First HSL or will I lose all DRO functionality and replication?

I'm not sure I understand the question, but the way I solved it was that I created a system node hard associated to area root that stores all my DRO objects. On area load I then call the _GetReplicationGroup of all stored objects so they get propagated to client entering the area. It works perfectly
Logged

XCalPro

  • General Accounts
  • *
  • Posts: 105
  • 3D Artist & HSL Coder
    • View Profile
    • Excalibur Productions
Re: [Problem] /mnac added class missing after reload
« Reply #11 on: Jan 13, 12, 02:52:25 PM »

Not exactly sure how to do what you said, but I did manage to solve my issues by adding the following code to the Client-Side DynamicReplicationObjectClassMethods:
Code: [Select]
   instance["PhysicsType"] = "STATIC"
    instance["PhysicsShape"] = "EXACT_MESH"
    instance["MouseTargetable"] = true
just before I activated the instance around line 44.
I can then /mnac the prop bucket node with the ScriptingTutorial1 and all works fine.
« Last Edit: Jan 13, 12, 06:29:10 PM by XCalPro »
Logged
Tony Oliveira aka XCalPro
HeroEngine Projects: Traveller 6 Online - www.traveller6.com/forum/
Portfolio: www.xcalpro.com/art

Legacy

  • General Accounts
  • *
  • Posts: 117
    • View Profile
Re: [Problem] /mnac added class missing after reload
« Reply #12 on: Jan 14, 12, 04:09:02 AM »

Not exactly sure how to do what you said, but I did manage to solve my issues by adding the following code to the Client-Side DynamicReplicationObjectClassMethods:
Code: [Select]
   instance["PhysicsType"] = "STATIC"
    instance["PhysicsShape"] = "EXACT_MESH"
    instance["MouseTargetable"] = true
just before I activated the instance around line 44.
I can then /mnac the prop bucket node with the ScriptingTutorial1 and all works fine.


Ah, I misunderstood you - I thought you are having troubles with said node persistence as I had :)
Logged

XCalPro

  • General Accounts
  • *
  • Posts: 105
  • 3D Artist & HSL Coder
    • View Profile
    • Excalibur Productions
Re: [Problem] /mnac added class missing after reload
« Reply #13 on: Jan 14, 12, 07:44:29 AM »

Yes, I still do have the persistence problem, but I realize now that is because Prop buckets only exist as long as the client is in the spatial awareness. Once the client leaves the area, the prop bucket is destroyed along with the asset nodes.

I believe in order to make the asset persistent would require instantiating the asset in to the area with a remote call. I am still working on this issue. Most likely require a glomming to the asset once it's in the area.
« Last Edit: Jan 14, 12, 08:07:31 AM by XCalPro »
Logged
Tony Oliveira aka XCalPro
HeroEngine Projects: Traveller 6 Online - www.traveller6.com/forum/
Portfolio: www.xcalpro.com/art

Legacy

  • General Accounts
  • *
  • Posts: 117
    • View Profile
Re: [Problem] /mnac added class missing after reload
« Reply #14 on: Jan 14, 12, 08:10:00 AM »

If you create a persistent node and add hard association to some well known node it will persist on server. You just call the replication group as I described above...
Logged