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 ... 195 196 197 198 199 ... 200 250 300 350 400 407 · «PREV / NEXT»
majaczek
majaczek


Supreme Hero
Work at Magic Dimmension
posted March 21, 2013 12:28 AM
Edited by majaczek at 00:31, 21 Mar 2013.

Hey I read erm help and always peeking there when writing a script.
For example i read there that anybody may cast spell in battle using BH:C or BM:C.
The command needs source (hero or monster) and target (position on battlefield as  explained by the graphics).
What could or should be position when I want to cast non aimable spell? (For example armagedon, destroy undead or expert bless?).

Also era has partially working mechanics of new spells. If i understand properly I can catch the try to cast using bg trigger and checking action. But what if I want add new spell to some monster (erm help says it always gives -1 spell number in bg receiver when monster casts) probably should i check property of monster in BM receiver?
For adventure spells i think it's enough to use spellbook event. Would new spells work on spellscroll? What should I expect from the mechanics?

Could someone remind me memory codes for changing creatures under summon elemental spells?

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


Admirable
Omnipresent Hero
Wog refugee
posted March 21, 2013 12:59 AM

When casting mass spells, position does not matter I think. I scripted an AI hero to destroy his own walls with earthquake and I gave a random location + do not check if monster alive.

!!BH1:C14/3/3/0; cast earthquake at position 3 (does not matter)

+ I have another quest where some peasant casts randomly on the battlefield meteor, inferno, fire ball and land mines in same time. All locations are randomly selected, just simple checks for valid coordinates.


Quote:
Hey I read erm help and always peeking there when writing a script.


The worst thing which could happen to this thread is to have the so called "I want to be scripter" feeling guilty of not doing the homework while fearing the teacher's wrath.

This is not a school class or some kind of business where the boss has the responsibility to sermonize the bad employees. It is our hour of recreation after working hard outside the computer. Errors may happen, things can be missed, yet a simple explanation is more helpful than accusing someone of inattention or laziness.
____________
Era II mods and utilities

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


Responsible
Supreme Hero
posted March 21, 2013 01:40 AM

Quote:
The worst thing which could happen to this thread is to have the so called "I want to be scripter" feeling guilty of not doing the homework while fearing the teacher's wrath.


From my point of view, there are several worse things.

Quote:
... a simple explanation is more helpful than accusing someone of inattention or laziness.


What makes you feel better is not always the thing that helps you the most.

Anyway, your wish is granted. You will hear no more from me.

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


Known Hero
posted March 21, 2013 01:40 AM

First of all I would like to thank you for your support
Secondly, I have a new question

How can I do a condition inside a !?CM trigger that works at the days 14, 15, 16 of EVERY month?

!!VRy-50:Sc;
!!if|y-50=14/y-50=15/y-50=16/y-50=42/y-50=43/y-50=44/y-50=70/y-50=71/y-50=72/...;
...
!!en:;

Thank you for your patience

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


Supreme Hero
Work at Magic Dimmension
posted March 21, 2013 02:04 AM

Read !!VR and variables section of erm help. You need modulo division. Note that month in h3 has only 28 days.

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


Admirable
Omnipresent Hero
Wog refugee
posted March 21, 2013 09:39 AM

Quote:
Anyway, your wish is granted. You will hear no more from me.


My opinion did not concern any else other than me -for what is worth on internet-, punishing the others because of it makes no sense. My only wish is to not be targeted with sarcasm if I make a mistake when enjoying my hobby, but looks too hard for you to resist -your words-.

Fnord's quote from this thread first pages:

The ERM scripter and HTML ERM Help are invaluable tools but they probably won't teach you ERM unless you use them to study existing scripts. Actually, the HTML ERM Help does explain how ERM works but it's not a tutorial--it's more of a technical manual.

ERM (Event Related Model) is quite extensive and complicated (but some things are easy) so you won't learn it all in a day, or even a week, but it's also very powerful.

If you download the ERM Tools you'll get the ERM Script Editor and ERM Help (a large HTML document). You can read a bit about how ERM works in the Help files in the triggers and receivers pages and browse through the rest as a reference.


____________
Era II mods and utilities

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


