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

Author Topic: [Resolved] Custom _PlayerAccount class  (Read 1418 times)

Grogard

  • World Owners
  • ****
  • Posts: 36
    • View Profile
[Resolved] Custom _PlayerAccount class
« on: Jan 14, 13, 10:40:46 PM »

Hello.

1. I have DM_PlayerAccount that is child for _PlayerAccount.
2. I have the server prototype DM_Account_Prototype - created from the class DM_PlayerAccount;
3. I have the server class DM_Account that is the $ACCOUNT.

I have the method in the DM_Account:
Code: [Select]
method HE_UsePrototypeForAccountRootNode( prototypeName references String ) as Boolean
  //prototypeName = "e_account_prototype"
  println("HE_UsePrototypeForAccountRootNode")
  prototypeName = "DM_Account_Prototype"
  return true
.

But println in this code never display. Why?

And i have DM_CharacterSelectionSystem server class with method:
Code: [Select]
unique method cssSetLoadInTestArea( account as NodeRef of Class _PlayerAccount, loadTest as Boolean )
  println("cssSetLoadInTestArea")
  where account
    is kindof DM_PlayerAccount
      println("cssSetLoadInTestArea::loadTest")
      account.dmLoadInTestArea = loadTest
    .
  .
.
In this code the println never pring too. Why?
« Last Edit: Jan 19, 13, 04:28:16 AM by Grogard »
Logged

AlderonGames

  • World Owners
  • ****
  • Posts: 20
    • View Profile
Re: Custom _PlayerAccount class
« Reply #1 on: Jan 15, 13, 10:00:39 AM »

Basicly your current account was created when you first logged in under the clean engine prototype, not the custom DM one.

You need to call $ACCOUNT._DestroyAccountRootNode(account) on the server. You can setup a command like /reset account or use the verify account method from your previous thread.

Then when you restart heroblade/reconnect it will be created with the DM prototype instead.

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

Also with the println not working for the first code sample. Make sure you have glommed your class correctly on to the $ACCOUNT system node and check other HE overrides are working.
« Last Edit: Jan 15, 13, 10:02:24 AM by AlderonGames »
Logged

Grogard

  • World Owners
  • ****
  • Posts: 36
    • View Profile
Re: Custom _PlayerAccount class
« Reply #2 on: Jan 15, 13, 11:46:43 AM »

At qhat place on the client you invoke this?

Code: [Select]
untrusted method VerifyAccount()
  account as NodeRef of Class _PlayerAccount= SYSTEM.REMOTE.CLIENT
  if not (account is kindof ROTDA_PlayerAccount)
    KickPlayer(account, "Invalid Account, Restart Heroblade.","Destroying Account Node because it isn't ROTDA_PlayerAccount.")
    $ACCOUNT._DestroyAccountRootNode(account)
   
  .
.
Logged

Grogard

  • World Owners
  • ****
  • Posts: 36
    • View Profile
Re: Custom _PlayerAccount class
« Reply #3 on: Jan 15, 13, 12:31:12 PM »

After all this.

I get:
Code: [Select]
starting me[id=9223372056523021706 class=DM_PlayerAccount,HBNode,CharacterNode,_ACCControllerOwner]
Client Script Error
SCRIPT ERROR: Node 0 not found to call method GETMYCHARACTER
01/15/2013 22:32:29
Call trace:
  Script Input_Movement line 173 me[9223372056523021706]
  Script Input_Movement line 127 me[9223372056523021706]
starting method/function ONCMDSTOP
starting me[id=9223372056523021706 class=DM_PlayerAccount,HBNode,CharacterNode,_ACCControllerOwner]

After this when i enter to the world my character is without any cloths and don't undertand movement key. $(
Logged

AlderonGames

  • World Owners
  • ****
  • Posts: 20
    • View Profile
Re: Custom _PlayerAccount class
« Reply #4 on: Jan 15, 13, 07:37:32 PM »

You need to check in the Dom Editor if the replicated destination class is set to DM_PlayerAccount not E_PlayerAccount.

For Verify Account, Put this in DM_Account Class Methods  ($ACCOUNT) Server System Node.

