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

Author Topic: HE_MakeCharacter(hbNode)  (Read 605 times)

Thazager

  • General Accounts
  • *
  • Posts: 1129
  • Never stop learning
    • View Profile
    • Heroes and Villains MMORPG
HE_MakeCharacter(hbNode)
« on: Jul 11, 16, 10:34:11 PM »

Upon making on override for _MakeCharacter(), using the _MethodCallbacksClassMethods template, I get an error.

Code: [Select]
SCRIPT ERROR: Exception ConversionException: Node id [9223372084806021578] does not have class HBNode
Time:07/11/2016 22:21:46
Call trace:
  Script e_characterAppearanceClassMethods line 4 me[id=9223372084817021646 class=e_characterAppearance]
  Script _characterAppearanceClassMethods line 11 me[9223372084817021646]
  Script _playerAccountClassMethods line 78 me[9223372084806021578]
starting method/function _ONREPLICATIONGROUPADDED
starting me[id=9223372084806021578 class=E_playerAccount]

// in _characterAppearanceClassMethods it starts with:

method _makeCharacter()
  hbNode as NodeRef of Class _ACCControllerOwner = me._characterHBNode
 
  handled as Boolean
  if HasMethod(me, "HE_MakeCharacter")
    handled = me.HE_MakeCharacter(hbNode)      // <--- place for the over ride
  .

.....
.
 
// in _MethodCallbacksClassMethods

method HE_MakeCharacter(hbNode as NodeRef of Class HBNode) as Boolean  // <--- set as HBNode
  return false
.

// the start of my function in E_characterAppearanceClassMethods:

method HE_MakeCharacter(hbNodeval as NodeRef of Class HBNode) as Boolean  // <--- the error
  hbNode as NodeRef of Class _ACCControllerOwner = hbNodeval

....
.


« Last Edit: Jul 11, 16, 10:39:22 PM by Thazager »
Logged

ToY-Krun

  • General Accounts
  • *
  • Posts: 677
  • Support Volunteer
    • View Profile
Re: HE_MakeCharacter(hbNode)
« Reply #1 on: Jul 13, 16, 05:06:41 PM »

// the start of my function in E_characterAppearanceClassMethods:

method HE_MakeCharacter(xhbNode as NodeRef of Class _ACCControllerOwner) as Boolean
  hbNode as NodeRef of Class _ACCControllerOwner = me._characterHBNode

Is mine, works for me.  Since your override would be called every time makecharacter is called (including npcs etc) you might be getting some occasions when me._characterNode is not an hbnode or is not yet existent.
Which may have been why i explicitly called that  again in the override, then i check to see if it is null before continuing.

Thazager

  • General Accounts
  • *
  • Posts: 1129
  • Never stop learning
    • View Profile
    • Heroes and Villains MMORPG
Re: HE_MakeCharacter(hbNode)
« Reply #2 on: Jul 28, 16, 07:36:51 PM »

Then the function in methodcallback script does not have to be exact with the class of HBnode?

Thanks I will give it a try.
Logged