Admirable
Omnipresent Hero
Wog refugee
posted March 21, 2013 10:26 AM

Quote:

How can I do a condition inside a !?CM trigger that works at the days 14, 15, 16 of EVERY month?


!!VRy-1:Sc%28; [day of the month]
!!FU|y-1<14/y-1>16:E; [exit if not day 14-16]

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


Known Hero
posted March 21, 2013 11:26 AM

Thank you Salamandre. I've never done this and it is hard for me to think like a programmer. But it's funny

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


Honorable
Supreme Hero
posted March 21, 2013 11:31 AM

Jim, without you this thread will be half empty

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


Known Hero
Editing Heroes Without Limits
posted March 22, 2013 01:53 PM

new creatures

I was adding new creatures to the game. To  define the rank abilities I used (example):

*Paladin 4
!#EA193:F72/?y-5; set pegasi attack
!#EA255:By-5/1/72/37/0/5/10/15/20/25/30/35/40/45/50; health
!#EA193:F65/?y-5; set pegasi attack
!#EA255:By-5/1/65/43/0/1/2/2/3/4/5/6/6/7/8; attack
!#EA193:F68/?y-5; set pegasi attack
!#EA255:By-5/1/68/43/0/1/2/3/3/4/4/5/6/7/8; defense
!#EA193:F77/?y-5; set pegasi attack
!#EA255:By-5/1/77/43/0/0/1/1/2/2/3/3/4/4/5; max dmg
!#EA193:F109/?y-5; set pegasi attack
!#EA255:By-5/1/109/43/0/0/1/1/2/2/3/3/4/4/5; min dmg
!#EA193:F83/?y-5; set pegasi attack
!#EA255:By-5/1/83/43/0/0/0/0/1/1/1/1/1/1/2; speed

But the command is too long since I have already added too many creatures. When I was reading "hmm35wog.pac" I found the file "crexpbon.txt". In this file there is a default rank bonus for all lvls. How can I make my new creatures use this default bonus in order to reduce my comands?

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


Known Hero
Editing Heroes Without Limits
posted March 22, 2013 02:08 PM

Quote:
Whirlpool Update: I have done Felipe's testing for him, with these results:

1) I placed three WP's in a test map. From top left to bottom right, their UN:C? values were 0, 1, and 2 (in all six trigger squares).

2) I used Tobyn's Universal Timer to place a 4th WP on day one (one time only):

!?TM2&v2391=1/v2392=1; Tobyn's Universal Timer, once, day 1
!!UN:I4/27/0/111/0; place Whirlpool

Result: all six trigger squares had OB:C? = 0, as expected. The WP works when I enter it (with a Hero in a Ship), that is, the Ship is transported to another WP, but no other WP transports to it.

3) I set the OB:C value for all six trigger squares to the next higher WP number, 3:

!?TM2&v2391=1/v2392=100; Tobyn's Universal Timer, once, day 1 [reset to 100 for instruction test]
!!UN:I4/27/0/111/0; place Whirlpool
!!OB2/26/0:C3;
!!OB3/26/0:C3;
!!OB4/26/0:C3;
!!OB2/27/0:C3;
!!OB3/27/0:C3;
!!OB4/27/0:C3;

Result: the same as in Trial 2) = the WP works when you enter it, but no other WP connects to it. This is as expected, since the connection process does not take place after the start of the game. But it might take place as the map is being loaded, so

4) I used instructions to do the same process:

!#UN:I4/27/0/111/0; place Whirlpool
!#OB2/26/0:C3;
!#OB3/26/0:C3;
!#OB4/26/0:C3;
!#OB2/27/0:C3;
!#OB3/27/0:C3;
!#OB4/27/0:C3;

Result: the added WP seems to work normally. It connects to other WP's, and other WP's connect to it.

Note: there must be a limit to the number of WP's that can be placed on a map. This could be found in the Map Editor by adding WP's until the Map Editor won't allow any more to be added.

Edit - that number is greater than 53, which is where I stopped just now in my test map. Also I should note that the 4th WP which I placed with UN:I for testing was placed below the three wP's which were placed in the Map Editor, so 3 was its natural number.