Code: [Select]
untrusted method VerifyAccount()
  account as NodeRef of Class _PlayerAccount= SYSTEM.REMOTE.CLIENT
  if not (account is kindof DM_PlayerAccount)
    KickPlayer(account, "Invalid Account, Restart Heroblade.","Destroying Account Node because it isn't DM_PlayerAccount.")
    $ACCOUNT._DestroyAccountRootNode(account)
  .
.

Then in your DM_CharacterSelectionSystemClassMethods ($CharacterSelectionSystem Client System Node)

Under
Code: [Select]
method HE_CSSInvokeGUI( args as LookupList indexed by String of String ) as BooleanPut
Code: [Select]
call server %ACCOUNT.VerifyAccount()
Logged

Grogard

  • World Owners
  • ****
  • Posts: 36
    • View Profile
Re: Custom _PlayerAccount class
« Reply #5 on: Jan 16, 13, 02:21:14 AM »

You need to check in the Dom Editor if the replicated destination class is set to DM_PlayerAccount not E_PlayerAccount.

DM_PlayerAccount in the DM_PlayerAccount server and client set to DM_PlayerAccount
Logged

Thazager

  • General Accounts
  • *
  • Posts: 1144
  • Never stop learning
    • View Profile
    • Heroes and Villains MMORPG
Re: Custom _PlayerAccount class
« Reply #6 on: Jan 16, 13, 02:35:37 PM »

If still not working correctly, you can also open the GUI in the heroscript editor and check which class its set to on the top line. This info wont show up in the GUI editor.
Logged

Grogard

  • World Owners
  • ****
  • Posts: 36
    • View Profile
Re: Custom _PlayerAccount class
« Reply #7 on: Jan 17, 13, 01:37:43 PM »

After some manipulation with script i found some place where E_PlayerAccount  was hardcoded. But now i fix at all, as result the cloth now present on the character. But it still can't move :(

If still not working correctly, you can also open the GUI in the heroscript editor and check which class its set to on the top line. This info wont show up in the GUI editor.
In what file?

Logged

Grogard

  • World Owners
  • ****
  • Posts: 36
    • View Profile
Re: Custom _PlayerAccount class
« Reply #8 on: Jan 17, 13, 01:41:05 PM »

Input_Movement script:
Code: [Select]
function FigureOutMovement()
  acct as NodeRef of Class E_playerAccount = GetAccountID()
  char as NodeRef of Class E_playerCharacter = acct.GetMyCharacter()
  if char.E_isDead
    return
  .
  var behavior = "move"
  var needtostop = true
  if IsMovingForward()
    behavior = behavior + " forward"
    needtostop = false
  else if GetCmdState("Movement","Backward")
    behavior = behavior + " backward" 
    needtostop = false
  .
  if GetCmdState("Movement","Walk")
    behavior = behavior + " walkonly" 
  else if GetCmdState("Movement","Sprint")
    behavior = behavior + " sprintonly"
  .
  if $INPUT.InputGetLeftMostRecent()
    if GetCmdState("Movement","Left")
      behavior = behavior + " sidestepleft"     
      needtostop = false
    .
  else
    if GetCmdState("Movement","Right")
      behavior = behavior + " sidestepright"
      needtostop = false
    .   
  .
  if (GetCmdState("Movement","JumpingEngaged"))
    if Skippy:IsMe()
      behavior = behavior + " jump .95"
    else
      behavior = behavior + " jump .45"
    .
    needtostop = false
  .
 
  if needtostop
    me["behave"] = "move stop"
    SetCmdState("Movement","MouseMovementEngaged", false)
  else
    me["behave"] = behavior
  .
.

In what DOM it must be overwriten?

In the DOm model I can't found this class.
Logged

Grogard

  • World Owners
  • ****
  • Posts: 36
    • View Profile
Re: Custom _PlayerAccount class
« Reply #9 on: Jan 19, 13, 04:27:57 AM »

The problem fixed by editing the next files:

E_InputHandler
E_PlayerCharecter
E_CharacterCreationWindow
Input_Movement
Input_Command
Logged