Heroes of Might and Magic Community
visiting hero! Register | Today's Posts | Games | Search! | FAQ/Rules | AvatarList | MemberList | Profile


Age of Heroes Headlines:  
5 Oct 2016: Heroes VII development comes to an end.. - read more
6 Aug 2016: Troubled Heroes VII Expansion Release - read more
26 Apr 2016: Heroes VII XPack - Trial by Fire - Coming out in June! - read more
17 Apr 2016: Global Alternative Creatures MOD for H7 after 1.8 Patch! - read more
7 Mar 2016: Romero launches a Piano Sonata Album Kickstarter! - read more
19 Feb 2016: Heroes 5.5 RC6, Heroes VII patch 1.7 are out! - read more
13 Jan 2016: Horn of the Abyss 1.4 Available for Download! - read more
17 Dec 2015: Heroes 5.5 update, 1.6 out for H7 - read more
23 Nov 2015: H7 1.4 & 1.5 patches Released - read more
31 Oct 2015: First H7 patches are out, End of DoC development - read more
5 Oct 2016: Heroes VII development comes to an end.. - read more
[X] Remove Ads
LOGIN:     Username:     Password:         [ Register ]
HOMM1: info forum | HOMM2: info forum | HOMM3: info mods forum | HOMM4: info CTG forum | HOMM5: info mods forum | MMH6: wiki forum | MMH7: wiki forum
Heroes Community > Heroes 3.5 - WoG and Beyond > Thread: DL for the newbies
Thread: DL for the newbies
Salamandre
Salamandre


Admirable
Omnipresent Hero
Wog refugee
posted April 11, 2015 08:57 PM
Edited by Salamandre at 21:02, 11 Apr 2015.

DL for the newbies

No, is not other Hushan thread. :P

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

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
LizardWarrior
LizardWarrior


Honorable
Legendary Hero
the reckoning is at hand
posted April 11, 2015 09:03 PM

Quote:
No, is not other Hushan thread.


I was really expecting a Husham thread

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?
____________

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Salamandre
Salamandre


Admirable
Omnipresent Hero
Wog refugee
posted April 11, 2015 09:08 PM

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

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
husham123
husham123


Famous Hero
Yes
posted April 11, 2015 09:28 PM

Salamandre said:
No, it is not another Husham threat


OMG, did you expect me do some tsunami of topics ?
I have a life outside this site xDDD

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
bloodsucker
bloodsucker


Legendary Hero
posted April 12, 2015 12:31 AM

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.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
husham123
husham123


Famous Hero
Yes
posted April 12, 2015 10:47 AM

Oh, and even if I don't play WoG, or ERA, I guess this tutorial is really awsome for who don't know

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Haregar
Haregar


Famous Hero
of destruction
posted April 12, 2015 09:23 PM

Excellent tutorial! Salamandre is in form, as always I see.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
markmasters
markmasters


Famous Hero
Dragon of justice
posted April 12, 2015 10:10 PM

That was both useful and funny, thanks for sharing

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
bloodsucker
bloodsucker


Legendary Hero
posted December 12, 2015 06:22 PM

Who's ass did you forgot to kiss that you don't get a QP not even for a tutorial? Do mods think you are the golden goose or something?

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Salamandre
Salamandre


Admirable
Omnipresent Hero
Wog refugee
posted December 12, 2015 11:08 PM

Paypal is better.
____________
Era II mods and utilities

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
majaczek
majaczek


Supreme Hero
Work at Magic Dimmension
posted August 06, 2016 01:09 PM

How to get text from dialog to z999 variable?

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Salamandre
Salamandre


Admirable
Omnipresent Hero
Wog refugee
posted August 06, 2016 01:14 PM

Usually is the opposite, we get z999 text to dialog.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
majaczek
majaczek


Supreme Hero
Work at Magic Dimmension
posted August 06, 2016 04:38 PM
Edited by majaczek at 11:27, 07 Aug 2016.

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


EDIT: What Flags in dialogue Means?

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Salamandre
Salamandre


Admirable
Omnipresent Hero
Wog refugee
posted August 07, 2016 12:12 PM

The type of item, they apply automatically when add new item. 2 for a button, 16 for a def, 8 for text and so on.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
majaczek
majaczek


Supreme Hero
Work at Magic Dimmension
posted August 07, 2016 02:11 PM

Okay
_ flags = type of object

But
_ How to read string from "Edit" type field ?

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Salamandre
Salamandre


Admirable
Omnipresent Hero
Wog refugee
posted August 07, 2016 04:09 PM

it doesnt work.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
majaczek
majaczek


Supreme Hero
Work at Magic Dimmension
posted August 07, 2016 05:31 PM

So somebody has to write plugin, like those for !!CA ???
I may volunteer perhaps but later

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
majaczek
majaczek


Supreme Hero
Work at Magic Dimmension
posted December 15, 2016 05:58 PM

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).

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
daemon_n
daemon_n


Known Hero
posted December 14, 2019 10:11 PM
Edited by daemon_n at 22:12, 14 Dec 2019.

Why did blue border has changed on the red color?

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
RoseKavalier
RoseKavalier


Admirable
Supreme Hero
posted December 15, 2019 12:28 AM

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

 Send Instant Message | Send E-Mail | View Profile | PP | Quote Reply | Link
Jump To: « Prev Thread . . . Next Thread »
Post New Poll    Post New Topic    Post New Reply

Page compiled in 0.0762 seconds