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

Author Topic: [Resolved] need some help on persistent objects and classes  (Read 1207 times)

Demi101

  • Guest

Could someone please explain or point me to the correct wiki page, tutorial or whatever as to what I need to do to get a class I have created to attach to an object and stay persistent?

I have been going in circles trying to get my class functional outside of adding it manually every time I log in.

Thanks
« Last Edit: Nov 02, 12, 09:47:48 PM by HE-Cooper »
Logged

Trixer

  • General Accounts
  • *
  • Posts: 26
    • View Profile
Re: need some help on persistent objects and classes
« Reply #1 on: Jul 17, 12, 04:33:53 PM »

As far as I understand you need to make sure its added to the prototype.

http://wiki.heroengine.com/wiki/Prototype

If my understanding serves me correctly you can think of this as a prefab, or if your a coder just a class.. its the base of what other "nodes" in your world are created from.

Meaning that if you want something to stay persistently needs to be part of the prototype.. I think.. dont qoute me... only have HE for 48 hours, but that is my understanding thus far!
Logged
Lead Programmer and Technical Engineer for Harmonex Neuro Science Research Inc.

FI-ScottZ

  • General Accounts
  • *
  • Posts: 1407
    • View Profile
    • Forever Interactive, Inc.
Re: need some help on persistent objects and classes
« Reply #2 on: Jul 17, 12, 05:37:02 PM »

Is the node you are adding the class to persistent?

Are you adding a client or server class?
Logged
Scott Zarnke
Lead Programmer, Visions of Zosimos
CTO, Forever Interactive, Inc.

Demi101

  • Guest
Re: need some help on persistent objects and classes
« Reply #3 on: Jul 18, 12, 06:09:54 PM »

Originally I was using /mnfc <classID> which is not persistent. I then tried issue a cli command /cnfc; +persistent but when i exited the node did not save. I then read that I needed to make association so I made a hard association but again it failed to save.

I am unsure wheather I need to make proto or do this from script every time it loads so I am just looking for where to go to study.
Logged

HE-JAY

  • HeroEngine
  • *****
  • Posts: 122
    • View Profile
Re: need some help on persistent objects and classes
« Reply #4 on: Jul 20, 12, 09:50:17 AM »

Could someone please explain or point me to the correct wiki page, tutorial or whatever as to what I need to do to get a class I have created to attach to an object and stay persistent?

I have been going in circles trying to get my class functional outside of adding it manually every time I log in.

Thanks

Can you provide a more specific use case? There are many ways in which you can persist data (http://hewiki.heroengine.com/wiki/Data_storage_options), and there are several ways to create a node from a particular class or add a class to an already persistent node (http://hewiki.heroengine.com/wiki/Node_Persistence) (http://hewiki.heroengine.com/wiki/Nodes_and_Classes).

In order for a node to get loaded in from the database, it must either be hard-associated (http://hewiki.heroengine.com/wiki/Associations) to a root node (such as the area root, account root, character root) or it must be an arbitrary root node (http://hewiki.heroengine.com/wiki/Arbitrary_Root_Node).
Logged

Trixer

  • General Accounts
  • *
  • Posts: 26
    • View Profile
Re: need some help on persistent objects and classes
« Reply #5 on: Jul 20, 12, 10:00:49 AM »

https://community.heroengine.com/forums/index.php/topic,2650.0.html

This is a very good tutorial, that will get you started in understanding exactly what you want to do.
Logged
Lead Programmer and Technical Engineer for Harmonex Neuro Science Research Inc.