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

Author Topic: Questions implementing new Item_System  (Read 4998 times)

Jrome90

  • General Accounts
  • *
  • Posts: 330
    • View Profile
Re: Questions implementing new Item_System
« Reply #15 on: Dec 23, 12, 03:46:24 AM »

Whatever i tried, its impossible to create a node out of a prototype with both parent classes :/

_GUIIconContainer  and GUIPanel



The new created Class which i try to use in the Prototype is::
ItemIconContainer
Parent: _GUIIconControl

Thankfully you don't need a class/node with both _GUIIconContainer  and GUIPanel.

Quote
Sorry to reask: But isnt there a tiny clean example that shows which prototypes, classes are needed for a minimum solution that uses ICONContainer and the ITEMSYSTEM? I guess its what 80%+ of developers need to set up a inventory. (doesnt matter how exactly they will intend to use it later)
Unfortunately there isn't.
Logged

Tarra2012

  • General Accounts
  • *
  • Posts: 113
    • View Profile
Re: Questions implementing new Item_System
« Reply #16 on: Dec 23, 12, 10:15:08 AM »

As so often i dont know if its ment to be that way, but a solution to the "conflict" is to glom the IconContainer Class codewise to the slot. Why this works? I cant say, but now there seems no method conflict.

Instead of trying to set the class = ItemIconContainer in the Prototype TestInvPanel you can Glom the class to the slot. This way you have a slotnode that is a GUIControl and has abilities of ItemIconContainer.

>>

method CharacterInventory_CreateSlot(slotNumber as Integer) as NodeRef of Class ItemIconContainer
  slot as NodeRef of Class GUIControl
  slot = CreateNodeFromPrototype("TestInvPanel")
  glomClass("ItemIconContainer", slot)
  slot.build = true
  slot.name = "slot" + slotNumber
  return slot
.
Logged

Prometheus2012

  • General Accounts
  • *
  • Posts: 664
    • View Profile
    • Exile-Online
Re: Questions implementing new Item_System
« Reply #17 on: Dec 23, 12, 10:37:22 AM »

This kind of collaboration is definately the kind of thing that is very very healthy for all involved. if several teams can put together some good stable systems, the better the chances of the HE engine seeing some released titles.

Even for experienced coders the hsl hierarchies can be intimidating and confusing for a long time.

Jrome90

  • General Accounts
  • *
  • Posts: 330
    • View Profile
Re: Questions implementing new Item_System
« Reply #18 on: Dec 23, 12, 04:01:06 PM »

Instead of trying to set the class = ItemIconContainer in the Prototype TestInvPanel you can Glom the class to the slot. This way you have a slotnode that is a GUIControl and has abilities of ItemIconContainer.

The "_GUIIconContainer" is a GUIControl

_GUIIconContainer->_GUIDropTarget->GUI9Slice->GUIControl
Logged

Tarra2012

  • General Accounts
  • *
  • Posts: 113
    • View Profile
Re: Questions implementing new Item_System
« Reply #19 on: Dec 24, 12, 01:41:21 AM »

Sorry, that was a typo. I meant a conflict arising from _panel and _GUIIconContainer.

A Method conflict arises - not possible:
Prototype:
<createControlType inheritFrom='_panel' class='ItemIconContainer' type='TestInvPanel' description='Just a temporary inv panel' treePath='CleanEngine' name="TestInvPanel" texture="\GUI\inventory_v3.dds">
..

Code:
method CharacterInventory_CreateSlot(slotNumber as Integer) as NodeRef of Class ItemIconContainer
  slot as NodeRef of Class GUIControl
  slot = CreateNodeFromPrototype("TestInvPanel")
  slot.build = true
  slot.name = "slot" + slotNumber
  return slot
.


No Method conflict arises - Possible:
Prototype:
<createControlType inheritFrom='_panel' type='TestInvPanel' description='Just a temporary inv panel' treePath='CleanEngine' name="TestInvPanel" texture="\GUI\inventory_v3.dds">
..

Code:
method CharacterInventory_CreateSlot(slotNumber as Integer) as NodeRef of Class ItemIconContainer
  slot as NodeRef of Class GUIControl
  slot = CreateNodeFromPrototype("TestInvPanel")
  glomClass("ItemIconContainer", slot)
  slot.build = true
  slot.name = "slot" + slotNumber
  return slot
