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 ... 89 90 91 92 93 ... 100 150 200 250 300 350 400 407 · «PREV / NEXT»
Hero_of_Light
Hero_of_Light


Responsible
Supreme Hero
posted August 19, 2011 10:54 PM

The error occurs the minute i build the Training Grounds. And I told you it IS your version. There aren't much changes. I tried to make it work for two dwellings running the same check because when i just copied pasted it two times there were errors. Anyway, this is the final stage i got the script to work: It gives third slots to Training Grounds and Portal of Glory (creatures 165, 169) and one third slot in Rampart, In Dragon Peaks (creature 168). It works (in all ways possible) when the buildings are already built but when i start a game and build them myself it has erm related errrors. The errors begin the minute i build the upgraded Training Grounds so i'm guessing that's the problem.

****third slots

!#TM21:S8/999/7/1; //1st day timer

//already existing dwellings

!?PI;
!!UN:U98/0/?i; //searching for all castles
!!FU&i=0:E;
!!DO25665/1/i/1:P;

!?FU25665; //searching for all castles
!!UN:U98/0/x16/1;
!!CA1:T?y-1 B3/42; //if upgraded Training ground is built
!!CA1&y-1=0/1:M1/5/d/?i; //get current number of standard creatures
!!CA1&y-1=0/1:D5/2/165/i; //set our creatures' number accordingly
!!CA1:T?y-1 B3/43; //if upgraded Portal of Glory is built
!!CA1&y-1=0/1:M1/6/d/?i; //get current number of standard creatures
!!CA1&y-1=0/1:D6/2/169/i; //set our creatures' number accordingly


//newly built dwellings

!?TH0; //on entering City hall
!!IF:V598/0; //set flag 598 to false
!!CA-1:T?y-1 B3/42; //check whether Training ground is built
!!IF&-1:V598/1; //if no, set 598 to true

!?TH1&598; //on leaving City hall + 598 is true
!!CA-1:T?y-1 B3/42; //check whether Training ground has just been built
!!CA1&y-1=0/1:M1/5/d/?i; //get current number of standard creatures
!!CA1&y-1=0/1:D5/2/165/i; //set our creatures' number accordingly


!?TH0; //on entering City hall
!!IF:V599/0; //set flag 599 to false
!!CA-1:T?y-2 B3/43; //check whether Portal of Glory is built
!!IF&-1:V599/1; //if no, set 599 to true

!?TH1&599; //on leaving City hall + 599 is true
!!CA-1:T?y-2 B3/43; //check whether Portal of Glory has just been built
!!CA1&y-2=0/1:M1/6/d/?i; //get current number of standard creatures
!!CA1&y-2=0/1:D6/2/169/i; //set our creatures' number accordingly


//growth

!?TM21;  //every monday
!!UN:U98/0/?i; //same search as above
!!FU&i=0:E;
!!DO25666/1/i/1:P;

!?FU25666;
!!UN:U98/0/x16/1;
!!CA1:T?y-1 B3/42;
!!FU&y-1<>0|-1:E; //checks for town type and dwelling status
!!CA1&y-1=0/1:M1/5/d/?i; //get current number of standard creatures
!!CA1&y-1=0/1:D5/2/165/i; //set our creatures' number accordingly
!!CA1:T?y-1 B3/43;
!!FU&y-1<>0|-1:E; //checks for town type and dwelling status
!!CA1&y-1=0/1:M1/6/d/?i; //get current number of standard creatures
!!CA1&y-1=0/1:D6/2/169/i; //set our creatures' number accordingly