Thanks a lot. I have done in a little bit different way:

!?FU22507;
!!UN:U111/0/?y6;
!!FU&y6=0:E;
!!VRy7:Sy7 +1;
!!VRv9504&y7=7:Sv9604 +1;
!!VRy7&y7=7:S1;
!!UN:U111/0/-1/9601;
!!OBv9601/v9602/v9603:Cv9604; [give it a number not used]

Every six times the function work it will give another number

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


Supreme Hero
Work at Magic Dimmension
posted March 25, 2013 09:55 PM

hi! in my mod knightmare commanders (this one) there is a bug when a commander is killed in retailation, it writes "!!BM there is no such monster" or something because it try to cast with dead commander. How could I fix it? any ideas? (the mod is 1MB and is mostly the script).

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


Admirable
Omnipresent Hero
Wog refugee
posted March 25, 2013 11:13 PM

Is the cast hardcoded or manually scripted? Because in second case you could simply check if creature is alive before.

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


Supreme Hero
Work at Magic Dimmension
posted March 26, 2013 11:39 AM

here is modified FU7073 from the script

Quote:
!?FU7073;         //cast poison - changed to handle Flash Swing
!_!VRx1:&16; !!VRy3:Sx1 &16; alive !!VRy4:Sx1 &262144; undead !!VRy5:Sx1 &33554432; waiting
!!BG:N?y1; !!BG:Q?y3;
!!if&x3=4:; //Flash Swing
!!UN:R6/50; !!BMy1:C57/x2/3/3/1; Titan's lighting Bolt
!_!BMy1&y5>0:C57/x2/1/3/1; once more if stack is waiting

!!SN&v7083>-1/y3=0:W^majaczek.LCO_Art152^/?y15; !!SN&v7085>-1/y3=1:W^majaczek.RCO_Art152^/?y15;
!!UN&y15>24:R6/50; !!BMy1&y15>24:C57/x2/3/3/1; once more for bow of seeeking after 25 won battles
!!UN&y15>49:R6/50; !!BMy1&y15>49:C57/x2/3/3/1; once more for bow of seeeking after 50 won battles

!!UN:R6/250;
!!en:;

!!if&x3=3:; //Poison
!!BMy1&x1=16:C71/x2/1/3/1;                       [if target is alive have current stack cast poison]
!!en:;

!!if&x3=0:; //Age
!!BMy1:C75/x2/1/3/1;                       [current stack cast Age]
!!en:;




it has nice 1 in every BM:C (check for alive target), and has UN:R6 for synchronisation. but the problem is the caster may die in the process (UN:R6 makes the spell cast sometimes after retaliation which is somewhat intended, but unlucky commander may get killed during triple thunder casting hence the error)

if you want I'll give you calling function so here it is
Quote:
!?BG1&v7185=1/-998;
!!BMv7080&v7080>-1:T?y-3 I?y-4;
!!FU7071&y-3>=174/y-3<=191/v7081=10v7080/y-3;
!!BMv7082&v7082>-1:F?y-7 P?y-8;


!!SN&v7083>-1:W^majaczek.LCO00^/?y-30; !!SN&v7085>-1:W^majaczek.RCO00^/?y-40;
!!FU7073&y-3>=174/y-3<=191/v7081>=6/v7081<=7/y-30=1/y-4=0y-7/y-8/0; // Age (Horrible Wounds)
!!FU7073&y-3>=174/y-3<=191/v7081>=6/v7081<=7/y-40=1/y-4=1y-7/y-8/0; //

!!SN&v7083>-1:W^majaczek.LCO03^/?y-33; !!SN&v7085>-1:W^majaczek.RCO03^/?y-43;
!!FU7073&y-3>=174/y-3<=191/v7081>=6/v7081<=7/y-33=8/y-4=0y-7/y-8/3; // Poison Sting
!!FU7073&y-3>=174/y-3<=191/v7081>=6/v7081<=7/y-43=8/y-4=1y-7/y-8/3; //

