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: ERM help and discussion
Thread: ERM help and discussion This Popular Thread is 407 pages long: 1 50 100 ... 106 107 108 109 110 ... 150 200 250 300 350 400 407 · «PREV / NEXT»
JimV
JimV


Responsible
Supreme Hero
posted October 20, 2011 08:26 PM

This means that more than one (DL) dialog can be on the screen, as long as they have different DL numbers, but only the last one is active.  When you close that one, the previous one is active, and so on.  Example:  opening the War Chest DL from a Character Inventory DL (which was opened from the Shining Force DL).  When you close the WC, the Character DL is active again, and when you close that, the SF DL is active.

Unless something new has been added since Era 1.8, That is the way they are hard-coded to work - they are not like different windows on a desktop, which can be activated by clicking inside them.

In my spare time I am investigating adding a "child window" capability to XFiles, but it may not be possible.  If it is, it seems to me that I will have to "hook" the input and deactivate the Heroes window anyway.  (A child window might let me do a few more things than a DL does, such as displaying animated GIF's.)

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


Admirable
Omnipresent Hero
Wog refugee
posted October 20, 2011 08:38 PM
Edited by Salamandre at 22:35, 20 Oct 2011.

Does this mean that:

!!DL14:S;
!?DL14[click on item x ];
!!DL14:C1;
!!DL15:S; [DL14 is now shown under DL15 and did not close]
!?DL15 [click on item];
!!DL15:C1; [from here does not work anymore]
!!DL14:S;

can't work?

I managed to show multiple dialogs, one over the previous, but in the end, I need to close them all. In previous ERA DL:C closed all active dialogs, and Berserker added a plugin to fix it. So far, I can't manage to close only one dialog with it, as specified, nor close all dialogs as it did before.
____________
Era II mods and utilities

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


Responsible
Supreme Hero
posted October 20, 2011 11:18 PM
Edited by JimV at 23:36, 20 Oct 2011.

That code is not familiar to me, probably because of the changes by Bersy, which I have not used.  Under Era 1.5 and 1.8, I used these commands:

Start DL1 (SF):

!?CM5; check left-click on adventure screen:  Cast Spell
!!CM:I?v1; [Area clicked: v1]
!!FU&v1<>8:E; exit if Cast Spell button not clicked
!!CM:R0;  [Disable standard right-click operation]
!!IF&200:M^Left-click on a team member to move it from Headquarters to the Attack Team, or vice-versa.  Right-click to see the character's statistics.^;
!!IF:V200/0;
* set-up for DL1:
!!DL1:N^SFDL1CHR.TXT^; (load template file--must reload before showing!)
!!DO202/31/54/1:P; blank HQ defs
!!DO202/61/67/1:P; blank AT defs
!!DO201/1/v991/1:P; set defs per tables [*]
!!DL1:S; show DL1

Right-clicking on a character portrait in DL1 brings up DL2:
(Note my DL trigger does not include the DL number - instead the DL number is in v998.)

!?DL&v998=1/v1000=14; right-click on SF member
*   v998 = Dialog Id
*   v999 = Item Id
!!IF:V1/1 V2/1;
!!IF&v999>30/v999<55:V1/0;
!!IF&v999>60/v999<69:V2/0; [*]
!!FU&1/2:E; exit if char slot not clicked
!!VRv1:Sv999+500; index to slot tables
!!VRv2:Svv1; get char #
!!IF&v2<0:M4/4/^This character needs to be revived in a Temple!^;
!!FU|v2<1/v2>v991:E; exit if bad char # [*]
!!SN:Pz298;
!!FU210:Pv2; FU210 in DL2 script

Start DL2:

!?FU210; x1=char #
!!VRv50:Cx1/2; save char # for DL triggers and DL #
!!IF&210:M^Left-click on an equipment item to move it from the Inventory to the Character, or vice-versa.  Right-click to see the item's description.^;
!!IF:V210/0;
* set-up for DL2:
!!DL2:N^NEWDL2Mx.TXT^; (load template file--must reload before showing)
* character and statistics
!!FU215:Px1/2; char, DL#
* weapons
!!FU216:Px1/2; char #, DL#
* spells
!!FU217:Px1/2; display spells, x1=char #, x2=DL #
* miscellaneous items (potions, rings, amulets from War Chest)
!!FU218:Px1/2; display equipped items, x1=char #, x2=DL #

!!DL2:S; show DL2

(Player clicks EXIT button or presses Esc to quit DL2.)

Exit DL1 - uses click on text item instead of button:

!?DL&v998=1/v999=3/v1000=12; left-click on Exit text
!!HE0:C0/0/-1/0 C0/1/-1/0 C0/2/-1/0 C0/3/-1/0 C0/4/-1/0 C0/5/-1/0 C0/6/-1/0;
!!DO203/561/570/1:P0/0;
!!DL:C1;

If you have a "button" DL item on the DL (such as the EXIT button or the check-mark button - with the flag setting 3xxxxx - I forget the number, but it is in the DL2 template file), clicking it or pressing the Esc key will exit that DL (if it is active).  Therefore the command DL:C was not used for the character DL (DL2), or the War Chest DL.

I needed to do some adventure-map setup (putting the Attack Team characters into the Hero's troop slots) at the exit from DL1, so I used a text item for that DL.  Clicking on a button ends its DL without any trigger.

Maybe this method no longer works under Era 1.9.

Edit - that should be flag 2, for the button.  I think 3xxxxxx is a function number that gets called on exit.  I saw it somewhere (in the old 3.59 ERM Help).

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


Admirable
Omnipresent Hero
Wog refugee
posted October 20, 2011 11:30 PM
Edited by Salamandre at 23:35, 20 Oct 2011.

The OK button does not anymore exits automatically the DL in 1.91, I have to code it manually. If I need a DL chain for reading a story for example, only the last one can be exited, otherwise it makes no sense.
But exiting the last one keeps previous still active...

Maybe a working way would be the keep same DL ID for all changes, but then I don't know how to code manually the size of dialog and items coordinates. Moreover, when using scrollable text, it seems we can't change text with DL:A, it needs to be parsed into template from start.

Commands are same, when I wrote !?DL14[click on item x ]; I mean all the code holding v998/v1000 vars.
____________
Era II mods and utilities

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


Promising
Famous Hero
posted October 21, 2011 11:31 AM
Edited by solitaire345 at 12:10, 21 Oct 2011.

Quote:


Solitaire345 has revised a newer, more general version of ERM Help, which contains WoG 3.59 commands as well as 3.58f commands.  See his last post here for the latest update link.  His file contains updates only, to be applied to the ERM Help which comes with the Era download, which is available at another thread.


Here's the latest ERM help update. Reposted so it would be easier to find. No updates for now, but I will still be working on this at some point (lots of work outside the PC at the moment ).
The ERA 1.8 package with original help files is here
To update to ERA 1.9 backup file SPTRAITS.TXT (it's in data folder), install this package and move SPTRAITS.TXT back to data folder.

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


Adventuring Hero
posted October 21, 2011 12:30 PM
Edited by Magissia at 12:30, 21 Oct 2011.

I made a hero (customizing bio, portrait, name)
I customized it from the map ground, not from the option :
Will the original hero be recruitable ? Or it will recruit the customized one, even if i didn't customized it from map setting ?

If yes, can i modify customized hero's speciality without affecting original hero speciality ?

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


Responsible
Supreme Hero
posted October 21, 2011 03:22 PM

@Magissia:  Each hero has a unique number, from 0 to 155.  When you customize Hero number 0 (Orrin - see the H format table in ERM Help), and give it the name "Galahad", Hero 0 is named Galahad and the name "Orrin" is gone.  I used to be able to get two copies of the same Hero on the map in standard Heroes, but that was a glitch, not a feature.

@Salamandre:  I liked the OK button and am sad it is gone.  The universe seems determined to make me obsolete by changing everything faster than I can keep up.  It sounds like you want to show a "story book", page by page, and have all the pages disappear at once at the end.  Maybe you could exit each page before showing the next?  

!?CM0&...; start story
!!VRv100:S1; DL ID number for first page
...
!!DL1:S; show page 1

!?DL&v998=v100 ...; exit from current page, show next page
!!DL:C1; (if this still works?)
!!VRv100:+1;
!!FU&v100>9:E; (assuming there are 10 pages)

* set up next DL for showing
* (template name = ^temp%V100^?)
...
!!DLv100:S; show next page

I don't have Era 1.9 installed so I can't test this.


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


Admirable
Omnipresent Hero
Wog refugee
posted October 21, 2011 03:32 PM

The OK button got changed for some bugs reasons, Bersy knows it better. So far my problem is the DL:C1, if another dialog is called after, will not work. Once all dialogs are shown one upon the previous, the command closes only the last (active). A command closing ALL active messages boxes would be great also in other situations, but it's not me the pro.
____________
Era II mods and utilities

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


Responsible
Supreme Hero
posted October 21, 2011 04:38 PM
Edited by JimV at 16:40, 21 Oct 2011.

In that case, then perhaps you could use my favorite trigger:

!?DL&v998=v100/...; Exit DLv100, show next page if any
...
!!DL:C1; close DLv100
!!VRv100:+1;
!!FU&v100>10:E; done if 10 pages shown
* enable TL0 at fastest speed:
!!UN:C7825648/2/37008; remove timer restrictions. Trigger will be called max 20 times per second.
!!UN:C5168326/4/2657254; turn on TL triggers
!!IF:V21/1; (in case TL0 is also used for something else)

!?TL0&21;
* set up DL v100
...
!!DLv100:S; show DL v100
!!UN:C5168326/4/434630; turn off TL triggers
!!UN:C7825648/2/29717; restore old code
!!IF:V21/0;

Whenever you can't do two things in the same trigger which you could do in separate triggers - TL0 to the rescue! - my favorite trigger.  (In Era 1.5 and 1.8 - I haven't used it in Era 1.9.)

P.S. Thanks again to Bersy for both those UN:C commands!

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


Admirable
Omnipresent Hero
Wog refugee
posted October 21, 2011 04:50 PM

Thank you, will try.
____________
Era II mods and utilities

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


Honorable
Supreme Hero
posted October 21, 2011 05:24 PM

In Era 1.9+ buttons react on events 13 (left mouse button release) and 14 (right click). The "Flags" field in the template is key-code of key to be binded to button (0 - no key). So typical close action is written as follows:

!?DL&v998=DLG_ID/v999=BTN_ID/v1000=13;
!!DL:C1;

(key-code 28 in template to close on Enter, 1 - on Escape and so on)

The problem with closing is that C1 simply sets global variable Command. When callback trigger DL return control to wog core, the command is handled. Calling DL:S will clear this variable. So:

!!DL:C1;
!!DL:S;

will never work in any version. The solution is in reverse order:

!!DL:S;
!!DL:C1;

When the second dialog will be closed, the previous one will handle CLOSE message and close too.

Other solution is to write a function for every DL-dialog and then use smth like that:

FUNC_ID := FIRST_DIALOG_FUNC;
WHILE FUNC_ID <> -1 DO
| CALL FUNCTION (FUNC_ID)
END;

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


Responsible
Supreme Hero
posted October 21, 2011 05:54 PM

That is good information for Solitare345 to add to his update!  Thanks, Bersy.

If I understand correctly, your first method (DL:S then DL:C) will leave all DL's on the screen with the latest one on top, then close them all when the last one is closed - which I think is what Salamandre wanted.

My method (DL:C, show next DL under TL0) should show only the latest DL on the screen.

(There is also the sequence DL1:S, DL2:S, DL3:S, ..., DL:C1, DL:C1, DL:C1, which leaves all DL's on the screen then closes them, last to first.)

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


Honorable
Supreme Hero
posted October 21, 2011 06:38 PM

Maybe it can be done  without using timer?
For instance, !?FU1 set-ups and shows dialog 1, !?FU2 - dialog 2. v100 is global var.

!?FU[DialogsLoop];
!!FU&v100=-1:E; #0
!!FUv100;
!!SN:G0; goto cmd #0

!?FU1;
[prepare dialog 1]
!!DL1:S1;

!?DL1&[close button pressed];
!!VRv100:S2; open dialog 2 after closing dialog 1
!!DL:C1;

!?[map event];
!!VRv100:S1;
!!FU[DialogsLoop];

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


Responsible
Supreme Hero
posted October 21, 2011 10:58 PM

Yes, that works (of course).  Thanks for the suggestion.  Here is my test version:


!?CM5; check left-click on adventure screen:  Cast Spell
!!CM:I?v1; [Area clicked: v1]
!!FU&v1<>8:E; exit if Cast Spell button not clicked
!!CM:R0;  [Disable standard right-click operation]
!!VRv100:S1;
!!FU200:P;

!?FU200; dialog loop
!!FU&v100=-1:E; #0
!!FUv100:P;
!!SN:G0; goto cmd #0

!?FU1;
!!DL1:N^SFDL1CHR.TXT^; (load template file)
!!DL1:S; show DL1

!?DL&v998=1/v999=3/v1000=12; left-click on Exit Text
!!VRv100:S2; open dialog 2 after closing dialog 1
!!DL:C1;

!?FU2;
!!DL2:N^NEWDL2Mx.TXT^; (load template file)
!!DL2:S; show DL2
!!VRv100:S-1; end dialog loop (will close DL2 with automatic OK button)

I also tried it with a single v100 function (FU100), and with the order switched:

* list of DL's to show:
!#VRz101:S^SFDL1CHR.TXT^;
!#VRz102:S^NEWDL2Mx.TXT^;

!?CM5; check left-click on adventure screen:  Cast Spell
!!CM:I?v1; [Area clicked: v1]
!!FU&v1<>8:E; exit if Cast Spell button not clicked
!!CM:R0;  [Disable standard right-click operation]
!!VRv100:S2; show 2 first, then 1, this time
!!FU200:P;

!?FU200; dialog loop
!!FU&v100=-1:E; #0
!!FU100:P;
!!SN:G0; goto cmd #0

!?FU100;
!!VRy1:Sv100+100; z-number
!!VRz100:Szy1;
!!DLv100:Nz100; (load template file)
!!DLv100:S; show DLv100

!?DL&v998=2/v999=6/v1000=12; left-click on Hint Box
!!VRv100:S1; open dialog 1 after closing dialog 2
!!DL:C1;

!?DL&v998=1/v999=3/v1000=12; left-click on Exit Text
!!DL:C1;
!!VRv100:S-1; must be here, not in FU100

(I also added a manual closing trigger for DL2, which has a working OK button, which I used for the first test.)

If all DL's had the same exit item (or even if not, with a bit more work), then a single closing DL trigger could be used also (&v998=v100, etc.).

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


Adventuring Hero
posted October 22, 2011 12:22 AM
Edited by Magissia at 00:23, 22 Oct 2011.

Hello

Is  there a command to change commanders buy price ? I didn't found anything concerning it on the help file (CO part).

Is the price hard coded ?

I tried to change paladin's unit price, but it only changed price to upgrade unit to paladin (with speciality) and didn't changed commander buy price.

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


Responsible
Supreme Hero
posted October 22, 2011 04:32 AM
Edited by JimV at 18:31, 22 Oct 2011.

ERM Help says that if Commanders are set to be hired in towns, they cost 100 gold (see UN:P).  Therefore this is hard-coded - otherwise it would say that the price is variable, depending on some other command.

The CO receiver help says:

COMMANDER (CO)
RECEIVER

Commanders ERM support
(!?CO# trigger occurs when open|close commander dialog, buy or revive commander.)

Under the !?CO trigger we find:

!?CO2; is called after buying a Commander in a Town

Therefore if you want to change the price, write a script under the CO2 trigger to ask for more gold or give a rebate.  If the player does not have the additional gold you could refund the 100 and disable the commander, or carry the amount as a loan to be deducted from the next day's income in a timer.  You should warn players about this at the start of the game.

Addendum:  there probably is a UN:C address for the 100 value but it might be difficult to find and might be dangerous to change (if it is used for more than one purpose).

Edit - and now I realize that the 100 is another typo in the ERM Help.  It should be 1000.  I have also seen some typos in the tutorials.  I will be issuing another update in a day or two.

Update - I have revised the WoG 3.58f ERM Help and uploaded the revisions to http://www.box.net/shared/nv038pb3shsgnsuuum5a

The changes were:  100 gold to hire Commanders --> 1000 gold in UN:P6/1; plus several typos in the Tutorials and one mistake.  The Tutorials said that the caret, semi-colon, and comma cannot be used in an IF message.  Actually, a comma can be used (although in some dialogs, the part below the line is cut off - but it won't cause an error, like the other two will.)

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


Adventuring Hero
posted October 23, 2011 04:09 PM
Edited by Magissia at 16:16, 23 Oct 2011.

Thanks for your precious informations JimV

Is the Barbarian's Lord Axe of Ferocity hard coded ? I only found if it's banned or not on the few scripts i opened

I want to make a blank item have the +1 attack effect, an try to change it to make it work with ranged units too.

Also ERM helps sats hero specialisation to upgrade unit can only upgrade  2 different unit to an other unit, but Gelu can upgrade 4 different units to sharptrooper, is there a way to have 4 units with ERM too ?

Is there a way to g ive 2 specialisation to a hero ? Like Implosion + Balistic ?

What will do specialisation to air magic, (fire water earth too) ? It increase damage by 5%, or it will give something like Adrienne (Nothing but a picture and hero set to start with expert fire magic) ?

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


Responsible
Supreme Hero
posted October 23, 2011 06:37 PM

@Magissia,

Read the HTML document "New Features added to Heroes III in the Wake of Gods Addon" (under the Programs/New Life of heroes tab in your Start menu) to learn about the new creatures and new artifacts which are part of the WoG addon - including the Barbarian Lord's Axe of Ferocity.  All of the new features discussed in this document are hard coded, as far as I know.

I believe that when you designate two creatures to be upgraded in the HE:X command, that you can also upgrade the upgrades of those creatures, e.g. Mages include Arch Mages.

The best way to answer such questions - or at least the way that works best for me - is to make a simple test map and put some test scripts in it.  For example, put a Hero on the map with Arch Mages and Zealots, write a simple script of instructions to give that Hero the specialty to upgrade Mages and Monks to Enchanters, then start the map and see if you can upgrade the Arch Mages and Zealots.  This will give you practice in scripting as well as answering the question in a way which you will never forget.  Plus it can be fun finding things out for yourself.

Note also that even if the HE:X command only gave a Hero the ability to upgrade one creature type, that command can be re-issued again and again in a game to change the creature type.  All that is needed is some signal from the player that he wants to change the creature, e.g., ctrl-click on a creature in the Hero's troop slots.  See the great Chinese map "The Dragon Slaughter" (in another thread at this site) for an example of this.

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


Adventuring Hero
posted October 23, 2011 10:16 PM

Thanks for your answer JimV

The HTML document doesn't tell if it's hard  coded or not.

I managed to make my "double specialisation" thing, making some code based on script 2 (Pendant of free will)

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


Promising
Famous Hero
posted October 24, 2011 06:15 PM

Hello. I have updated my help files with this information:
In battle-related triggers you can refer to fighting heroes by using HE-10:XXX; and HE-20:XXX;. This means that you don't need to get heroes' number for applying changes to them (saves few lines in large scripts and doesn't use any variables). This was an undocumented feature of ERM. Download
____________

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Jump To: « Prev Thread . . . Next Thread » This Popular Thread is 407 pages long: 1 50 100 ... 106 107 108 109 110 ... 150 200 250 300 350 400 407 · «PREV / NEXT»
Post New Poll    Post New Topic    Post New Reply

Page compiled in 0.6249 seconds