!?CM1; //every click in a city
!!CA-1:T?y-1 B3/42;
!!FU&y-1<>0|-1:E; //check for town type and dwelling status
!!CA-1:M1/5/d/?i; //get number of standard creatures available
!!CA-1:D5/2/165/?j; //get number of our creatures available
!!CA-1&j<i:M1/5/d/j; //if number of ours is less, we assume they have been hired
!!CA-1&i<j:D5/2/165/i; //vice versa
!!CA-1:T?y-2 B3/43;
!!FU&y-2<>0|-1:E; //check for town type and dwelling status
!!CA-1:M1/6/d/?i; //get number of standard creatures available
!!CA-1:D6/2/169/?j; //get number of our creatures available
!!CA-1&j<i:M1/6/d/j; //if number of ours is less, we assume they have been hired
!!CA-1&i<j:D6/2/169/i; //vice versa


!?FU88888;
!!CA-1:T?y-1 B3/42;
!!FU&y-1<>0|-1:E; //check for town type and dwelling status
!!CA-1:M1/5/d/?i; //get number of standard creatures available
!!CA-1:D5/2/165/?j; //get number of our creatures available
!!CA-1&j<i:M1/5/d/j; //if number of ours is less, we assume they have been hired
!!CA-1&i<j:D5/2/165/i; //vice versa
!!CA-1:T?y-2 B3/43;
!!FU&y-2<>0|-1:E; //check for town type and dwelling status
!!CA-1:M1/6/d/?i; //get number of standard creatures available
!!CA-1:D6/2/169/?j; //get number of our creatures available
!!CA-1&j<i:M1/6/d/j; //if number of ours is less, we assume they have been hired
!!CA-1&i<j:D6/2/169/i; //vice versa


***Rampart***

!#TM21:S8/999/7/1; //1st day timer

//already existing dwellings

!?PI;
!!UN:U98/1/?i; //searching for all castles
!!FU&i=0:E;
!!DO25669/1/i/1:P;

!?FU25669; //searching for all castles
!!UN:U98/1/x16/1;
!!CA1:T?y-1 B3/43; //if upgraded Training ground is built
!!CA1&y-1=1/1:M1/6/d/?i; //get current number of standard creatures
!!CA1&y-1=1/1:D6/2/168/i; //set our creatures' number accordingly

//newly built dwellings

!?TH0; //on entering City hall
!!IF:V598/0; //set flag 598 to false
!!CA-1:T?y-1 B3/43; //check whether Training ground is built
!!IF&-1:V598/1; //if no, set 598 to true

!?TH1&598; //on leaving City hall + 598 is true
!!CA-1:T?y-1 B3/43; //check whether Training ground has just been built
!!CA1&y-1=1/1:M1/6/d/?i; //get current number of standard creatures
!!CA1&y-1=1/1:D6/2/168/i; //set our creatures' number accordingly

//growth

!?TM21;  //every monday
!!UN:U98/1/?i; //same search as above
!!FU&i=0:E;
!!DO25670/1/i/1:P;

!?FU25670;
!!UN:U98/1/x16/1;
!!CA1:T?y-1 B3/43;
!!FU&y-1<>1|-1:E; //checks for town type and dwelling status
!!CA1&y-1=1/1:M1/6/d/?i; //get current number of standard creatures
!!CA1:D6/2/165/v5; //set new amount of our creatures
!!CA-1&y-1=1/1:D6/2/168/i; //set our creatures' number accordingly


!?CM1; //every click in a city
!!CA-1:T?y-1 B3/43;
!!FU&y-1<>1|-1:E; //check for town type and dwelling status
!!CA-1:M1/6/d/?i; //get number of standard creatures available
!!CA-1:D6/2/168/?j; //get number of our creatures available
!!CA-1&j<i:M1/6/d/j; //if number of ours is less, we assume they have been hired
!!CA-1&i<j:D6/2/168/i; //vice versa

!?FU88888;
!!CA-1:T?y-1 B3/43;
!!FU&y-1<>1|-1:E; //check for town type and dwelling status
!!CA-1:M1/6/d/?i; //get number of standard creatures available
!!CA-1:D6/2/168/?j; //get number of our creatures available
!!CA-1&j<i:M1/6/d/j; //if number of ours is less, we assume they have been hired
!!CA-1&i<j:D6/2/168/i; //vice versa
____________
Not idly do the leaves of Lorien fall.

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


