• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Are the "DialogControlGetPropertyAs" functions broken?

Status
Not open for further replies.
Level 3
Joined
May 18, 2010
Messages
29
I've had issues with this just the other day but threw away what I was fiddling with and ignored it. This problem has cropped up again though and is now causing issues with a more vital piece of functionality.

The particular function that is causing my problem in this case is DialogControlGetPropertyAsBool though its use is indirect. The actual function I am calling is Blizzard's own DialogItemIsEnabled. The function itself takes two parameters, a dialog item and player. I've double checked the values being used and they appear to be valid. Am I missing something obvious?

Here is the error output:
00:00:05.75 102 <---- Dialog Item handle (used dialog item)
00:00:05.75 1 <---- Player (triggering player)
00:00:05.75 Trigger Error in 'libMAMI_gt_EventReserachDialogUpgradeUpgradeButtonHighlightedRefund_Func': Could not get 'property' from parameter in 'DialogControlGetPropertyAsBool' (value: 13)

Thanks in advance.
 
Level 23
Joined
Nov 29, 2006
Messages
2,482
Actually, they're not entirely broken, only wrongly initialized.

When you create a dialog item, properties that you don't set, will not be set, galaxy wise (in the galaxy memory pool or what you would call it). Hence, whenever you try to use them, they will throw back an error at you, as they don't exist yet.

The function you are using by the way, is nothing more than a wrapper to the "Set property <...>" native, and that is the same for all other dialog item functions which has a corresponding set property usage.

Now, to solve your problem, the only thing you'll have to do is to set the enabled state of the dialog item to what you desire right after you have created the item. If you have other properties that you use later on, make sure to initialize those as well.
 
Level 3
Joined
May 18, 2010
Messages
29
I realised the majority of the Get/Set Dialog Item <Property> functions resolved down to internal natives, but I didn't realise that I had to assign values to said properties first. This appears to work. Thanks.


EDIT: What threw me off about your solution is that the dialog item in question has had the applicable value initialized, except it has been done so in the SC2Layout file I describe it in. This seems unsatisfactory however, as I have had to explicitely set said property with the appropriate SetDialogItem function before being able to retrieve a valid value. Either this is how it functions or I am missing a tag in my layout file whos use I am not familiar with. Something that would ensure the properties defined in the layout are accepted as valid initializations.
 
Last edited:
Level 23
Joined
Nov 29, 2006
Messages
2,482
Unfortunantly, there's alot of things they seem to not have been checking to ensure dialogs and items to function properly without initialization. Yeah as you said, templates are "broken" that way too, and I can't give an answer to any other workaround as it seems now :<

The only other way I could think of is to use a third party tool which sets desired properties given a template (but as far as I know, there is no such tool yet), but then again, that pretty much renders the sc2layout template useless in the first place.

---
I know that they are going to improve the interface building when HotS comes out, giving an entire set of tools in the editor to change layout design and such, and as well dynamically change certain properties ingame and then save the changes back to the editor. But whether or not that will only be for sc2layout and not for dialogs is only to await and see.
 
Status
Not open for further replies.
Top