Due to increasing demand for a DL tutorial, here is one, explaining the basics. DL complexity can go endlesly, but if you manage to do a simple one, then you are on the right way.
DL (custom dialog) is extremelly powerful. Whatever you do using other dialog commands, as IF:M/Q/G, you will always be limited by game resources, unable to load custom pics or custom materials. But within DL the possibilities of adding new graphics is almost illimited.
For this first experience, I will show how a simple dialog can be created. Right now I need a simple DL when starting my map TEW3 which will allow the player to select between 3 internal difficulties. For this, I need 3 pics and a button to exit dialog, this is minimum.
The good side when making non custom dialogs is that game is taking care about dialogs display, will expand or contract the box if dialog is big or small, will add game resources when you need to show an artifact, a spell or whatever. This will not happen with custom dialog, you must take care of all parameters, design yourself the layout and calculate final sizes. This is why it is very difficult to create a precise guide to DL. It depends mainly of what you want to do.
I will show the exact path I used to make this dialog. Rather than trying to memorize this, better you do it step by step exactly as I show here, so you get the basics from first hand experience. Material used is available for download at the end of the guide.
Let's start. So I need 3 pics showing 3 levels of difficulty, easy, normal and expert. For this, I choose 3 portraits from MM6:
Those are good pictures for what they suggests but they will not fit much with the regular Heroes III background so I need to rework them in graphical tools. For now I will just change their background to match Heroes III.
I create a def from those three pics: Tewdiff.def
Now, every time I click on those images, I must visually see they are selected, thus I need a shinny framework which activates around. For this, I create a framework a bit bigger. This is exactly as when you select a building in town screen, it gets highlighted.
I create a def from this too: Tewcdr.def
Why two frames and why the second is cyan? Cyan is the color Heroes III reads as transparent. So when you click on pictures of difficulty, the yellow frame activates behind and highlights your selection, when you click on an other difficulty selection, the cyan frame will activate around pictures not clicked. I will show this later.
Now, and this is subjective choice, I like having things organized in pics, so I will use different frames for both texts I will use. One is for the title:
This will go in a def too: diff.def
The second will be for the text explaining the various features when you select this or that difficulty:
And finally, I need a button, so it allows me to quit dialog. Either you use one from Heroes.lod or you make one yourself, for this I make one myself, to fit dialogs.
I have my material. Let's start.
1) I go to second page of mod manager and start the dialog editor.
2) This is my work area. Rather simple to understand.
Give an ID to your dialog, let's say 250. This dialog ID will be called by script, later.
3) First I add the def with yellow/cyan frames, it will show behind the difficulty pics.
Enter manually the size of pics from def, the frame to show and the name of the def. The other infos as flags or item ID are processed automatically by dialog editor, when you add additional items.
4)At this precise moment, my dialog looks... empty, as the first frame (0) from this def is transparent.
5) Now I add on top of those, my difficulty selection pics.
As before, enter manually the size of pics from def, the frame to show and the name of the def. probably you will have to go into game and see if defs are ranged exactly where they should, if not, edit the dialog using top/left command, set the values until your def is in, right location.Also I enter at bottom of dialog hints for each image. Hint is what the player see as text when you hover mouse over one dialog item.
In game:
6) I add title header and texts over selections to display what is going on. There are several fonts to use from, use those which fit into the dimensions you need.
In game:
7) Now I need to create an item where player can read all hints I created. In dialog selection, I set the hint control to 10, so every hint I need is read in item 10 (the text I just added)
In game, when mouse hover over the pics:
8) Now I add the area where all difficulties are explained. First I add my pcx which will make the area darker, for better readability.
9) Add text item over it.
10) Finally ad a button.
Now, in game:
Dialog graphics are now ready. Time to code so we can get:
1) faces of the guy changing to each difficulty
2) text explanations for selecting each difficulty
ERM PART:
!?PI;
!!DL250:N^tew3.txt^; this command is necessary to load a dialog template
!!DL250:S1; show dialog
!?DL&v998=250/v999>3/v999<7/v1000=13; when click on guy face (item 4,5 or 6)
!!VRz1:S^Button.wav^;
!!SN:Pz1; create a sound
; this part now sets yellow frameworks to highlight when ytou click one item. And back to transparent when the other items are clicked
!!DL250:A1/4/0/1; !!DL250:A2/4/0/1; !!DL250:A3/4/0/1; set frames
!!DL250:A4/4/1/1; !!DL250:A5/4/1/1; !!DL250:A6/4/1/1;
; this is the part which codes the differences between difficulties
!!if&v999=4:; easy
!!VRv7238:S5;
!!DL250:A4/4/0/1;
!!DL250:A1/4/1/1;
!!VRz2:S^Maximus starts with the Dancing Iron Ward.
The Roman Statue is visitable every day.
Emerald towers are open.
The Mithril mine gives 5 bars daily. ^;
!!DL250:A8/3/z2/1;
!!en:;
!!if&v999=5:; normal
!!VRv7238:S1;
!!DL250:A5/4/1/1;
!!DL250:A2/4/1/1;
!!VRz2:S^The Roman Statue is visitable once a week.
Emerald towers are closed.
The mithril mine gives 1 bar daily.^;
!!DL250:A8/3/z2/1;
!!en:;
!!if&v999=6:; hard
!!VRv7238:S10;
!!DL250:A6/4/2/1;
!!DL250:A3/4/1/1;
!!VRz2:S^Maximus starts with the Dancing Iron Ward.
The Roman Statue is visitable once a week.
Emerald towers are open.
The mithril mine gives 1 bar daily.
AI heroes armies are twice stronger.^;
!!DL250:A8/3/z2/1;
!!en:;
!?DL&v998=250/v999=30722/v1000=13; This is when you click on button ext. It stores the difficulty selected then closes dialog
!!IF&v7238<1:M^You must select a difficulty first!^;
!!FU&v7238<1:E;
!!DL:C1;
!?DL&v998=250/v999>3/v999<7/v1000=14; This is displayed when you right-click on difficulty choice. It gives additional hints so you are not like wtf
!!IF:Q1/7/0/8/163/7/0/4^
The Dancing Iron Ward grants your army with 999 turns haste and prayer bless.
The Roman Statue will give your army special abilities.
The emerald towers will improve your army stats.
The mithril bars are used to activate the different stats of your combo artifact.^;
Result:
Here are all the files needed for making such dialog, + erm script. Material used
Nice works as always, I found it very educative and pretty well explained. But how can I do a difficulty list like in Chaser/ Dragon Slaughter? Do I still have to make the buttons as .def files or just write them through ERM?
____________
Chaser is initially for wog 3.58, and DL is only available for Era/wog 3.59. This is why he used such difficult to read lists. But they are rather easy to code.
____________ Era II mods and utilities
Great!!! Thanks. It explains most of my doubts about DLs, including why to use them.
Off-topic: I already made a functional War University using IF:G, being the main reason the pictures I had I took them from Heroes specialties (Un44.def) and so I don't have them for Tactics and Ballistics. Does anyone knows a way to get the pictures of all secondary skills (maybe with the different levels too)? Thanks.
yeah but I want to load text to variable.
I need it for my quicksave script.
old quicksave script saves something like 1_Red and gets overwriten when another game is started
so I thought to read variable from dialogue to z999 and then use %Z999 in text in script later
I did a plugin which draws window on heroes3.5 game screen, and when window is closed saves result to z999. It works together with autosave script. So now together it works like I wanted. If somebody needs I could make a version which asks any question, not just the default one.
The default usage is to write in upper box name of "skirmish" and click the "choose skirmish name" button. also default ansswer is skirmish. So ie. I choose "majaczek+khadras" as an answer (just an example) and accept, it saves with quicksave function as "majaczek+khadras_1_1_1_Red_1.GM2" or if I left default "skirmish" it saves like "skirmish_1_1_1_Red_1.GM1". (the 1-1-1 is month-week-day and last 1 is number of saves done in that day).
it has one problem - it doesn't work well without HD-mod (it doesn't draw the cursor so you cant click editbox or button). I have last working version of HD-mod (since some update of crucial libraries it no more works with era, happily there is an old version availible).
daemon_n said:Why did blue border has changed on the red color?
Both dialog frames are using the same palette.
The first dialog is not colored to current player (red) and colors are left to default (blue).
Right-click triggers game code which recolors frame palette to current player (red).
When letting go of right-click, the first dialog's frame palette is still the same, however it was recolored by the right-click dialog so now it's red.
____________
My Let's Plays: Metataxer's Revenge - The Empire of The World 2