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

Author Topic: [Resolved] overide e_characterAppearance  (Read 989 times)

amb3rl4nn

  • General Accounts
  • *
  • Posts: 6
    • View Profile
[Resolved] overide e_characterAppearance
« on: Jul 17, 14, 04:32:03 PM »

  So the default implementation of HE_CCSCreateVisibleCharacterNodeForCharacter has the below function referencing

 
Code: [Select]
CreatePersistedNodeFromClass( "e_characterAppearance" )
  I created a new file A_CharacterCreationSystem and changed the $CHARACTERCREATIONSYSTEM NODE on the client and server to overide with this new class.  I also created a new A_CharacterAppearance class to use instead of e_characterAppearance.

  Its worth noting all I have done is copy paste all the same source code so the only change is the

 
Code: [Select]
CreatePersistedNodeFromClass( "e_characterAppearance" )
TO

 
Code: [Select]
CreatePersistedNodeFromClass( "A_CharacterAppearance" )
So once I make this change it breaks some how and I'm not sure why.  As far as I can tell I have created the class exactly the same with the same parent inheritance etc...  any suggestions on what I could be missing?  It seems to fail to create the persisted node.  Here are the two functions involved as far as I can tell:

Code: [Select]
method HE_CCSUseCharacterSpecificationForVisibleCharacter( character as NodeRef of Class _PlayerCharacter, characterSpecification references String ) as Boolean
// Determines the model initially used by the visible_character, as soon as you have a game specific model or models
//   for your game you will want to override this to create something else by default
//
//  characterSpecification = "character_sample"
//  return true
  when RandomInteger(1,3)
    default
      characterSpecification = "female"
    .
  .
  return true
.
method HE_CCSCreateVisibleCharacterNodeForCharacter( character as NodeRef of Class _PlayerCharacter, visible references NodeRef of Class _characterAppearance ) as Boolean
  if visible = None
    visible = CreatePersistedNodeFromClass( "A_CharacterAppearance" )
    visible._characterSpecification = $CHARACTERCREATIONSYSTEM._CCSUseCharacterSpecificationForVisibleCharacter( character )
  .
 
  // Required association for persistence
  AddAssociation( character, "base_hard_association", visible )
  character._characterAppearanceRef = visible
  // Tell the engine to render the character
  visible.draw_character = true
  return true
.



« Last Edit: Jul 22, 14, 07:26:43 PM by amb3rl4nn »
Logged

FI-ScottZ

  • General Accounts
  • *
  • Posts: 1407
    • View Profile
    • Forever Interactive, Inc.
Re: overide e_characterAppearance
« Reply #1 on: Jul 17, 14, 05:21:10 PM »

The server class E_CharacterAppearance has both its server and client Destination Class set to itself.  Do you have that set up?
Logged
Scott Zarnke
Lead Programmer, Visions of Zosimos
CTO, Forever Interactive, Inc.

amb3rl4nn

  • General Accounts
  • *
  • Posts: 6
    • View Profile
Re: overide e_characterAppearance
« Reply #2 on: Jul 17, 14, 07:15:24 PM »

Yup that is setup... screen shots showing the two setups.  Neither have any scripts attached either... on client or server it seems.  The only thing I can think of is that "base_hard_association" is not being established if the character is invalid? but if that was the case it shouldnt work for either class; but it does work if I set it to "e_characterAppearance"

Logged

amb3rl4nn

  • General Accounts
  • *
  • Posts: 6
    • View Profile
Re: overide e_characterAppearance
« Reply #3 on: Jul 22, 14, 07:18:02 PM »

So looks like the issue is the archType did not even notice this before... however now I cant delete the class because

Code: [Select]
20:02:19: DCD ERROR 0 : "Error Removing Class Definition ID: 9223372057260021596 GOM::removeClassDef (5239): class (9223372057260021596) is in use in a node or prototype
GOM::isClassUsedInNodes (16080): Class is in use in Node (9223372057325021569)"

How can I resolve this?
Logged

amb3rl4nn

  • General Accounts
  • *
  • Posts: 6
    • View Profile
Re: overide e_characterAppearance
« Reply #4 on: Jul 22, 14, 07:26:09 PM »

Looks like it might have been a replication issue... after re-creating the class with the correct archtype and renaming the old one I was able to delete the old one.

*SOLVED*
Logged