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

Author Topic: How do you add your own prop decorator?  (Read 1491 times)

NestEggs

  • World Owners
  • ****
  • Posts: 24
    • View Profile
How do you add your own prop decorator?
« on: Mar 24, 14, 08:30:14 PM »

Hi folks,

Trying to understand the prop system tonight and am having some issues. How do you add a new prop decorator? I found that in _PropClassMethods it looks like where the different classes are being added so they get picked up by the GUI (F5) but I get an error when I edit this file:

Code: [Select]
This script is part of HeroEngine and should not be modified for game specific purposes.
It looks like I need to make a game specific class to override but I'm not sure how to do that for this class. I would have thought I could do this in the System Node Configuration GUI but I don't see any props listed in there.

Thanks,
Chris
Logged

NestEggs

  • World Owners
  • ****
  • Posts: 24
    • View Profile
Re: How do you add your own prop decorator?
« Reply #1 on: Mar 29, 14, 08:31:25 PM »

My world didn't have a _PROPS node so I had to do the following:

Create a system node class: NE_SystemNodes with following

Code: [Select]
method HE_GetRegisteredServerSystemNodeNames( systemNodeNames references List of String ) as Boolean
  add back "_PROPS" to systemNodeNames
 
  // Return true if you do not want the default system node names added to the list
  return false
.

 and then Glom it to the Servers SYSTEMNODES in the Utilities GUI by:
  • F5
  • Tools
  • System Nodes Configuration GUI
  • Select Server
  • Under System select SYSTEMNODES
  • Enter class name: NE_SystemNodes
  • Click Add

Repeate the same process for the _PROPS System node.

NE_Props class looks like:

Code: [Select]
method HE_PropsSpecOracleGetSpecDecoratorClasses(valid references List of String) as Boolean

  add back "<Your new prop decorator>" to valid
   
  return false
.


Logged

Amarak

  • General Accounts
  • *
  • Posts: 281
    • View Profile
Re: How do you add your own prop decorator?
« Reply #2 on: Jul 23, 14, 04:13:50 PM »

I had the _Props SystemNode but I tried the second script to add custom Prop Decorators and it didn't seem to work for me.
Logged

Amarak

  • General Accounts
  • *
  • Posts: 281
    • View Profile
Re: How do you add your own prop decorator?
« Reply #3 on: Jul 28, 14, 03:34:44 PM »

I am trying to add my own Decorator classes to the Prop system, and I created a class My_Props, added class methods:
Code: [Select]
method HE_PropsSpecOracleGetSpecDecoratorClasses(valid references List of String) as Boolean

  add back "MyTest1" to valid
   
  return false
.
and added  _Props as the Parent class.

For some reason it isn't showing up in my Props GLOM in the Spec Oracle, did I miss a step here such as a Register command or do I need to make a prototype?
Logged

Amarak

  • General Accounts
  • *
  • Posts: 281
    • View Profile
Re: How do you add your own prop decorator?
« Reply #4 on: Jul 29, 14, 11:13:17 PM »

I figured it out. I had forgotten to GLOM My_Props onto the System Node _Props. I knew it was something simple :)
Logged