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 150 200 250 300 350 ... 363 364 365 366 367 ... 400 407 · «PREV / NEXT»
Salamandre
Salamandre


Admirable
Omnipresent Hero
Wog refugee
posted June 10, 2019 08:46 AM

I think he does it literally  - 'if roland, do___', thus the error syntax.

'if roland, do___'  in erm, it translates as:

!?BA0;
!!BA:H0/?y-1;!!BA:H1/?y-2; store attacker and defender ID in y vars
!!FU&y-1<>152/y-2<>152:E; exit if Roland is not in battle

So, once the script finds Roland and does not exit, you have to use your BF trigger, check on which side Roland is, then run a loop either 0/20 or 21/41, depending on the previous result. Then you apply spells on each creature stack.

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


Famous Hero
posted June 11, 2019 03:09 AM

Salamandre said:
I think he does it literally  - 'if roland, do___', thus the error syntax.

'if roland, do___'  in erm, it translates as:

!?BA0;
!!BA:H0/?y-1;!!BA:H1/?y-2; store attacker and defender ID in y vars
!!FU&y-1<>152/y-2<>152:E; exit if Roland is not in battle

So, once the script finds Roland and does not exit, you have to use your BF trigger, check on which side Roland is, then run a loop either 0/20 or 21/41, depending on the previous result. Then you apply spells on each creature stack.


I understand the logic, but I'm not getting the syntax.  I tried looking at other scripts for examples of how to start the if statements etc.  the 0-20 and 21-41 I read only in th BM parameters, but i have no clue what for example #1 vs #8 from the 0-20 actually means.  


ok, so following what you instructed, Did I check for ROland correctly here based on what you sent me:

!?BA0;
!!BA:H0/?y-1;!!BA:H1/?y-2; store attacker and defender ID in y vars
!!FU&y-1<>152/y-2<>152:E; exit if Roland is not in battle

!?BF&1000;

!?FU700; check for roland
!!HEy1:152;if roland is the attacker (based on y vars just set)
!!HEy2:152;if roland is the defender  ( " " " )

and to start a loop i can use what I had:

!?FU35508;
!!BMx16:Mx1/x2/x3;     Apply Bonus Spell to all monsters

!!VRy10:S58; [counterstrike]
!!VRy11:S20; [Duration]
!!VRy12:S3;  [Level]


!!DO35509/0/41/1:Py10/y11/y12;



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


Admirable
Omnipresent Hero
Wog refugee
posted June 11, 2019 08:11 AM
Edited by Salamandre at 08:22, 11 Jun 2019.

Yeah, you clearly don't get the syntax. First, you should start by using debug signals, so you get until when your script is correct, where are the errors, also what is the order of triggers in battle.

Try this:

!?BF&1000;
!!BA:H0/?y-1 H1/?y-2; store attacker and defender ID in y vars
!!FU&y-1<>152/y-2<>152:E; exit if Roland is not in battle
!!IF&y-1=152:L^#1 we found Roland and he is the attacker (he owns stacks 0-20)^;
!!IF&y-2=152:L^#1 we found Roland and he is the defender (he owns stacks 21-41)^;
!!IF:L^#2 Now running loop through his stacks^;
!!DO12345/0/20/1&y-1=152:P58;
!!DO12345/21/41/1&y-2=152:P58;
!!IF:L^#3 Spell applied^;

!?FU12345;
!!BMx16:H?y1;
!!FU&y1<1:E;
!!IF:L^we found a stack alive^;
!!BMx16:Mx1/20/3; Apply Bonus Spell to all monsters



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


Famous Hero
posted June 12, 2019 04:23 PM

Salamandre said:
Yeah, you clearly don't get the syntax. First, you should start by using debug signals, so you get until when your script is correct, where are the errors, also what is the order of triggers in battle.

Try this:

!?BF&1000;
!!BA:H0/?y-1 H1/?y-2; store attacker and defender ID in y vars
!!FU&y-1<>152/y-2<>152:E; exit if Roland is not in battle
!!IF&y-1=152:L^#1 we found Roland and he is the attacker (he owns stacks 0-20)^;
!!IF&y-2=152:L^#1 we found Roland and he is the defender (he owns stacks 21-41)^;
!!IF:L^#2 Now running loop through his stacks^;
!!DO12345/0/20/1&y-1=152:P58;
!!DO12345/21/41/1&y-2=152:P58;
!!IF:L^#3 Spell applied^;

!?FU12345;
!!BMx16:H?y1;
!!FU&y1<1:E;
!!IF:L^we found a stack alive^;
!!BMx16:Mx1/20/3; Apply Bonus Spell to all monsters






Thank you so much sal!  the explanations after the ';' also helped me learn what the 0-20 & 21-41 meant.  They're the armies on the battlefield. that makes more sense.  I explored with the numbers to see what happens, and if I switch the 0-20 with the 21-41, it applies the spell bonuses to the other army! that's cool, will come in handy to pre-cast negative spells to enemy armies just when they face a hero!  

Thank you again :)

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


Adventuring Hero
posted July 06, 2019 01:16 PM

Hello!

While looking through the ERM functions introduced by ERA (through the SN receiver), I saw there is a command to get the length of a string. What is the difference between this ERA command and the old command (VR:M4)?

ZVSE
!#VRz1:S^This text is 31 characters long^;
!#VRz1:M4/?v1; **old way
!#SN:Kz1/?v2; **ERA way
!#IF:M^The old function: %V1. The ERA function: %V2^;

In game, it shows this message:
The old function: 31. The ERA function: 31
____________
"If you get scared of doing what's right you might as well lay down and die" - Wulfstan, Heroes of Might and Magic V: Hammers of Fate

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


Hired Hero
posted July 08, 2019 10:21 AM

I was looking at the claimed variables in the ERM help document and I noticed ERT Z variables.What are these?
____________
GaĻa be with you.

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


Adventuring Hero
posted July 08, 2019 01:36 PM

TheSamaritan said:
I was looking at the claimed variables in the ERM help document and I noticed ERT Z variables.What are these?


I haven't seen them used now, but in the past (when scripts were forced to be named "script00.erm" to "script99.erm") they were used for storing text which wasn't meant to change. They are stored in a table, aka ERT-file (search through the wog scripts to understand more). They are indexed with 6 digits. First digit is 1. The next 2 are the number of the script. Each script can have up to 1000 of these variables, so the last 3 digits are 000 to 999. So the 2nd variable of script75.erm is named z175001.

These variables are particularly useful in scripts like:
!#VRz1:S^Giant's Gladius^;
!#UN:A12/9/z1; *change the name of Titan's Gladius to Giant's Gladius

Now, if any other scipt changes z1 to something like ^Wogification Complete!^, then the name of the artifact also changes to ^Wogification Complete^. Since these ERT-z variables are unique to each script, there was no worry that they could be changed (unlike z1-z1000).

As I said, I didn't see them used in newer mods and I also don't think it is possible to make ERT-z vars for anything other than scriptXX.erm (correct me if I am wrong).
____________
"If you get scared of doing what's right you might as well lay down and die" - Wulfstan, Heroes of Might and Magic V: Hammers of Fate

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


Hired Hero
posted July 08, 2019 02:21 PM

@DarkAtom
Ok thanks!I was just curious.
____________
GaĻa be with you.

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


Honorable
Supreme Hero
posted July 08, 2019 09:35 PM
Edited by Bersy at 23:11, 08 Jul 2019.

Quote:
What is the difference between this ERA command and the old command (VR:M4)?


Seems like not so much difference. But SN:K allows you to get string length by string address in memory too.

ERT strings are not binded to particular script indexes, but it was some kind of order to use them like DarkAtom said.

In Era I recommend creating Mods/ModName/Lang/[unique name].json file in any text editor in UTF-8 encoding.

Quote:
[+] Added localization support for ERM scripts. All Lang*.json files are loaded and merged into single dictionary of key => value pairs with language data.
Json files must be saved in UTF-8 encoding with preferably Unix line endings (#10 = 0x0A). The format is the following:

{
 "unique global key": "translation",
 "another key": "another translation"
}

During file loading text is converted from UTF-8 (Unicode, i.e Russian, Polish, Chinese and any other language is supported) into ANSI-encoding, used by player's operational system, ex. Windows-1251.
Thus you may ship the translation, other people may open and edit it without loss and characters, not representable on particular PC, will be replaced with "?".

Real example:

{
 "eqs.this_day_savegame_name": "@day@_@player@",
 "eqs.end_turn_autosave_name": "@day@_@player@_End",
 "eqs.quicksave_name":         "@day@_@player@_Quick",
 "eqs.saved_msg":              "Saved!",
 "eqs.quicksaved_msg":         "Quicksaved!"
}

It's recommended to prefix each key with string, unique for mod or author, like "pm." for "Phoenix Mod".

Translations may have parameters in the form of "@parameter name@". Those parameters are replaced with actual values during translation.
New ERM command !!SN:T is used to translate strings by key.
!!SN:T(key)/?(z-variable to place result to)/(parameter name 1)/(parameter value 1)/(parameter name 2)/(parameter value 2)...;

Example:

!!OW:R-1/6/?y1; y1 - player's gold amount
!!SN:T^test.gold_amount_report^/?z2/^gold^/y1;
!!IF:M^%Z2^; prints "You have 12850 gold left. Not bad!"

my test.json:

{
 "test.gold_amount_report": "You have @gold@ gold left. Not bad!"
}

____________
Heroes 3 Era and everything for it. Releases folder for releases.

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


Promising
Supreme Hero
Researching Magic
posted July 08, 2019 10:58 PM
Edited by RerryR at 23:13, 08 Jul 2019.

I have a question regarding disabling WoG options.

I want to disable some options for a mod, which should be off regardless of what the user selects in WoG Menu.

So let's say Enhanced Commanders
with erm command I can write as instruction
!#UN:P51/0; [Disable Option 51 Enhanced Commanders]
!#VRv7185:S0;  [Disable Enhanced Commanders (v7185 is checked for on/off)]
problematic here is that a part of the code from the script is still executed which causes problems. Because when the script loads and the option is activated by the user, it will still execute. Only later when my script loads it gets deactivated but the damage is already done.  

So one solution would be to get code run before "27 wog - enhanced commanders.erm". How can I do that, what must be the file name?, so far I couldn't figure it out (running ERA 2.8.4).

The second solution is to just copy paste the script to my mod folder and delete everything in it but that is not so nice I think...

Is there any more elegant solution?

Edit: the more I think about it it just breaks down to how to load scripts earlier than the WoG scripts, I'am sure somebody knows :)

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


Honorable
Supreme Hero
posted July 08, 2019 11:14 PM
Edited by Bersy at 23:15, 08 Jul 2019.

Prefix your script name with number, bigger than 27. Your script will be loaded before necessary one.
28 perry test.erm
____________
Heroes 3 Era and everything for it. Releases folder for releases.

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


Hired Hero
posted July 09, 2019 12:38 PM

I am wondering how to get the ERM scripter.When I enter map editor go to WoG tools ERM scripter and ERM script master appear.However when i click on them it says there is an error.What do I do?
And also What is ERM script master?
____________
GaĻa be with you.

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


Adventuring Hero
posted July 09, 2019 01:15 PM
Edited by DarkAtom at 13:17, 09 Jul 2019.

TheSamaritan said:
I am wondering how to get the ERM scripter.When I enter map editor go to WoG tools ERM scripter and ERM script master appear.However when i click on them it says there is an error.What do I do?
And also What is ERM script master?


The erm scripter is found in "%root folder%\Tools\Erm Editor". (If you have ERA II installed).

As for ERM Script Master, it is a tool with GUI that allows you to input values for creature attributes (and some other stuff as well) and auto-generates an ERM script with those changes. The only version I found today on the Internet is 1.1.2.7 (released in 2002). Here you go if you want to download it.
____________
"If you get scared of doing what's right you might as well lay down and die" - Wulfstan, Heroes of Might and Magic V: Hammers of Fate

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


Honorable
Supreme Hero
posted July 09, 2019 01:16 PM

In Era there is a directory ToolsErm Editor.
____________
Heroes 3 Era and everything for it. Releases folder for releases.

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


Hired Hero
posted July 09, 2019 01:35 PM

Oh i don't have ERA II but do I need to uninstall WoG to install it.
And also shall I use this link?

http://heroescommunity.com/viewthread.php3?TID=37208
____________
GaĻa be with you.

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


Honorable
Supreme Hero
posted July 09, 2019 03:15 PM

You don't have to uninstall WoG. Install Era over Heroes 3 Complete/SoD in a separate folder.
Link
____________
Heroes 3 Era and everything for it. Releases folder for releases.

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


Hired Hero
posted July 10, 2019 09:55 AM

Ok thanks I installed it and found out it brings a lot more tools with it!I saw a Def editor.How do you make a Def?
____________
GaĻa be with you.

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


Adventuring Hero
posted July 10, 2019 02:32 PM

TheSamaritan said:
Ok thanks I installed it and found out it brings a lot more tools with it!I saw a Def editor.How do you make a Def?


Depends on what kind of Def. It is best to open an already existing def and see what structure it has. Creatures, for example, have pictures for standing, moving, dying etc. So if you want to make a creature def you will have to design the BMPs for each frame and then use the Def Editor to assemble them into a def.

Also, does anybody know:
1. How to increase/decrease effectiveness of secondary skills? For example, increasing the percentage of Resistance or Sorcery.
2. How to disable the level-up screen for the hero? I would like to display a different screen in which the player can also choose a primary skill.
3. How to make commands like UN:A or UN:G0 take addresses instead of z-variables. What I want is to set the text of artifacts without them eating up z-variables (and without ERT). I thought I can do this with variables allocated with the SN receiver, but UN:A really wants a z-variable index, not an address. Maybe this could be done with UN:C?
____________
"If you get scared of doing what's right you might as well lay down and die" - Wulfstan, Heroes of Might and Magic V: Hammers of Fate

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


Hired Hero
posted July 10, 2019 04:45 PM

What does unbind and open scripts mean?Just saw it in the map editor.
____________
GaĻa be with you.

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


Honorable
Supreme Hero
posted July 10, 2019 08:19 PM

Commands like UN:A also save your changes in savegames and load/apply after loading, thus setting address is not a variant. Era has a few new hint commands:
[+] Added possibility to set secondary skills texts without z-variables dependence. SN:H^secskill^/skill 0..27/0 (name) or skill level/new hint.
[+] Added GET-syntax for all SN:H commands, allowing to get previously set hint for objects or current skill/specialty texts for heroes.
[+] Added SN:H command for setting hints, descriptions, names without z-vars. Currently only the following variants are supported:
SN:H^object^/x/y/z/hint;
SN:H^object^/obj_type or -1/obj_subtype or -1/hint;
____________
Heroes 3 Era and everything for it. Releases folder for releases.

 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 150 200 250 300 350 ... 363 364 365 366 367 ... 400 407 · «PREV / NEXT»
Post New Poll    Post New Topic    Post New Reply

Page compiled in 0.6229 seconds