!!SN&v7083>-1:W^majaczek.LCO_L^/?y-89; !!SN&v7085>-1:W^majaczek.RCO_L^/?y-99;
!_!CO-3:X2/?y-30; !!VRy-30:*2 +12; !!VRy-10&y-3>=174/y-3<=191/v7081>=6/v7081<=7/v7084=16/y-4=0:S0 R99; //  Flash Swing
!_!CO-4:X2/?y-40; !!VRy-40:*2 +12; !!VRy-11&y-3>=174/y-3<=191/v7081>=6/v7081<=7/v7086=16/y-4=1:S0 R99; //
!!FU7073&y-3>=174/y-3<=191/v7081>=6/v7081<=7/v7084=16/y-4=0/y-10<y-89y-7/y-8/4; //
!!FU7073&y-3>=174/y-3<=191/v7081>=6/v7081<=7/v7086=16/y-4=1/y-11<y-99y-7/y-8/4; //


!!BMv7080&v7092=182/v7081=10:U4/58;
!!BMv7080&v7092=191/v7081=10:U4/58;
!!BMv7082&v7082>-1:T?y-3 I?y-4 P?y-5;
!!BU&v7082>-1:Ey-5/?y-6;
!!BMv7080&v7080>-1:F?y-9;
!!VRy-9&v7080>-1:&65536;
!!BMv7080&v7080>-1:F?y-7 P?y-8;


!!SN&v7083>-1:W^majaczek.LCO00^/?y-30; !!SN&v7085>-1:W^majaczek.RCO00^/?y-40;
!!FU7073&y-3>=174/y-3<=191/v7081=6/y-30=1/v7087>0/y-4=0/y-6>-1/y-9=0y-7/y-8/0; // Age (Horrible Wounds)
!!FU7073&y-3>=174/y-3<=191/v7081=6/y-40=1/v7087>0/y-4=1/y-6>-1/y-9=0y-7/y-8/0; //

!!SN&v7083>-1:W^majaczek.LCO03^/?y-33; !!SN&v7085>-1:W^majaczek.RCO03^/?y-43;
!!FU7073&y-3>=174/y-3<=191/v7081=6/y-33=8/v7087>0/y-4=0/y-6>-1/y-9=0y-7/y-8/3; // Poison Sting
!!FU7073&y-3>=174/y-3<=191/v7081=6/y-43=8/v7087>0/y-4=1/y-6>-1/y-9=0y-7/y-8/3; //

!!SN&v7083>-1:W^majaczek.LCO_L^/?y-89; !!SN&v7085>-1:W^majaczek.RCO_L^/?y-99;
!_!CO-3:X2/?y-30; !!VRy-30:*2 +12; !!VRy-10&y-3>=174/y-3<=191/v7081=6/v7084=16/v7087>0/y-4=0/y-6>-1/y-9=0:S0 R99; //  Flash Swing
!_!CO-4:X2/?y-40; !!VRy-40:*2 +12; !!VRy-11&y-3>=174/y-3<=191/v7081=6/v7086=16/v7087>0/y-4=1/y-6>-1/y-9=0:S0 R99; //
!!FU7073&y-3>=174/y-3<=191/v7081=6/v7084=16/v7087>0/y-4=0/y-10<y-89/y-6>-1/y-9=0y-7/y-8/4; //
!!FU7073&y-3>=174/y-3<=191/v7081=6/v7086=16/v7087>0/y-4=1/y-11<y-99/y-6>-1/y-9=0y-7/y-8/4; //



maybe i done some other mistakes, but i think that it goes. I read !!BM recdeiver again and there is no alive check, and IDK how to fix this here.

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


Admirable
Omnipresent Hero
Wog refugee
posted March 26, 2013 12:39 PM

What about:

!!BMy1:P?y-10; [check stack position]
!!BU:Ey-10/?y-11; [check if alive stack at that position]
!!FU&y-11<0:E; [will return -1 if dead]
!!BMy1&x1=16:C71/x2/1/3/1; [if target is alive have current stack cast poison]


You can also check hit points of the stack with BM#:H then exit if no hp left.
____________
Era II mods and utilities

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


Responsible
Supreme Hero
posted March 27, 2013 04:24 PM
Edited by Hero_Of_Light at 16:24, 27 Mar 2013.

I am trying to change the town's lineup for stronghold when the Mess Hall is build. What I want is that when mess hall is build and you enter the city hall the hobgoblin lineup is changed. I use the triggers but nothing happens. What am I doing wrong?

!?PI;
!!UN:U98/6/?i; //searching for all Towns
!!FU&i=0:E;
!!DO25677/1/i/1:P;

!?FU25677; //searching for all Towns
!!UN:U98/6/x16/1;
!!CA1:T?y-1 B3/19; //if upgraded building is built
!!CA1&y-1=6/1:M1/0/d/?i; //get current number of standard creatures
!!CA1&y-1=6/1:D0/2/87/i; //set our creatures' number accordingly


!?TH0; //on entering City hall
!!IF:V596/0; //set flag to false
!!CA-1:T?y-1 B3/19; //check whether is built
!!IF&-1:V596/1; //if no, set 599 to true
!!CA-1&y-1=6/0:T6/0/0/85; [Hobgoblin]
!!CA-1&y-1=6/0:T6/0/1/87; [Wolf Raider]

!?TH1&596; //on leaving City hall + 599 is true
!!CA-1&y-1=6/1:T6/0/0/84; [Goblin]
!!CA-1&y-1=6/1:T6/0/1/85; [Hobgoblin]
____________
Not idly do the leaves of Lorien fall.

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


Admirable
Omnipresent Hero
Wog refugee
posted March 27, 2013 04:49 PM

!?PI;
!!UN:U98/6/?i; //searching for all Towns
!!FU&i=0:E;
!!DO25677/1/i/1:P98;

!?FU25677; //searching for all Towns
!!UN:Ux1/-1/-1/1;
!!CA1:T?y-1;
!!FU&y-1<>6:E;
!!CA1:B3/19; //if upgraded building is built
!!CA1&1:M1/0/d/?i; //get current number of standard creatures
!!CA1&1:D0/2/87/i; //set our creatures' number accordingly

Flags can't be zero, either 1 or -1. Fixed.

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


Responsible
Supreme Hero
posted March 27, 2013 04:58 PM

This wasn't actually the part that didn't work. I took this part from my 3rd slot script and it works fine. This is the part that must be wrong.

!?TH0; //on entering City hall
!!IF:V596/0; //set flag to false
!!CA-1:T?y-1 B3/19; //check whether is built
!!IF&-1:V596/1; //if no, set 599 to true
!!CA-1&y-1=6/0:T6/0/0/85; [Hobgoblin]
!!CA-1&y-1=6/0:T6/0/1/87; [Wolf Raider]

!?TH1&596; //on leaving City hall + 599 is true
!!CA-1&y-1=6/1:T6/0/0/84; [Goblin]
!!CA-1&y-1=6/1:T6/0/1/85; [Hobgoblin]
____________
Not idly do the leaves of Lorien fall.

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


Admirable
Omnipresent Hero
Wog refugee
posted March 27, 2013 05:02 PM
Edited by Salamandre at 17:08, 27 Mar 2013.

@Edit: I mean flags in TH, can't be 0.

!?TH0; //on entering City hall
!!IF:V596/0; //set flag to false
!!CA-1:T?y-1 B3/19; //check whether is built
!!IF&-1:V596/1; //if no, set 599 to true
!!CA-1&y-1=6/1:T6/0/0/85; [Hobgoblin]
!!CA-1&y-1=6/1:T6/0/1/87; [Wolf Raider]

!?TH1&596; //on leaving City hall + 599 is true
!!CA-1&y-1=6/1:T6/0/0/84; [Goblin]
!!CA-1&y-1=6/1:T6/0/1/85; [Hobgoblin]

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


Responsible
Supreme Hero
posted March 27, 2013 05:09 PM

Nah, it doesn't work. It doesn't give any solution to my problem anyway. Hobgoblins won't get a third upgrade this way anyhow. Thanks for the help. I'll have to think of another way to accomplish third upgrades without the universal upgrades script.
____________
Not idly do the leaves of Lorien fall.

 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 ... 195 196 197 198 199 ... 200 250 300 350 400 407 · «PREV / NEXT»
Post New Poll    Post New Topic    Post New Reply

Page compiled in 0.4829 seconds