HeroEngine Forums
Welcome, Guest. Please login or Register for HeroCloud Account.
Pages: 1 [2] 3 4

Author Topic: Press "I" to open a gui window  (Read 16971 times)

Jrome90

  • General Accounts
  • *
  • Posts: 330
    • View Profile
Re: Press "I" to open a gui window
« Reply #15 on: Mar 08, 12, 12:51:16 AM »

I am sorry for the confusion.

To create an XML file, you can just open the script editor.
 File>New>GUI XML

* Added to the Tutorial
« Last Edit: Mar 08, 12, 12:56:01 AM by Jrome90 »
Logged

Songoku

  • General Accounts
  • *
  • Posts: 13
    • View Profile
Re: Press "I" to open a gui window
« Reply #16 on: Mar 13, 12, 03:01:06 PM »

Nice, thank you for this tutorial. But i have a question. I want to create a Diablo 2 like inventory system, where an item occupies let's say 4 places in the inventory.

Got any ideas where or how to start implementing this ?

Thank you in advance :)
Logged

jayhearne

  • General Accounts
  • *
  • Posts: 3
    • View Profile
Re: Press "I" to open a gui window
« Reply #17 on: Mar 16, 12, 08:57:02 AM »

This is the error I get. Not sure how to fix it.

Quote
HeroScript::HeroMachine::ScriptError:GOM::getVariableReferenceFromNode (10757): requested node ID (0) not found
09:53:23: !ERROR!System:SCRIPT ERROR: GOM::getVariableReferenceFromNode (10757): requested node ID (0) not found
03/16/2012 09:53:25
Call trace:
  Script IPopUpClassMethods line 4 me[id=1000000324 class=IPopUp]
  Script Input_Command line 9 me[9223372055947831974]
starting method/function ONCMDSTOP
starting me[id=9223372055947831974 class=E_playerAccount,HBNode,CharacterNode,_ACCControllerOwner]
Logged

Reniezs

  • General Accounts
  • *
  • Posts: 60
    • View Profile
    • Lusorion Creatives
Re: Press "I" to open a gui window
« Reply #18 on: May 13, 12, 08:46:35 AM »

Hi.
I followed this, lets say tutorial, to create openable window. It works like a charm but now i need this script to display some of player characters data ... like hitpoints etc.

heres the part of what i edited in PopUp ClassMethods script:
Code: [Select]
     clientArea as NodeRef of Class GUIControl = findGUIControlByName(me, "scrollable.clientarea")
     
     playerCharacter as  NodeRef of Class E_playerCharacter       
       
       // Hitpointy
       hit as String

           if playerCharacter != None     
              hit = playerCharacter.E_hitPoints
           .
           
       HitpointLabel as NodeRef of Class GUILabel = createNodeFromPrototype("_label")
       
              if playerCharacter != None
                    HitpointLabel.text = "HitPoint: " + hit // requested result
              else if playerCharacter == None
                    HitpointLabel.text = "HitPoint: error" // result i got now :-/
              .

            add back Hitpointlabel to clientArea.children

The problem is, that i dont know how to tell server to take Players Character as Node . . . it ends with error result
ERROR: Node 0 not found to call method GETCHARACTERNODE

Can someone please help me with this, i suppose noobish, problem? Thanks a lot ;-)
Logged
Developer studio Lusorion Creatives - http://lusorion.com
CS / SK Hero Engine Community - http://heroengine.cz

PN-Dwight

  • General Accounts
  • *
  • Posts: 465
    • View Profile
    • Pirates' Nest
Re: Press "I" to open a gui window
« Reply #19 on: May 13, 12, 10:50:51 AM »

Code: [Select]
acc as NodeRef of Class _PlayerAccount = GetAccountID()
char as NodeRef of Class _playerCharacter = acc.GetMyCharacter()

"char" should now have all members that you are looking for (health, level, etc..)

You are just looking at something which isn't there yet (not defined). Please use the above code (or something extremely similar depending on your overrides).

Reniezs

  • General Accounts
  • *
  • Posts: 60
    • View Profile
    • Lusorion Creatives
Re: Press "I" to open a gui window
« Reply #20 on: May 13, 12, 02:00:12 PM »

lol im stupid  :D thanks man
Logged
Developer studio Lusorion Creatives - http://lusorion.com
CS / SK Hero Engine Community - http://heroengine.cz

Tgames

  • General Accounts
  • *
  • Posts: 16
    • View Profile
Re: Press "I" to open a gui window
« Reply #21 on: May 25, 12, 04:36:08 AM »

Hi - thanks for this walkthrough - works well for me.

I would like to be able to trigger the popup as part of an Action associated with an objects State, can anyone help me with this?

