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

Author Topic: [Solved] Client GuiControl setting two parents that have same fields.  (Read 2615 times)

Atticus

  • General Accounts
  • *
  • Posts: 30
    • View Profile
    • 610 Labs

Trying to create a new version of E_dropDownBox and when I try to add the parent class _GUIDropDownBox I get the following error.

Batch#3780 Error 0Change failed at DOM (16,5)
GOM:: checkClassDefChange (5953) conflicting method  ONCONTROLBUILD at class
P_DropDownBox from class _GUIDropDownBox and class GUIControl "Batch command applied"

Any ideas?


Also would be handy if you put those error messages in a read only text area so we can copy and paste them rather than type them out.

thanks!
« Last Edit: Jan 29, 12, 07:55:15 PM by Atticus »
Logged
Atticus

Atticus

  • General Accounts
  • *
  • Posts: 30
    • View Profile
    • 610 Labs
Re: Client GuiControl setting two parents that have same fields.
« Reply #1 on: Jan 29, 12, 01:50:16 PM »

I got this to work just now. Not sure what the problem was before.
Logged
Atticus

dmccollum

  • General Accounts
  • *
  • Posts: 29
    • View Profile

I'm having the same exact issue. I was able to get this to work before by trying different combinations of adding _GUIDropDownBox and GUI9Slice differently. I'm starting over trying to port the E_ classes and this time I can't get this work at all. I've tried via CLI and in the DOM editor.
Logged

FI-ScottZ

  • General Accounts
  • *
  • Posts: 1407
    • View Profile
    • Forever Interactive, Inc.

_GUIDropDownBox is derived from GUIControl, so you would not need both as parents, only _GUIDropDownBox.

Edit: Nevermind, I see that error message comes in a popup dialog.  Though you could still press Alt-PrtScrn to copy the image, paste into an art program, save that and post the image.

dmccollum: which class(es) are you trying to use for your control?
« Last Edit: Feb 12, 12, 09:07:36 AM by ScottZarnke »
Logged
Scott Zarnke
Lead Programmer, Visions of Zosimos
CTO, Forever Interactive, Inc.

dmccollum

  • General Accounts
  • *
  • Posts: 29
    • View Profile

_GUIDropDownBox is derived from GUIControl, so you would not need both as parents, only _GUIDropDownBox.

dmccollum: which class(es) are you trying to use for your control?

I'm trying to make it just like E_dropDownBox. GUI9Slice also has four fields that _GUIDropDownBox doesn't. allowmove, margin, resize and slices.

What's strange is I was able to finally get it to work before just like Atticus said. Now it won't work at all.
Logged

FI-ScottZ

  • General Accounts
  • *
  • Posts: 1407
    • View Profile
    • Forever Interactive, Inc.

Looks like because both GUI9Slice and _GUIDropDownBox derive separately from GUIControl, there is a conflict which often happens with multi-parenting.

You could try manually adding the fields from GUI9Slice alone to your class, and copy over the methods that use them.  Or use GUI9Slice as the base class and manually copy over stuff from _GUIDropDownBox. Whichever might be easier.

Edit: I see GUI9Slice's script has no methods.  Must work in engine code.

Frankly they seem like an odd combination to put together in the first place; I am not sure how those behaviors could really coexist.

Which part of the dropdown box are you trying to make 9-slice?
« Last Edit: Feb 12, 12, 09:16:02 AM by ScottZarnke »
Logged
Scott Zarnke
Lead Programmer, Visions of Zosimos
CTO, Forever Interactive, Inc.

dmccollum

  • General Accounts
  • *
  • Posts: 29
    • View Profile

Looks like because both GUI9Slice and _GUIDropDownBox derive separately from GUIControl, there is a conflict which often happens with multi-parenting.

You could try manually adding the fields from GUI9Slice alone to your class, and copy over the methods that use them.  Or use GUI9Slice as the base class and manually copy over stuff from _GUIDropDownBox. Whichever might be easier.

Edit: I see GUI9Slice's script has no methods.  Must work in engine code.

Frankly they seem like an odd combination to put together in the first place; I am not sure how those behaviors could really coexist.

Which part of the dropdown box are you trying to make 9-slice?

Thanks for your help Scott. I'm just trying to replace the E_ classes. I'm not sure how they got it to work in the first place and even more so how it worked for Atticus and me earlier. I'm kind of afraid to do something different until I can get all of the E_ classes replaced based on all the problems I've had doing so far.
Logged

FI-ScottZ

  • General Accounts
  • *
  • Posts: 1407
    • View Profile
    • Forever Interactive, Inc.

If you make it only have _GUIDropDownBox as parent, it should work fine.  We did that in fact to add different behavior.

Regarding replacing all E_ classes, you should realize you don't really need to do that, unless you definitely want to change the behavior of every one.  Many of them are probably fine as-is.

If you are looking to change the appearance of controls, what you want to do is create a new gui xml prototype, either directly inheriting from the base control or creating a new gui xml script and then copying into it the text from the base control (changing the prototype name where used).

Creating your own gui classes is only needed to change the behavior.
Logged
Scott Zarnke
Lead Programmer, Visions of Zosimos
CTO, Forever Interactive, Inc.