HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Dialog Driven Menu System - Discussion

06-30-2002, 09:34 PM#1
Mr.123
So we were in the irc channel when weaaddar comes up with the idea of using dialogs to create an extensive menu system for everything you can imagine. From giving gold, kicking players, load/save heroes, to manipulating stats, extra slots, and armor system. There are countless uses that one can think up for a menu system.

So I went and spent a few hours trying to see if it'll work. My conclusion is that is due to 1 missing very important event response, it is practically impossible to do this for multiplayer maps. Since there is no way to tell which player clicked the dialog button, I don't see how it can work for multiplayer. It will work just fine for single player though.

I've attached the file I was using as proof of concept. Don't click on voting menu as I couldn't get dialog - change title to work. The triggers are a mess, I don't expect anyone to actually use it in their single player maps. This is just for reference.

Also, array of Dialog doesn't seem to work. I haven't checked array of strings again yet, but that didn't work before. My guess is since they're both pointer to pointers, the WE developer did not dereference them correctly for it to work. Array of Dialogs would've made it hard, but possible to implement it for the multiplayer. As it stands, unless you want to create a separate Dialog for each player for every menu and submenu you want, and create dialog buttons for every one of those menus, don't even think about it for the multiplayer.

One more solution that comes to mind is to only allow 1 user at a time to access the menu. I know that will probably work. It's limiting, but it might work for some people. Maybe someone here can figure out how to make it work for multiplayer? Who knows.
06-30-2002, 10:46 PM#2
weaaddar
just like to keep people posted dialog arrays do work, but you must define there values first. As in you must define a preexsiting dialog variable.
07-01-2002, 12:09 AM#3
Guest
is this like a touch screen menu you are talking about? Like say u click give gold, then a list of players show up then u click the player. Or are you talking about just a text menu, and you must say what u want to do? I'm guessing the click method, as I have already seen maps, I think even made by you, with the dialogue method?
07-01-2002, 03:16 AM#4
Mr.123
Ok, to elaborate on weaaddar post. This is basically what it looks like:

Array of Dialogs are pointers to dialogs. So you'd have to declare dialogs by making it a variable first. Then assign each element of the array to the variables. It is still a pain in the ass to create a separate dialog for each player BUT it is doable and managable.

Vo0d0o: Yes it is like a touch screen menu. It is like when you hit f10 and you get a bunch of dialog buttons where you can select exit program, quit mission, etc.

I really wished that we had better documentation so we don't have to spend so much time figuring how things worked.

Here's another file which demonstrates how to use arrays of dialogs.
07-01-2002, 03:21 AM#5
Guest
ok, i have a stupid question. i cant figure out how to get the dialog up so i can see it in-game
07-01-2002, 03:24 AM#6
Mr.123
Oops. Press 'esc' to bring up the menu.
07-01-2002, 03:29 AM#7
Guest
oh, duh, "skips a cinematic sequence" :D
07-01-2002, 06:04 AM#8
dataangel
Well, there is a possible solution, but because I don't have the map editor here I can't really test it :p

Now, first off yer gonna have to use custom text. Then you setup a for loop for it assigning all the elements in the dialog-array to a var called dialog1 you've setup. Now convert to custom text. Go to the for loop. Then, use cat strings (you'll have to make another trigger that does this and convert to custom text and copy and paste this part) to do something like "dialog" + string(for loop integer A) where it would normally specify dialog1. I'm not sure how/where war3 handles variable initialization, so you may have to still create a bunch of dialog vars by hand, but at least you can kind of pseudo-index them this way. Also, it probably wants a dialog variable, not a string that's the name of a dialog variable, so this may not work :p

On the other hand, this may end up working for regions....except I think in custom text war3 thinks of all the regions simply as region034 or whatever and not by the name you give them. Otherwise it'd recompile all triggers everytime you changed a region's name.
07-01-2002, 08:31 AM#9
3DGuy
Amazing! Mr123, this could be a start of an MMORPG. But, we can't do open servers since when wc3 starts only once, we need a somekind of dedicated server that is open, BUT you know that IT'S not possible, and the game caches are stored in clients not the server. But this Dialog Menu is good at single player campaigns! Good Job anyway!
07-01-2002, 12:50 PM#10
weaaddar
Well I came up with the idea though i didn't really have time to work on it :).
3dguy it'd be a great feature in ANY-type map. To have a menu to even control something as simple as music would be very nice i believe. Or it could be used to invoke a kick vote, which is much nicer then having to do it with units.
I'd like to incorporate this into some fully functional D&D map later on. But Battle Arena must be complete first.
And yes save/load unit is good for a SP Rpg/campaign.
07-01-2002, 08:00 PM#11
dataangel
Well, in the event that we can get it to work for multiple players easily (I'll try this out as soon as I get my copy), the full version of WE lets you export trigger sets doesn't it? So couldn't we create a sort of open menu system that people could just d/l and put into their maps?

You could give it a few key elements (back button, ability to detect choices, etc.) and a bunch of example dialogues that people could turn on or off by changing a bool variable. A music menu for example, that the map maker can choose to include by changing musicmenu to true, or if they don't want it to false.

I've been thinking about the possibility of doing this with chat commands, but dialog boxes have some advantages (discrete - other players don't see the commands, less typing, etc.). On the other hand, in some cases chat commands might be easier (easier to parse elaborate commands with substrings).
07-03-2002, 03:01 PM#12
weaaddar
Unfortuantly there is no import script function so the real way of doing it is...open a map that has the menu and copy its triggers and paste them in your map.
07-03-2002, 03:17 PM#13
Mr.123
It usually takes me a long time to switch between windows in WE so that's going to be a pain. You can always extract the jass script from the w3m file and then copy/paste the relevant parts back into your map. But that makes that section of the triggers unreadable and hard to maintain unless you are familar with it :(.

Dataangle: I haven't tested your suggestion but I don't think it'd work. We've dealt a little with parsers and compilers before and it's not really possible. Parsers need the script to be static so it knows what to do with all the variables and functions.

This discussion seemed to slowed down quite a bit, but I've just seen someone bring it up over at war3pub. Maybe he'll be able to shed some new insights.
07-03-2002, 05:42 PM#14
dataangel
Well, switching between windows does take some time....but now that we can do custom map sizes, would it be possible to create a 1x1 empty map with just the triggers inside? Then switching to it wouldn't take very long.

Although you can't copy variables can you? :p
07-03-2002, 08:04 PM#15
Guest
Wish I would have known about this forum before I spent hours beating my head against custom dialogs.:o