I know how to use the button, label, checkbox and image, but the rest of the dialog items a pretty much a mysterious to me. Are the dialog items explained anywhere, or are there any of you guys who are willing to help me understand how to use them?
No it doesnt, the action Create Dialog Item states;
Creates a dialog item, of the specified type, for the specified dialog. A new dialog item will always be anchored to the top left of its parent dialog, with no offset. It can be moved and resized using the "Move Dialog Item" and "Set Dialog Item Size" actions.
It does not explain anything about the different types, and how to adjust them to my needs.
But okay then;
I would really like to know how to use the Dropdown and the Slider.
For any dialog item that doesn't have a pre-designed action for setting (for instance, Set Dialog Item (Button)) You need to set it's size and such yourself.
For a better idea, type "Set Dialog Item" into the search bar when creating an action and take a few minutes to look over the list of actions you could use and what they do.
Rollback Post to RevisionRollBack
I am largely inactive, but I am still around. Feel free to poke me if you need some help, just be warned that I only really come back if I need help and/or if I'm posting a new map/library.
What are they? They are ui elements into which you can push an unlimited number of items and display them nicely. You can select items in the lists and make things happen when you do so.
How are they created? You create them in the same manner as most other controls. Unlike button/label/image they dont have their own create function. You need to use the DialogControlCreate followed by a DialogControlSetposition and DialogControlSetSize. If you forget the last two you will get an error, as they would be undefined.
How do I populate the lists? You use a function called DialogControlAddItem. It will push an object to the end of the list. Note that the first index is 1, not 0 like in arrays. This means that if you try to acces item 0 in a listbox or dropdown you will get an error.
How do I remove items? You use a function called DialogControlRemoveItem. The index determines which item will be removed. If you remove an item the list will be compressed, and all items "below" or "after" the removed item will have their index reduced with 1.
What trigger event corresponds with the interaction? Its the "selection change" (or something) type of dialogControlEvent. The default type is "click", change it into "selection changed". When the event fires you will have the event player, the event dialog control and an index for the item that was selected.
Is there some other way of knowing what is selected? Yes, or at least i think so: there is a dialogcontrol function that asks the listbox or pulldown what item is currently selected, and returns it as an int.
How do i translate a clicked list item to a specific action? You need to have a custom made "translation function". As you populate the list you need to keep track of what items are stored at the slots. My suggestion is to keep an array with references to the items, and keep it updated. Then, when you click an item, the event fires, you will be able to know how to react to that. Im working on a quest library where i use a listbox and pulldown in combination and i have given each player their own "translation" array so that i know what they have in their lists/pulldown dialog items.
Thanks a lot Monkalizer :) Are there a GUI version of the actions? I prefer using GUI at the moments as I am not very strong with scripting :/
I can use the actions you suggested, but if there was a GUI version that would be preferable for me ;)
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I know how to use the button, label, checkbox and image, but the rest of the dialog items a pretty much a mysterious to me. Are the dialog items explained anywhere, or are there any of you guys who are willing to help me understand how to use them?
@Demtrod:
The wiki should have everything to explain that I believe. If not let me know which ones you are wondering about.
@Projekton: Go
No it doesnt, the action Create Dialog Item states; Creates a dialog item, of the specified type, for the specified dialog. A new dialog item will always be anchored to the top left of its parent dialog, with no offset. It can be moved and resized using the "Move Dialog Item" and "Set Dialog Item Size" actions.
It does not explain anything about the different types, and how to adjust them to my needs.
But okay then; I would really like to know how to use the Dropdown and the Slider.
@Demtrod: Go
For any dialog item that doesn't have a pre-designed action for setting (for instance, Set Dialog Item (Button)) You need to set it's size and such yourself.
For a better idea, type "Set Dialog Item" into the search bar when creating an action and take a few minutes to look over the list of actions you could use and what they do.
Let me introduce ListBox and DropDown to you.
What are they? They are ui elements into which you can push an unlimited number of items and display them nicely. You can select items in the lists and make things happen when you do so.
How are they created? You create them in the same manner as most other controls. Unlike button/label/image they dont have their own create function. You need to use the DialogControlCreate followed by a DialogControlSetposition and DialogControlSetSize. If you forget the last two you will get an error, as they would be undefined.
How do I populate the lists? You use a function called DialogControlAddItem. It will push an object to the end of the list. Note that the first index is 1, not 0 like in arrays. This means that if you try to acces item 0 in a listbox or dropdown you will get an error.
How do I remove items? You use a function called DialogControlRemoveItem. The index determines which item will be removed. If you remove an item the list will be compressed, and all items "below" or "after" the removed item will have their index reduced with 1.
What trigger event corresponds with the interaction? Its the "selection change" (or something) type of dialogControlEvent. The default type is "click", change it into "selection changed". When the event fires you will have the event player, the event dialog control and an index for the item that was selected.
Is there some other way of knowing what is selected? Yes, or at least i think so: there is a dialogcontrol function that asks the listbox or pulldown what item is currently selected, and returns it as an int.
How do i translate a clicked list item to a specific action? You need to have a custom made "translation function". As you populate the list you need to keep track of what items are stored at the slots. My suggestion is to keep an array with references to the items, and keep it updated. Then, when you click an item, the event fires, you will be able to know how to react to that. Im working on a quest library where i use a listbox and pulldown in combination and i have given each player their own "translation" array so that i know what they have in their lists/pulldown dialog items.
http://www.sc2mapster.com/maps/hercmerc-project/files/16-quest-system/
Thanks a lot Monkalizer :) Are there a GUI version of the actions? I prefer using GUI at the moments as I am not very strong with scripting :/ I can use the actions you suggested, but if there was a GUI version that would be preferable for me ;)