~ Forums of Enroth ~

An Enroth diehard fan community
 
HomeHome  FAQFAQ  SearchSearch  RegisterRegister  Log inLog in  

Share | 
 

 Advanced Dialogue Boxes in Project Ironfist

Go down 
AuthorMessage
DarkAtom
Pikeman
Pikeman
DarkAtom

Messages : 32
Quality Points : 2
Registration Date : 2018-02-27

PostSubject: Advanced Dialogue Boxes in Project Ironfist   2018-07-03, 04:32

I wasn't able to find this information on the wiki, so I tried a lot of scripts (regarding the dialogue boxes) myself, and this is what I found:

The command described in the wiki is actually provided by the AdvMessageBox.lua module. But the actual command, without the module, is explained here:

Syntax:
AdvancedMessageBox(text, dialogtype, position1, position2, img1type, img1arg, img2type, img2arg, writeOr, a10)

text: A string or a variable that contains a string to be displayed
dialogtype: An integer (will be explained below)
position1 and position2: integers, but I still didn't fully discover them; for now, put -1 for both of them to get a centered window
imgtype and imgarg: The image parameters will be explained below.
writeOr: If you set this to DIALOG_OR (1) then an 'or' text will appear in the middle of the box, between the 2 pictures. If only one picture is used, the 'or' text is displayed on top of it. If anything else is passed for this parameter, the "or" will not be shown.
a10: As for the last parameter, I never found a use for it. Leave this set to 0, just to be safe.

Dialogue types:

  • 0 or anything below 0 (DIALOG_EMPTY): A window with no buttons, can't get rid of it
  • 1 (DIALOG_OKAY): A window with an OK button
  • 2 (DIALOG_YES_NO): A window with Yes/No buttons
  • 3: A window with a Cancel button
  • 4: A window with no buttons, can get rid of it by clicking anywhere (this is probably for right-clicks)
  • 5: Same as 1
  • 6: Same as 3
  • 7: A window with 2 'Learn' buttons (like in the level-up screen)
  • 8: A window with a 'Learn' button on the left and nothing on the right
  • 9 and above: Same as 0


Image types:

  • -1 (IMAGE_EMPTY): No image
  • 0 (IMAGE_WOOD): Wood
  • 1 (IMAGE_MERCURY): Mercury
  • 2 (IMAGE_ORE): Ore
  • 3 (IMAGE_SULFUR): Sulfur
  • 4 (IMAGE_CRYSTALS): Crystal
  • 5 (IMAGE_GEMS): Gems
  • 6 (IMAGE_GOLD): Gold
  • 7 (IMAGE_GROUP_ARTIFACTS): Artifact
  • 8 (IMAGE_GROUP_SPELLS): Spell
  • 9 (IMAGE_GROUP_PLAYERS): Player color
  • 10 (IMAGE_LUCK): Good Luck
  • 11 (IMAGE_BADLUCK): Bad Luck
  • 12 (IMAGE_GOOD_MORALE): Good Morale
  • 13 (IMAGE_BAD_MORALE): Bad Morale
  • 14 (IMAGE_EXP): Experience
  • 15 (IMAGE_GROUP_HERO): Hero Portrait
  • 16: Not used (if you use it, game will freeze/crash)
  • 17 (IMAGE_GROUP_SECONDARY_SKILLS): Secondary Skill
  • 18 (IMAGE_GROUP_UNIT): Creature
  • 19-24: Same as -1
  • 25 (IMAGE_GROUP_PRIMARY_SKILLS): Primary Skill
  • 26+: Same as 16


