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 (started by Odvin in March 2003)
ERM help and discussion This Popular Thread is 415 pages long: 1 2 3 4 5 ... 80 160 240 320 400 ... 411 412 413 414 415 · «PREV / NEXT»
bloodsucker
bloodsucker


Legendary Hero
posted October 31, 2025 06:33 AM

How do I write?

If rest of N divided by 5 equals 0 then give creatures to hero.
____________

 View Profile
Salamandre
Salamandre


Admirable
Omnipresent Hero
Wog refugee
posted October 31, 2025 09:12 AM
Edited by Salamandre at 09:13, 31 Oct 2025.

Let's say N=v10.

!!VRv10::5; divide v10 by 5
!!HE-1&v10=0:C#[...] give creatures
____________
You must not OFFEND people - Jolly Joker

 View Profile
bloodsucker
bloodsucker


Legendary Hero
posted October 31, 2025 09:44 AM
Edited by bloodsucker at 18:15, 31 Oct 2025.

Salamandre said:
Let's say N=v10.

!!VRv10::5; divide v10 by 5
!!HE-1&v10=0:C#[...] give creatures


Isn't that the result? What I can't find is the operator for Rest.

Where are the operators, btw?

P.S. It is the result, 38 divided by 5? Answer, 7.
____________

 View Profile
Salamandre
Salamandre


Admirable
Omnipresent Hero
Wog refugee
posted October 31, 2025 06:36 PM
Edited by Salamandre at 18:46, 31 Oct 2025.

I don't know what you mean by "rest", show me where you read the concept of "rest" in ERM help manual. If you divide something, the rest is the remaining value, which means the result. Unless I am missing some quantum physics here.

The operators are mentioned in the tutorial from Qurqirish Dragon, in erm help.

 View Profile
bloodsucker
bloodsucker


Legendary Hero
posted October 31, 2025 08:40 PM
Edited by bloodsucker at 21:02, 31 Oct 2025.

When you divide 17 by 5 the result is 3, the "rest" is 2. I've searched the f Google Translator and it gives me "the rest of the division" and "le reste de la division" for this concept. Now, I'm not a mathematician but I'm sure the concept exists, it is called "o resto" in Portuguese and I believe there is a character/operator that gives you that in ERM, I think I remember to read about it at some point, couldn't find out where.
Thank you for the tip, I'll look into that tutorial.


P.S. And I guess there isn't. There is one that gives you module, maybe that's what I recalled but it doesn't work for this.

I wanted to use the prime numbers to give creatures at a ratio, the lower the creature, the lower the prime number, the first found give bonus and exit function, The majority of the times would give you nothing but the times and the frequency in witch the different level creatures would be the reward would be always similar.
____________

 View Profile
Salamandre
Salamandre


Admirable
Omnipresent Hero
Wog refugee
posted October 31, 2025 10:24 PM
Edited by Salamandre at 22:55, 31 Oct 2025.

Ah I see, but you don't need a special command to find that, just basic maths and erm knowledge, so you use existing commands

For example, we will generate random numbers between 20 and 100 then divide by random numbers between 1 and 10. The script will give the rest when there is one.

!?CM0; triggers when you right click on map
!!VRv2:S20 R100; generate random value 20-100
!!VRy1:Sv2;
!!VRy2:S1 R10; generate random value 1-10 which will be used to divide the first value
!!IF:L^we are going to divide %V2 by %Y2^;
!!VRy1::y2; start division
!!VRy1:*y2; now multiply by same number
!!FU&v2=y1:E; exit if no rest as value was identical
!!VRv2:-y1; subtract the multiplied value from the divided one
!!IF:L^Your rest is %V2^;


 View Profile
bloodsucker
bloodsucker


Legendary Hero
posted October 31, 2025 11:17 PM

Thank you, you are a genius. Just used the function to get the correct numbers for !!EA in battle yesterday...

I was hopping for a single line, though.
____________

 View Profile
bloodsucker
bloodsucker


Legendary Hero
posted December 19, 2025 08:10 AM
Edited by bloodsucker at 08:31, 19 Dec 2025.

Would it be possible to cast Earthquake, passively, when a certain creature gets the turn, if that player is attacking a town?

Can you ban a race from learning a secondary skill (Ballistics), like Battlemages can't learn Navigation?

Is it possible to say that a certain race doesn't have creatures of the highest levels, so that the buildings aren't blocked just useless and player doesn't have a clue of what will be there?
____________

 View Profile
Salamandre
Salamandre


Admirable
Omnipresent Hero
Wog refugee
posted December 19, 2025 11:13 PM
Edited by Salamandre at 23:47, 19 Dec 2025.

Angel (ID=12) casts earthquake

!?FU77007; regeneration phase
!!SN:X?y1; y1 — stack number
!!FU&y1>21:E; exit, if defender
!!BMy1:T?y2; get type
!!FU&y2<>12:E; angel
!!BA:S?y3; get battle type
!BMy1&y3>0:V26; cast animation protection earth (check BM:V to select the one you prefer)
!!BH0&y3>0:C14/3/3/0; if siege, caste earthquake on angel turn

For skills, there is a text file, Hotraits maybe? Check in the lods. It allows changing the chances of a skill for certain classes.

Last question, don't understand.

 View Profile
bloodsucker
bloodsucker


Legendary Hero
posted December 26, 2025 05:38 PM
Edited by bloodsucker at 20:21, 26 Dec 2025.

Thank you.
Forget the last question, it wouldn't work aesthetically as I first thought. Disabled it is.
Can you change the chances of primary skill gain for a class through ERM or it's the H3traits again?

Happy New Year.

P.S. Isn't it y1>20? Isn't 21 the first defender stack?
____________

 View Profile
rerryr
rerryr


Promising
Supreme Hero
Researching Magic
posted December 27, 2025 03:47 PM

bloodsucker said:
Thank you.
Forget the last question, it wouldn't work aesthetically as I first thought. Disabled it is.
Can you change the chances of primary skill gain for a class through ERM or it's the H3traits again?

Happy New Year.

P.S. Isn't it y1>20? Isn't 21 the first defender stack?


Yes it must say y1>20 to not skip the first defender stack.

You can control which primary skill point is given during level up, that means you can also set the chance for every class with erm command. It's well described on the erm help document.

 View Profile
bloodsucker
bloodsucker


Legendary Hero
posted December 27, 2025 04:55 PM

I know how to do that with !!HL if that is what you mean but if I want to redefine the levelling up of about 16 heroes, manually controlling them seams predictable in a way classic levelling up is not. Like, they all get Attack at level two and Defense at level three, is it not like this?
____________

 View Profile
rerryr
rerryr


Promising
Supreme Hero
Researching Magic
posted December 28, 2025 08:14 AM

bloodsucker said:
I know how to do that with !!HL if that is what you mean but if I want to redefine the levelling up of about 16 heroes, manually controlling them seams predictable in a way classic levelling up is not. Like, they all get Attack at level two and Defense at level three, is it not like this?


I assume you would use a random generator to change the chance of which skill point is given. By that you can have the same distribution as if you would alter the txt file.

 View Profile
bloodsucker
bloodsucker


Legendary Hero
posted December 28, 2025 02:34 PM

Let's put it this way:
I have no mathematic skill to do that.

But thank you.
____________

 View Profile
Salamandre
Salamandre


Admirable
Omnipresent Hero
Wog refugee
posted December 28, 2025 04:31 PM
Edited by Salamandre at 17:18, 28 Dec 2025.

Look, be consistent. If you want script done, ask for it and specify the precise parameters you want. But you asked if it can be done, and didn't give any parameter, so others indicated you the direction to take.

You don't need any "mathematical skill", look at HL command then start testing. It will take you probably 10 minutes to get it right.

This is the basic command :

!!HL:S0/-2/-2; occurs on hero level up

The -2 are for secondary skills, -2 means you don't change what the game offers. The first parameter, 0, is where you have to code.

0 Attack
1 Defense
2 Power Skill
3 Knowledge

Random generator means you create a random value. Lets say you want 40% chance of +1 attack, 40% chance of +1 defense, then 10% chance for respectively knowledge and spell power. So roll y1 (VRy1:S0 R100) to create a value between 0 and 100. Then put conditions,

if y1<41, y2=0
if y1>40/y1<80, y2=1
if y1>79/y1<90, y2=2
if y1>89, y2=3

Then :

!!HL:Sy2/-2/-2;

You have to try, don't give up before. You have the trainer mod, so leveling up is easy now. If the script requires several components and you don't know them, start by testing them separately, example for random generator:

!?CM0; when map right click
!!VRy1:S0 R1000; create random value 0-1000
!!IF:L^the value of y1 is %Y1^; display the random generated value

And so on.


 View Profile
rerryr
rerryr


Promising
Supreme Hero
Researching Magic
posted December 28, 2025 06:17 PM

Thank you Sal, that's exactly how I would have done it!
Tipp: If you place a hero with level 99 on the map, and start the game, you will immediately see how good your script worked, when checking his stats.

 View Profile
bloodsucker
bloodsucker


Legendary Hero
posted December 29, 2025 01:54 AM
Edited by bloodsucker at 02:00, 29 Dec 2025.

Salamandre said:
Look, be consistent.
I thought there was a way I hadn't found to access those parameters.
Has it has been usual when it comes to these algorithms, I'm only able to wonder how you do them and copy what someone did. I can't "think" how to do them.
I can write lines of parameters, like giving a creature !!EA abilities, but every time I have to write !!FU... I know I will have troubles.

____________

 View Profile
Salamandre
Salamandre


Admirable
Omnipresent Hero
Wog refugee
posted December 29, 2025 02:30 AM

FU is used in two situations, a) start a function, b) exit the script if conditions are not meet. So far you need only the second which is super simple.

Example :

!!HE-1:N?y1; check hero ID and store in y1 variable
!!FU&y1<>115:E;  exit the script if not Tazar (y1 must be 115 to continue)

Thats all, don't make a paranoia about.

 View Profile
bloodsucker
bloodsucker


Legendary Hero
posted December 29, 2025 03:07 PM
Edited by bloodsucker at 15:09, 29 Dec 2025.

I meant, every time I need to use a function/procedure I know I'm in trouble (cause I'm becoming senile and I lose track of what I'm doing).
Understanding the help and using the instructions has become easy with training but the logic, let's put it this way: I often have to go back on a comment, cause I've forgotten what I was commenting about. Now, imagine a complex procedure.
____________

 View Profile
bloodsucker
bloodsucker


Legendary Hero
posted December 31, 2025 04:59 PM

I'm sorry, I don't understand this:

R3/$1/$2 Set hero's availability in the hero pool for each player
  $1 - enable (1) or disable (0) hero to hire
  $2 - players to affect (see Format E1)
Comments:
$2 makes sense (will be set) only if you enable a hero.
If you disable a hero that is owned by any player, the hero will be killed.

***

I wanted to disable certain heroes (the ones I modified) from being hired by the AI, so I wrote this:

!#HE146:R3/1/0;

but this disables them for player one too.
____________

 View Profile
Jump To: « Prev Thread . . . Next Thread » This Popular Thread is 415 pages long: 1 2 3 4 5 ... 80 160 240 320 400 ... 411 412 413 414 415 · «PREV / NEXT»
Post New Poll   Post New Topic   Post New Reply

Page compiled in 0.2575 seconds