.

The created class ItemIconContainer has as Parent: _GUIIconContainer.


Ah and a short merry christmas to all around.;)

Logged

Jrome90

  • General Accounts
  • *
  • Posts: 330
    • View Profile
Re: Questions implementing new Item_System
« Reply #20 on: Dec 24, 12, 01:55:30 AM »

Does it work if you remove "inheritFrom='_panel'"
Code: [Select]
<createControlType class='ItemIconContainer' type='TestInvPanel' description='Just a temporary inv panel' treePath='CleanEngine' name="TestInvPanel" texture="\GUI\inventory_v3.dds">

Here is what my XML for my prototype looks like:

Code: [Select]
<createControlType class='RO_InventoryIconContainer' type='inventorySlot' description='' treePath='' name="inventorySlot" texture="\GUI\inventory_v3.dds" inheritDisabledState="false" inheritSelectedState="false" inheritHoveringState="false" textureFilter="false">
  <position x="10" y="10"/>
  <size x="48.181816101" y="63.636363983"/>
  <maximumSize x="2048" y="2048"/>
  <defaultStatePresentation>
    <position x="914.166687012" y="167.916671753"/>
    <size x="101.095245361" y="132.333358765"/>
  </defaultStatePresentation>
  <selectedHoverStatePresentation>
    <color r="0" g="0" b="0" a="0"/>
    <size x="0" y="0"/>
  </selectedHoverStatePresentation>
</createControlType>
Logged

Tarra2012

  • General Accounts
  • *
  • Posts: 113
    • View Profile
Re: Questions implementing new Item_System
« Reply #21 on: Dec 27, 12, 05:38:37 AM »

Can you give details of your prototype.
Which steps did you follow to create it? What type, baseclasses, parentclasses do you use?
Did you create it with the Gui Editor? Did you send console commands or anything prior to using?


If i remove the inherit="_panel" from the XML i get errors and no slot renders anymore.


12:37:18: !ERROR!System:GUIXMLChomper::Chomp An unhandled GOM exception occured while creating a control type...
Exception: UsageException ()
GOM ERROR: GOM::addPrototypeFromClassDef (12140): error: with DefinitionNotFoundException message 'definition (by ID) not found: 2545284138023430802'
XML: <createControlType type='TestInvPanel' description='Just a temporary inv panel' treePath='CleanEngine' name="TestInvPanel" texture="\GUI\inventory_v3.dds" ignoredragdropevents="true">
Logged

Jrome90

  • General Accounts
  • *
  • Posts: 330
    • View Profile
Re: Questions implementing new Item_System
« Reply #22 on: Dec 27, 12, 03:15:05 PM »

I created a new class
Archetype: GUIControl
Named: RO_InventoryIconContainer
This class has a parent class of "_GUIIconContainer"


Created a new GUI ProtoType
Prototype Name: inventorySlot
Inherit From: (None)
Class: RO_InventoryIconContainer
Logged

Tarra2012

  • General Accounts
  • *
  • Posts: 113
    • View Profile
Re: Questions implementing new Item_System
« Reply #23 on: Jan 06, 13, 07:42:59 PM »

After loosing many thoughts i went carefully through everything again and setup a 2nd class.

To make it short: The client class ItemIconContainer was from the wrong archetype!
It must be archetype guicontrol!

Its not visible in the DOM Editor. Hence i was not able to identify the issue for days ... :/

Two Things for all people working with GUI Editor and Prototypes.

1. After creating them you need to wait and check if console sends an update message to client.
Practically you better wait 5-10 seconds, then hit refresh and only then you see your new GUI Prototype in the GUI Editor Window.

2. There are major things going on when submitting and creating GUI Prototypes from "wrong classes".
Often my HE Client crashed and this is reported by other developers too. I cant get a grib on any dependency, but it happens quite often.

Thanks a lot to Jerome and Cseibert for your input. I hope i can give it back to other people having issues here!








« Last Edit: Jan 06, 13, 08:05:17 PM by Tarra2012 »
Logged
Pages: 1 [2]