Thanks
Logged

Valion310

  • World Owner
  • ****
  • Posts: 42
    • View Profile
    • Expansion:  Rise of Humanity
Re: Press "I" to open a gui window
« Reply #22 on: Jan 14, 13, 11:04:46 AM »

............
« Last Edit: Jan 14, 13, 11:46:52 AM by Valion310 »
Logged
Valion
Game Manager & Director
Prowler Art Studio

"Failure is not an option......"

shangtsung1

  • World Owners
  • ****
  • Posts: 3
    • View Profile
Re: Press "I" to open a gui window
« Reply #23 on: Jan 26, 13, 10:51:03 AM »

hmm, im getting

Code: [Select]
03:38:13: !ERROR!HeroScript::HeroMachine::ScriptError:Exception DefinitionNotFoundException in function 'createNodeFromPrototype' definition not found: TestInvPanel
03:38:13: !ERROR!System:SCRIPT ERROR: Exception DefinitionNotFoundException in function 'createNodeFromPrototype' definition not found: TestInvPanel
01/27/2013 03:44:38
Call trace:
  Script PopUpClassMethods line 35 me[1000003705]
  Script PopUpClassMethods line 28 me[1000003705]
  Script PopUpClassMethods line 18 me[1000003705]
starting method/function ONCONTROLBUILD
starting me[id=1000003705 class=PopUp]
Logged

Thazager

  • General Accounts
  • *
  • Posts: 1149
  • Never stop learning
    • View Profile
    • Heroes and Villains MMORPG
Re: Press "I" to open a gui window
« Reply #24 on: Jan 26, 13, 07:16:47 PM »

"TestInvPanel.XML" is the file created in the GUI editor or heroscript editor, the file it is looking for. If you have named it something different, make sure the names are the same in both areas.
Logged

shangtsung1

  • World Owners
  • ****
  • Posts: 3
    • View Profile
Re: Press "I" to open a gui window
« Reply #25 on: Jan 29, 13, 05:33:43 AM »

the file exists though :(
Logged

shangtsung1

  • World Owners
  • ****
  • Posts: 3
    • View Profile
Re: Press "I" to open a gui window
« Reply #26 on: Jan 29, 13, 05:42:38 AM »

Odd, it seems making the file in the gui editor, then editing it works, but making the file in the GUIXML editor part of the HSLEditor didnt work.
Logged

Viper155

  • World Owners
  • ****
  • Posts: 73
    • View Profile
Re: Press "I" to open a gui window
« Reply #27 on: Apr 08, 13, 04:41:36 PM »

In the console when I press I it says
"17:45:15: SCRIPT:[Input_Command]:Got key(OpenInventory) but did not handle it"

Any idea whats going on?

----------------------------------------

And I was putting the code into the wrong input_command script.

Nevermind!
« Last Edit: Apr 08, 13, 05:24:05 PM by Viper155 »
Logged

ShaolinNinja

  • General Accounts
  • *
  • Posts: 33
    • View Profile
Re: Press "I" to open a gui window
« Reply #28 on: May 22, 13, 02:30:50 PM »

I am trying to create the class methods script for the gui control and it is giving me this error

 node variable does not specify a class that contains the field position

and it references this portion of code. it seems to not like the  .  after the me before the position
Code: [Select]
method OnControlBuild()
 viewPort as Vector3 = GetViewPortSize()
  me.position.x = viewPort.x - 216
  me.position.y = viewPort.y / 2
  flow as NodeRef of Class GUIFlowLayoutContainer = me.Flow()

Any idea how to fix?
Logged

Thazager

  • General Accounts
  • *
  • Posts: 1149
  • Never stop learning
    • View Profile
    • Heroes and Villains MMORPG
Re: Press "I" to open a gui window
« Reply #29 on: May 22, 13, 07:02:47 PM »

The me in methods refers to the script in which the function resides. One way to fix would be making a different noderef, that accesses the class you need. When you first type the line, as soon as you add the  .  a list will pop up showing which fields and functions that noderef has access to. Many times in a script which does not have direct access to the field you need like position, an override can be created.

If looking for a certain GUI to put at a position on screen
win as NodeRef of Class GUIControl = FindGUIControlByName(none, "myWindow") where myWindow is the name of the GUI you need connected.

When looking for a label it is a little different, in that you need to specify that it is a label.
winText as NodeRef of Class GUILabel = FindGUIControlByName(none, "myWindow.label") where the window name and label name are the ones you used in making the GUI.

The FindGUI command is used when the GUI already exists, where the Create command will create a new GUI without using the GUI editor.
Logged
Pages: 1 [2] 3 4