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 ]
New Server | HOMM1: info forum | HOMM2: info forum | HOMM3: info forum | HOMM4: info forum | HOMM5: info 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 352 pages long: 1 2 3 4 5 ... 70 140 210 280 ... 348 349 350 351 352 · «PREV
Donach
Donach

Tavern Dweller
posted May 21, 2018 09:12 PM

RerryR said:
Donach said:
Hello guys,
I am new to ERM and could use your help, please.

I am trying to achieve quite simple thing.

On battle start, take all unit types hero has on him (say 3 different units, each unit only 1 units on it), and make that unit into 100 units for the battle.

Then, if the unit survives, set the number of that unit to 1 only again.

I am able to do it "statically", meaning using this:
!?BA0; // at start of battle
!!BA:M0/0/0/100; // set 100 pikemans on position 0 of attacking hero

How can I achieve similar thing, but dynamically for each different unit?

Thank you.

PS: Would you recommend any specific tutorials, guides? I am using the "http://www.wakeofgods.com/erm_help/", but to me, it seems like there is a lot of missing, or sometimes its just not descriptive enough.


Hi,
not the easiest ERM code to begin with. But I'll help you with the basic code that i would use. Remember there are often several ways of achieving what you want. Just stick to ERM Help. It has all the information you need. It's also very helpful to open already existing scripts (in WoG folder) and start playing with the numbers and see what happens. Once you changed something you can press F12 ingame to apply changes.


you can try this:

ZVSE

!?BF&1000; *at battle start
!!IF:M^Set all Creatures to 100 at beginning of battle^; *Show Message ingame
!!DO21693/0/41/1:P; *Run Fkt.Nr. 21693 42 times. The code now jumps to the function

*New Trigger*
!?BA1&1000; *At battle end
!!IF:M^Set all Creatures to 1 after battle^;
!!DO21694/0/6/1:P; *Run Fkt.Nr. 21694 7 times. (For all hero slots)


!?FU21693;
!!BMx16:N100;


!?FU21694;
!!HE-1:C0/x16/?y1/1;
*End Code*

From ERM help:
The x16 variable (used in functions called with the DO Receiver), stores the current cycle number of the function. For example, if the function is being repeated 12 times (from 1 to 12), the first time through, x16 will equal 1, the second time 2 and so on. If you change the x16 variable, you can actually "speed up" or "slow down" a function loop, or even exit from it completely by setting x16 equal to the end value (or higher) that was specified in the DO receiver.

This script will work in any battle and with any hero. So whatever you want to archive you have to set some constraints for the code. For example to only work with certain heroes or specific battles.


Hello,
Thanks for your help.
I tried the script, however, the second part does not seem to work. I see that you are using the "y1" variable for the monster type, however, how can I get it?

Right now, the number of creeps is correctly set to 100 at start, when battle ends, whetever creatures are left are staying at that number...

Thank you again for help.
____________

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


Admirable
Omnipresent Hero
Wog refugee
posted May 21, 2018 09:35 PM

Add to this:

!?BA1&1000; *At battle end
!!IF:M^Set all Creatures to 1 after battle^;
!!DO21694/0/6/1:P; *Run Fkt.Nr. 21694 7 times. (For all hero slots)

This:

!!UN:R1; redraw screen, heroes armies etc

Its just that you think it doesn't work because Rerry forgot to redraw screen.

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


Supreme Hero
Work at Magic Dimmension
posted June 20, 2018 02:56 PM

well it's more on plugins than scripting, but where in the code is part of casting adventure spells and where is part of casting damage spells. I wish to replace some boring adventure spells (i.e scuttle boat) with alternatives for existing damage spells but in another school of magic (now I use scripting with dialogs but it doesn't work as good  as I want).

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Jump To: « Prev Thread . . . Next Thread » This Popular Thread is 352 pages long: 1 2 3 4 5 ... 70 140 210 280 ... 348 349 350 351 352 · «PREV
Post New Poll    Post New Topic    Post New Reply

Page compiled in 0.1007 seconds