Known Hero
posted August 19, 2011 11:13 PM
Edited by Aleee at 23:15, 19 Aug 2011.

Previously I suggested to change !!CA-1 to !!CA1 and you did it. Everywhere.
After a trigger like !?TH or !?CM1 or !?FU88888 you MUST use !!CA-1, because there IS a "current" town. When the function searches for all towns on the map (in our case these are parts of code with triggers !?TM, !?PI and all other functions called from those triggers) there is no "current" town, that is why we store coordinates of every town in variables and the command MUST be !!CA1.

Correct this (using not only copy-paste, but brains also) as it should be and everything will work. Example:

!?TH1&598; //on leaving City hall + 598 is true
!!CA-1:T?y-1 B3/42; //check whether Training ground has just been built
!!CA1&y-1=0/1:M1/5/d/?i; //get current number of standard creatures
!!CA1&y-1=0/1:D5/2/165/i; //set our creatures' number accordingly

must be

!?TH1&598; //on leaving City hall + 598 is true
!!CA-1:T?y-1 B3/42; //check whether Training ground has just been built
!!CA-1&y-1=0/1:M1/5/d/?i; //get current number of standard creatures
!!CA-1&y-1=0/1:D5/2/165/i; //set our creatures' number accordingly

not because we should make !!CA-1 from all !!CA1s, but because we use !?TH trigger here and no coordinates stored. And so on. Good luck.

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


Known Hero
Heral knight
posted August 20, 2011 12:05 AM

Is there anyway to change the actual monster picture (not the monster itself) with downloaded DEFs?

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


Admirable
Omnipresent Hero
Wog refugee
posted August 20, 2011 12:14 AM

You should create a new topic, more on that matter: "I am new to WoG, how to?".

Maybe will get stickied with time. Of maybe not, because all those tricks were explained a thousand of times. But certainly not in ERM help.
____________
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 August 20, 2011 12:00 PM

@Aleee

It seemed to work. Thanks

I hope this will be the last problem i had with it
____________
Not idly do the leaves of Lorien fall.

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


Adventuring Hero
New Hero
posted August 20, 2011 08:45 PM

Can anyone tell me what's wrong with this script?
All I'm trying to do is make it so no matter what creature dwelling is visited, it only offers archers to recruit.

ZVSE

!?OB17; // when creature dwelling is visited
!!OB998/999/1000:U57; change to archers tower

*end script*

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


Admirable
Omnipresent Hero
Wog refugee
posted August 20, 2011 08:56 PM

Had same problem earlier and the only solution was to delete object and place the new. Or you can use !!DW and change creatures subtype. Besides this your way of storing coordinates is wrong unless you are playing a 1000x1000 map with 1000 undergrounds
____________
Era II mods and utilities

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


Adventuring Hero
New Hero
posted August 20, 2011 10:25 PM

Thanks Salamandre! I used the DW trigger and added v to 998 and stuff (woops) and it worked. It works with everything except war machines like balistas, first aid tents, etc. Those don't work at all. Are they not supported?

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


Promising
Famous Hero
of infamy
posted August 20, 2011 10:33 PM

I've begun replacing all the siege pictures for my town. Is there a command to change the unit that shoots from the arrow towers when attacking the town? Or will I have to check if it's the right town, replace the creature def and then change back, with a few other checks?

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


Promising
Famous Hero
feanor on DF2.ru
posted August 20, 2011 10:43 PM

Quote:
Is there a command to change the unit that shoots from the arrow towers when attacking the town?

Conflux?
!!UN:C6541448/4/<num>;

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


Admirable
Omnipresent Hero
Wog refugee
posted August 20, 2011 10:45 PM

Quote:
replace the creature def and then change back


Can we do that in real time? I am interested, someone I know would like to change the rampart whole units to other defs middle game.
____________
Era II mods and utilities

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


Promising
Famous Hero
of infamy
posted August 20, 2011 11:00 PM

Quote:
Quote:
replace the creature def and then change back


Can we do that in real time? I am interested, someone I know would like to change the rampart whole units to other defs middle game.


Right now it's just a simple matter of storing many unused defs in h3sprite.lod. When you want to swap them, find their place in memory and change the old def to the new one. I've been changing the c in front of the creature name so it's a single letter swap and the rest is the same. I was trying to fix an error I talked about earlier that has yet to be resolved, but I did

!!UN:C6769412/1/86; which changes cfbird.def to Vfbird.def. I did not try it mid battle or anything but that would be interesting...

@oxfea thanks I'll try that.

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


Promising
Famous Hero
feanor on DF2.ru
posted August 20, 2011 11:35 PM

Quote:
Quote:
replace the creature def and then change back


Can we do that in real time? I am interested, someone I know would like to change the rampart whole units to other defs middle game.

Yes. I saw a function on df2, but now it is down. If you need, I can rewrite it.

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


Admirable
Omnipresent Hero
Wog refugee
posted August 20, 2011 11:54 PM

I am very interested. But then how to solve the small portraits problem? We can't change that as well.
____________
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 August 21, 2011 12:06 AM

This may have been asked before but i couldn't find it in the erm help so...

Is there a way to make a creature cast a spell after attack without using the Stack experience? I am asking because i would like to control the damage dealt and make it proportional to the number of creatures. I want to make the Silver pegasi (creature 21) cast Chain Lightning (spell 19) after attack and the damage dealt to be 10 damage per unit (like the Roc Lightning). If it could be set as a percentage change to be cast that would be better too...
____________
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 August 21, 2011 12:09 AM

But chain damage is decreasing exponentially.
____________
Era II mods and utilities

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


Promising
Famous Hero
of infamy
posted August 21, 2011 12:17 AM

Quote:
I am very interested. But then how to solve the small portraits problem? We can't change that as well.


Well I'm not sure actually if cprsmall is in one memory spot or many. Couldn't you simply add in creatures using oxfea's plugin and then swap them out?

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


Promising
Famous Hero
feanor on DF2.ru
posted August 21, 2011 12:18 AM
Edited by OxFEA at 00:19, 21 Aug 2011.

Quote:
Is there a way to make a creature cast a spell after attack without using the Stack experience?


Try combination like this:

On !?BG0: when BG:A =6 or =7 store BG:N (attacker slot ID) and BG:E (target slot ID)
On !?MF1: if target = MF:N and attacker is silver pegasi then cast spell with BM:C

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


Responsible
Supreme Hero
posted August 21, 2011 12:23 AM

@Salamandre

I know. It's just that it needs a damage to start with and that's what i want to be 10 damage for each Silver Pegasi.

@OxFEA

I don't get how that would work. The battle trigger can store the creatures id how? And where is the spell id? Can you be more specific?
____________
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 August 21, 2011 02:56 AM

!?BG0;
!!BG:A?y1;
!!FU&y1<>6:E; attack
!!BG:N?v2000; stack
!!BMv2000:T?y2; type
!!FU&y2<>21:E; no peg, exit
!!BG:E?y2;
!!BMy2:P?y3;
!!BMv2000:N?y4;
!!VRv2002:Sy4 *10; check monsters number in stack and multiply by 10
!!BMv2000:C19/y3/3/1/1;  cast on target
!!IF:V99/1;


!?MR1&99;
!!MR:Fv2002;
!!VRz1:S^The chain lightning does %V2002 damage^;
!!MM:Sz1;
!!IF:V99/0;

____________
Era II mods and utilities

 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 ... 89 90 91 92 93 ... 100 150 200 250 300 350 400 407 · «PREV / NEXT»
Post New Poll    Post New Topic    Post New Reply

Page compiled in 0.5225 seconds