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

Author Topic: [Resolved] Layers and GUI at startup  (Read 3705 times)

Gothrek

  • General Accounts
  • *
  • Posts: 92
    • View Profile
[Resolved] Layers and GUI at startup
« on: Dec 28, 11, 03:19:19 AM »

Hi guys,
i hope someone can help me to understand something about layers GUIs etc.

Prob:
i want see some guiobjs in a new layer at startup (also when i can see also abilitybar, minimap etc)

what i try to do:
1) i add a new layer (utility) into RoC_GUI class (ex E_GUI class), like minimap, bottom, etc
2) i create some GUIobjs (for example bottons for open skill window, inventory etc)
3) i suppose add into RoC_playerAccount class the code for open and see the new GUIobjs

now some Q about my probs:
1) how can "link" to my new layer "utility" the GUIobjs?
2) how can "use" the class RoC_playerAccount thereisnt a system node for replace E_playerAccount also when i need to "change" E_playerAccount with my class RoC_playerAccount? when i login or what? i need to search something in which class (or system class)?

someone can help me to understand better this part?

tks a lot.
« Last Edit: Nov 02, 12, 08:49:08 PM by HE-Cooper »
Logged

Gothrek

  • General Accounts
  • *
  • Posts: 92
    • View Profile
Re: Layers and GUI at startup
« Reply #1 on: Dec 29, 11, 12:23:42 AM »

Someone can help me for understand plz.

tks again.
Logged

runningbird

  • General Accounts
  • *
  • Posts: 37
    • View Profile
    • Runningbird Studios
Re: Layers and GUI at startup
« Reply #2 on: Dec 29, 11, 09:06:32 AM »

So you are just wanting to add new gui objects upon startup.

Currently until I find a better way I'm calling them from E_playerAccountClassMethods

method HE_OnReplicationNodeAdded

then I just do the following to create my gui objects
Code: [Select]
        //The mini map window.
        miniMap as NodeRef of Class  _minimap = FindGuiControlByName(None,"_minimap")
        if miniMap != None
          DestroyNode(miniMap)
        .
        miniMap = CreateNodeFromPrototype("_minimap")
        miniMap.build = true
        miniMap._getMinimapActorStorage()
        miniMap.position.x = 500
        miniMap.scale = 0.5

This is where the status bar and Experience bar gui objects are being created as well.
Hope this helps
Logged

FI-ScottZ

  • General Accounts
  • *
  • Posts: 1407
    • View Profile
    • Forever Interactive, Inc.
Re: Layers and GUI at startup
« Reply #3 on: Dec 29, 11, 08:06:14 PM »

Quote
how can "use" the class RoC_playerAccount
1.  You have a server class already, RoC_playerAccount.  That should have _PlayerAccount as parent class.

2.  Create a prototype of RoC_playerAccount by using the CLI:
Code: [Select]
\cpfc RoC_playerAccount RoC_account_prototype  (the first one is the class name, the second is the new prototype name,
   which can be the same name as the class, or something else if you like.)

3. Either use the server E_AccountClassMethods script or create your own RoC_Account class (which would not need a parent class)*.

4. In the script from step #3, make the method:
Code: [Select]
method HE_UsePrototypeForAccountRootNode( prototypeName references String ) as Boolean
  prototypeName = "RoC_playerAccount"
  return true
.
 That is the method that will make the system use RoC_playerAccount for player accounts.

5. (Optional) If you used RoC_Account instead of E_Account, from the game view, press F5.  Go to "Tools" and click System Nodes Configuration GUI.  Under System, choose "Account".  Then below that, select E_Account and click Remove, then type "RoC_Account" in the "Name of Class to be Added" box and click Add.

After all that, whenever someone logs in, their account will be of type RoC_PlayerAccount.
IMPORTANT: Check all code for where it uses "E_playerAccount".  Now that players will be a different class, you might need to change the code that used E_playerAccount.

*If you create your own server class called RoC_Account, you should start by copying all of what is in E_AccountClassMethods into RoC_AccountClassMethods, then changing/adding/removing what you want to do differently.
« Last Edit: Dec 29, 11, 08:08:10 PM by ScottZarnke »
Logged
Scott Zarnke
Lead Programmer, Visions of Zosimos
CTO, Forever Interactive, Inc.

Gothrek

  • General Accounts
  • *
  • Posts: 92
    • View Profile
Re: Layers and GUI at startup
« Reply #4 on: Dec 30, 11, 12:34:05 AM »

very well, and like everytime...a lot of infos.

i try again.

tks for Help Scott!!
Logged

Gothrek

  • General Accounts
  • *
  • Posts: 92
    • View Profile
Re: Layers and GUI at startup
« Reply #5 on: Dec 30, 11, 12:51:09 AM »

if it is true that the layer is a group of GUI objs, how can add GUIobjs to a layer?

Logged

TGSRofar

  • General Accounts
  • *
  • Posts: 153
    • View Profile
Re: Layers and GUI at startup
« Reply #6 on: Dec 30, 11, 06:12:04 AM »

One of the properties of a GUIControl is the Layer.  It's a string field where you specify which layer the GUI belongs to.
Logged
Ron Farrell
Lead Programmer
Triad Game Studios

Gothrek

  • General Accounts
  • *
  • Posts: 92
    • View Profile
Re: Layers and GUI at startup
« Reply #7 on: Dec 30, 11, 06:39:41 AM »

great!!!

tks a lot
Logged

GFG_Ulfrpsion

  • General Accounts
  • *
  • Posts: 40
    • View Profile
Re: Layers and GUI at startup
« Reply #8 on: Dec 30, 11, 01:19:29 PM »

In regards to the layer, if I create an object and set the layer to be part of the game layer and use a _movePanel as the prototype object, how would I stop the GUI object from moving the entire layer, but rather just move that object I've created and the children? If I set it to the game layer it moves the entire game layer. If I set it to another layer I've created or no layer at all, then the GUI object stays active after I've switched out of character mode.


EDIT: I was able to get a moving panel working using this:
http://community.heroengine.com/forums/index.php/topic,23.0.html

I created a panel object that had a _movePanel child, but I'm not sure if I'm moving the _movePanel alone or the _movePanel and the parent Panel prototype.
« Last Edit: Dec 30, 11, 03:47:56 PM by GFG_Ulfrpsion »
Logged

FI-ScottZ

  • General Accounts
  • *
  • Posts: 1407
    • View Profile
    • Forever Interactive, Inc.
Re: Layers and GUI at startup
« Reply #9 on: Dec 30, 11, 04:21:40 PM »

The control that gets moved by a given move panel is determined by the move panel's "owner" field.  This wiki page explains it pretty well, including that setting owner=0 will move the move panel itself, plus all children.
Logged
Scott Zarnke
Lead Programmer, Visions of Zosimos
CTO, Forever Interactive, Inc.