Image subtypes (the number in the list represents the type for which the subtype applies)

  • -1: Put 0 to be safe
  • 0: Quantity (if you put 0 it will not show any number)
  • 1: Quantity (if you put 0 it will not show any number)
  • 2: Quantity (if you put 0 it will not show any number)
  • 3: Quantity (if you put 0 it will not show any number)
  • 4: Quantity (if you put 0 it will not show any number)
  • 5: Quantity (if you put 0 it will not show any number)
  • 6: Quantity (if you put 0 it will not show any number)
  • 7: Which artifact (use artifact name from the wiki)
  • 8: Which spell (use spell name from the wiki)
  • 9: Which color (blue-0, green-1, red-2, yellow-3, orange-4, purple-5)
  • 10: Doesn't matter
  • 11: Doesn't matter
  • 12: Doesn't matter
  • 13: Doesn't matter
  • 14: Quantity (works with negatives as well)
  • 15: Which portrait (start from 0, it's the same order as when you scroll through them in the editor)**
  • 16: As I said above, game crashes, so don't use it
  • 17: Which skill * (look at the asterisk below)
  • 18: Which creature (take their ID from \data\creatures.xml)
  • 19-24: Put 0 to be safe
  • 25: 0-3 (Attack, Defense, Spell Power, Knowledge) (100-103 displays a +1 skill)
  • 26+: Don't use it


*count the skills in the order from the wiki starting from 0 and stop at the one desired. Then multiply by 3 to get the basic picture. Add 1 for advanced, or 2 for expert  Smile
**for hero portraits: to display town captains, use 90-95 (knight, barbarian, sorceress, warlock, wizard, necromancer)

One more thing I have to mention: If you choose image type resource (0-6), you can set the subtype as negative and it will show the qty/day thing like from the mines. So if I set it to -6, for example, the message will show 6/day.
UPDATE: If you want to show negative values (like when taking resources), put the subtype -x-100000, where x is the value. So -100050 would show -50. If you put exactly -100000, it shows 100k/day, not -0.

UPDATE II: If you enclose text between curly braces {} then the text becomes golden.

For now (Ironfist 1.3.0), none of the dialog types return anything, so it only makes sense to use types 1/5 and 3/6.

I hope this was helpful, please reply if you find anything incorrect information or if you find something new.


Last edited by DarkAtom on 2019-01-08, 04:58; edited 13 times in total
Back to top Go down
Darmani
Master Modder
Master Modder
Darmani

Messages : 237
Quality Points : 38
Registration Date : 2014-12-27

PostSubject: Re: Advanced Dialogue Boxes in Project Ironfist   2018-09-04, 18:19

Woah; this is awesome. Nice work! Thanks for the reminder that we need to finish our project to document this.
Back to top Go down
Unknown_Hero
Vampire
Vampire
Unknown_Hero

Messages : 459
Quality Points : 58
Registration Date : 2015-09-06

PostSubject: Re: Advanced Dialogue Boxes in Project Ironfist   2018-12-25, 08:08

Thanks for your clarifications DarkAtom. Smile

I used your hint to display +1 for the hero's primary skills with the Advanced Message Box in a script for the Unknown Mod.

Code:
text = "Bla, bla...";
dialogtype = 1;
img1type = 25;
img1arg = 102; -- why "2" to "102" only for this?
img2type = 25;
img2arg = 3; -- and not for this? "103" will crash the program!!!
AdvancedMessageBox(text, dialogtype, -1, -1, img1type, img1arg, img2type, img2arg, -1, 0);

Here, the value "102" for "img1arg" displays +1 for the hero's Spell Power and +1 for the hero's Knowledge (with "img2arg = 3").

It is not necessary to indicate "103" for "img2arg", and if "103" is used, it causes the program to crash.

On the other hand, the possible value seems to be limited to "+1", it's not possible to display "+2" or "+3" or any other value.

Unknown Mod - Spoiler:
 

With the hope that it can help. Smile
Back to top Go down
DarkAtom
Pikeman
Pikeman
DarkAtom

Messages : 32
Quality Points : 2
Registration Date : 2018-02-27

PostSubject: Re: Advanced Dialogue Boxes in Project Ironfist   2018-12-25, 09:34

Unknown_Hero wrote:
Thanks for your clarifications DarkAtom. Smile

I used your hint to display +1 for the hero's primary skills with the Advanced Message Box in a script for the Unknown Mod.

Code:
text = "Bla, bla...";
dialogtype = 1;
img1type = 25;
img1arg = 102; -- why "2" to "102" only for this?
img2type = 25;
img2arg = 3; -- and not for this? "103" will crash the program!!!
AdvancedMessageBox(text, dialogtype, -1, -1, img1type, img1arg, img2type, img2arg, -1, 0);

Here, the value "102" for "img1arg" displays +1 for the hero's Spell Power and +1 for the hero's Knowledge (with "img2arg = 3").

It is not necessary to indicate "103" for "img2arg", and if "103" is used, it causes the program to crash.

On the other hand, the possible value seems to be limited to "+1", it's not possible to display "+2" or "+3" or any other value.

Unknown Mod - Spoiler:
 

With the hope that it can help. Smile

Hmmm... I never tried this, but I guess that it doesn't make sense to have a +1 picture and then one without a +1.
Back to top Go down
Unknown_Hero
Vampire
Vampire
Unknown_Hero

Messages : 459
Quality Points : 58
Registration Date : 2015-09-06

PostSubject: Re: Advanced Dialogue Boxes in Project Ironfist   2018-12-26, 02:06

I think that in the original version of the game the Advanced Message Box is simply not intended to display several primary skills at the same time and the value is never greater than 1, that's why there are these limitations and quirks.

The Ironfist team should be able to improve this. Smile
Back to top Go down
DarkAtom
Pikeman
Pikeman
DarkAtom

Messages : 32
Quality Points : 2
Registration Date : 2018-02-27

PostSubject: Re: Advanced Dialogue Boxes in Project Ironfist   2018-12-30, 00:58

I added the constants as well, they make script code a lot more readable.
Back to top Go down
Sponsored content




PostSubject: Re: Advanced Dialogue Boxes in Project Ironfist   

Back to top Go down
 
Advanced Dialogue Boxes in Project Ironfist
Back to top 
Page 1 of 1
 Similar topics
-
» Project Aubade
» Project D - Free Forumotion Theme
» [ABA] Clan The Official Project Reality Clan of the British
» [Project] CP_AddOn - Configure scripts
» Application form with text boxes

Permissions in this forum:You cannot reply to topics in this forum
~ Forums of Enroth ~ :: Modding Guild :: Heroes of Might and Magic II: Project Ironfist :: Modding and Mapmaking-
Jump to: