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

Author Topic: [Resolved] Override unique methods?  (Read 1366 times)

craigbe

  • Developers
  • *
  • Posts: 69
    • View Profile
[Resolved] Override unique methods?
« on: Jan 24, 13, 11:42:52 AM »

Hi,

I was working on the _GUICSSCharacterSelectionClassMethods and putting some of the methods into our version to override the defaults.  I then started wondering about the override because I read somewhere that you're not supposed to override unique methods.  Is this true or am I missing something?  It looks like the E_GUICSS.... file already overrides a couple of methods marked as unique?

My question is can we override them, and if so is there something 'special' we need to be aware of when doing so?

Thanks,

Craig
« Last Edit: Jan 27, 13, 06:47:06 PM by HE-Cooper »
Logged

craigbe

  • Developers
  • *
  • Posts: 69
    • View Profile
Re: Override unique methods?
« Reply #1 on: Jan 24, 13, 01:38:42 PM »

I did change and register the name of the class, but do the method names have to be different from the base class (the _XXX class).

So for example if -

_XXX has a method called 'unique method open', and I want to add functionality to 'open' so I create 'E_XXX' and use 'method open' to try to add functionality I get an error.

I read that document you posted, and I still can't tell if I have to name the methods differently and if I do then how do I use those instead of the _XXX class methods?  I think I don't understand how to override these things correctly.

Thanks!
« Last Edit: Jan 27, 13, 06:48:39 PM by HE-Cooper »
Logged

HE-CHRISTOPHER

  • HeroEngine
  • *****
  • Posts: 424
    • View Profile
Re: Override unique methods?
« Reply #2 on: Jan 24, 13, 04:50:18 PM »

The unique keyword of method signatures prevents you from implementing a method of that name.  It basically says, this method may defined in one and only one class methods script. 

http://hewiki.heroengine.com/wiki/Class_methods

We use unique methods as entry points from C++ into script where the Engine requires HSL to perform functionality.

We often (but not always) supply HE_<name> override method calls that you may implement in your own class GLOMmed onto the system node that is receiving the call.  HE_<name> override methods may allow you to override all or perhaps only portions of the logic that the corresponding unique _<name> method performs because some logic HSL MUST occur (as it is a core part of the engine).

http://hewiki.heroengine.com/wiki/System_node
Logged
Christopher Larsen
CTO
HeroEngine