Heroes of Might and Magic Community
please log in.! Register | Today's Posts | Search! | FAQ/Rules | AvatarList | MemberList | Profile

<a href="http://www.game-advertising-online.com/" target=_blank>Game Advertising Online</a><br> banner requires iframes

Heroes 1 (Heroes 2 (Heroes 3 (Heroes 4 (Heroes 5 (Heroes 6 ()

Login:     Username:     Password:    
Heroes Community > Heroes 3.5 - WoG and Beyond > Thread: ERM help and discussion
Thread: ERM help and discussion [ This thread is 228 pages long: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 (150) 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 ]
Hero_Of_Light
Hero_Of_Light


Promising
Supreme Hero
posted June 25, 2012 11:05 AM
Edited by Hero_Of_Light at 09:15, 28 Jun 2012.

Can someone point me to the right direction with this script?

I want the Altar of Thought of every Conflux to have the creatures growth reduced every monday by 1 (only if Castle is built). Here's what I got:  

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

!?FU25682;
!!UN:U98/8/x16/1;

!!CA1:T?y-1 B3/9;
!!FU&y-1<>8|-1:E; //checks for town type and dwelling status
!!CA1&y-1=8/1:M1/5/d/d-1; //set Azure and Faerie

I'm pretty sure I'm using the reduction part wrong. Does anyone know how to fix this please?
____________
Not idly do the leaves of Lorien fall.

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


Responsible
Supreme Hero
posted June 28, 2012 10:06 AM
Edited by Bersy at 10:53, 28 Jun 2012.

!?TM2&$weekday$=1/$once$=1;
!!UN:U98/8/?y1; y1 - number of Conflux towns
!!FU&y1=0:E; exit if nothing found
!!VRy2:S0; reset counter
!!VRv2:C-1/0/0; clear search vars
!!UN:U98/8/-1/2; #4 find next town in v2..v4
!!CA2:B3/9; check its Castle building
!!if&1:; if built
 !!CA2:B3/35; check level 6 building
 !!CA2&1:M1/5/d-1/d B3/42; subtract 1 from level6 creatures
 !!CA2&1:M1/5/d/d-1; subtract 1 from level6 upgraded creatures
!!en:;
!!VRy2:+1; increase counter
!!SN&y2<y1:G4; repeat if not all towns processed


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


Promising
Supreme Hero
posted June 28, 2012 10:40 AM

It doesn't work. It starts with a lot of ERM problem windows writing "insufficient paramaters".
____________
Not idly do the leaves of Lorien fall.

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


Responsible
Supreme Hero
posted June 28, 2012 10:53 AM

UN:C => UN:U, fixed, sorry.

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


Promising
Supreme Hero
posted June 28, 2012 11:04 AM
Edited by Hero_Of_Light at 11:04, 28 Jun 2012.

I think I found a way myself (using the right subtraction commands you gave me):

!?TM21;  //every monday

!!UN:U98/8/?i; //same search as above
!!FU&i=0:E;
!!DO25682/1/i/1:P;

!?FU25682;
!!UN:U98/8/x16/1;


** Faerie Dragons reduce growth
!!CA1:T?y-1 B3/35;
!!FU&y-1<>8|-1:E; //checks for town type and dwelling status
!!CA1:T?y-1 B3/9;
!!FU&y-1<>8|-1:E; //checks for town type and dwelling status
!!CA1&y-1=8/1:M1/5/d-1/d; subtract 1 from level6 creatures

** Azure Dragons reduce growth  
!!CA1:T?y-1 B3/42;
!!FU&y-1<>8|-1:E; //checks for town type and dwelling status
!!CA1:T?y-1 B3/9;
!!FU&y-1<>8|-1:E; //checks for town type and dwelling status
!!CA1&y-1=8/1:M1/5/d/d-1; subtract 1 from level6 creatures

Seems to work. Anyway, I'll keep your suggestion in mind too. Thanks for the help!
____________
Not idly do the leaves of Lorien fall.

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


Responsible
Supreme Hero
posted June 28, 2012 11:25 AM

Welcome, but check for town in your script is odd (you already search for 98/8) and the search is very slow.

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


Promising
Supreme Hero
posted June 30, 2012 09:47 AM

Ultimately it doesn't work if not all the buildings are built. There must to be something wrong with the building checking part. But I don't know how I can make it check for the building and Castle in the same time. Here's the whole script:

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

!?FU25682;
!!UN:U98/8/x16/1;


!!CA1:T?y-1 B3/40;
!!FU&y-1<>8|-1:E; //checks for town type and dwelling status
!!CA1&y-1=8/1:M1/3/d/?i; //get current number of standard creatures
!!CA1&y-1=8/1:D3/2/113/i; //set our creatures' number accordingly
!!CA1&y-1=8/1:D3/3/115/i; //set our creatures' number accordingly

!!CA1:T?y-1 B3/43;
!!FU&y-1<>8|-1:E; //checks for town type and dwelling status
!!CA1&y-1=8/1:M1/6/d/?i; //get current number of standard creatures
!!CA1&y-1=8/1:D6/2/158/i; //set our creatures' number accordingly


** Faerie Dragons reduce growth
!!CA2:B3/9; check its Castle building
!!if&1:; if built
!!CA1:T?y-1 B3/35;
!!FU&y-1<>8|-1:E; //checks for town type and dwelling status
!!CA1&y-1=8/1:M1/5/d-1/d; subtract 1 from level6 creatures

** Azure Dragons reduce growth
!!CA2:B3/9; check its Castle building
!!if&1:; if built
!!CA1:T?y-1 B3/42;
!!FU&y-1<>8|-1:E; //checks for town type and dwelling status
!!CA1&y-1=8/1:M1/5/d/d-1; subtract 1 from level6 creatures

This is part of the third slots script. I thought that adding the reduction of the growth here (that already sets the growth each monday) would be appropriate. However, I am doing something wrong with the building checks. This only works when all the buildings are built. If someone knows how to deal with this please help.
____________
Not idly do the leaves of Lorien fall.

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


Responsible
Supreme Hero
posted June 30, 2012 10:22 AM

Every !!if should have appropriate !!en:;

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


Promising
Supreme Hero
posted June 30, 2012 11:06 AM
Edited by Hero_of_Light at 12:33, 30 Jun 2012.

***EDIT***

I changed the trigger (from your script) to TM21 and it seems to work now... I'll run some test but I think I got it now.

BTW, I got another problem now:P

I've been using your script that changes the creature sounds around:

**WOG creature sounds
!?FU3000;
!!UN:Ux1/-1/-1/1;
!!CAv1/v2/v3:T?y1 O?y2;
!!FU&v2000<>y2:E;
!!FU&y1<>6:E;
!!CAv1/v2/v3:B3/22;
!!FU&-1:E;
!!VRv2001:+1;
!!VRv2002:+100;

!?FU54321;
!!UN:C4697553/4/?y1; y1 - MonInfo Table
!!VRy2:S116*x2+y1+8; y2 - address of sound pointer
!!UN:Cy2/4/?y3;
!!VRy2:S116*x1+y1+8;
!!UN:Cy2/4/y3;

!#FU54321:P155/84;  **Darkness -> Goblin
!#FU54321:P150/122;   ***Supreme -> crusaders
!#FU54321:P152/12;  **Lord of Thunder -> Angel
!#FU54321:P164/53;   ***Fire Messenger -> Efreet Sultans
!#FU54321:P167/70;  **Water Messengers -> Troglodyte
!#FU54321:P169/34;   ***War Zealot -> Mage
!#FU54321:P171/35;   ***Lava Sharpshooter -> Mage
!#FU54321:P170/9;   ***Arctic Sharpshooter -> Zealot
!#FU54321:P173/16;  **Santa Gremlin -> Dwarf
!#FU54321:P195/52;   ***Hell Steeds -> Efreet

And while it works well in the first place, the creatures don't have the apropriate sounds when the game is loaded. When you load the game the sounds are set back to the original ones. Apparently it needs a load game trigger somewhere I don't know... Can you fix this?
____________
Not idly do the leaves of Lorien fall.

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


Honorable
Undefeatable Hero
posted June 30, 2012 12:57 PM

!?GM0;
!!FU54321:P155/84;  **Darkness -> Goblin
!!FU54321:P150/122;   ***Supreme -> crusaders
!!FU54321:P152/12;  **Lord of Thunder -> Angel
!!FU54321:P164/53;   ***Fire Messenger -> Efreet Sultans
!!FU54321:P167/70;  **Water Messengers -> Troglodyte
!!FU54321:P169/34;   ***War Zealot -> Mage
!!FU54321:P171/35;   ***Lava Sharpshooter -> Mage
!!FU54321:P170/9;   ***Arctic Sharpshooter -> Zealot
!!FU54321:P173/16;  **Santa Gremlin -> Dwarf
!!FU54321:P195/52;   ***Hell Steeds -> Efreet

You already have such trigger in your script, just add those functions.

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


Promising
Supreme Hero
posted June 30, 2012 01:05 PM
Edited by Hero_of_Light at 12:51, 01 Jul 2012.

**EDIT**

I have a huge problem with the script that allows third (and forth) hiring slots in towns' buildings. Here's a sample of the script:

**Castle**

!#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/19; //if upgraded Training ground is built
!!CA1&y-1=0/1:D2/2/165/1; //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/19; //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/19; //check whether Training ground has just been built
!!CA-1&y-1=0/1:D2/2/165/1; //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
!!CA-1&y-2=0/1:M1/6/d/?i; //get current number of standard creatures
!!CA-1&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/19;
!!FU&y-1<>0|-1:E; //checks for town type and dwelling status
!!CA1&y-1=0/1:D2/2/165/1; //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-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-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

This is script is copied and pasted for all the towns, I just posted Castle to show you how it is: Now this script gives the following:

It gives one extra creature in Griffin Bastion each week
It gives a third slot in Portal of Glory.

THE PROBLEM

This script works fine when all the buildings are already built. It also works fine IF the upgraded buildings are built in the right order. However, If I upgrade Portal of Glory BEFORE I upgrade the Griffin Bastion then there's problems with it. Either the third slots don't appear at all, or the creature growth is messed up.

I know that the problem lies with the building checking. The script checks whether the buildings are built and so if the buildings aren't built with the order the script checks them then there's problem. So the solution lies right there, I need a way to have each building check run sepparetely and don't have the script exit if one of them isn't built or not.

I don't know If I am understandable but I sincerely need your help in this so please If anyone knows how to fix this please post.
____________
Not idly do the leaves of Lorien fall.

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

Tavern Dweller
posted July 01, 2012 02:33 PM

How can I change the war machine (in blacksmith) to another monster/ghost like completely destroyed town?

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


Promising
Famous Hero
of infamy
posted July 01, 2012 02:39 PM

When I change a monster's speed using BM:S I can make it so they can go anywhere (speed 50) on the battlefield. However, the shaded region of where they can walk to remains their old speed before it was altered, even though their new speed allows them to walk anywhere. The problem is only with the shaded region, and BU:R seems to do nothing to help.

Where is appropriate to redraw to make this change or how can I edit it so the shaded region is correct? I've tried redraw in BG0 BG1 CM4 and BR but nothing.

Script:
!?BG1&1000;
!!BG:N?y1;
!!BMy1:F?i;
!!VRi:&2;
!!VRv853&i>0:Sy1;
!!BMy1&i>0:Sd50;
!!VRv854&i>0:S1337;

!?BG1&1000/v854=1337;
!!BG:N?y2;
!!FU&y2=v853:E;
!!BMv853:S?y1;
!!BMv853&y1>50:Sd-50;
!!VRv854:S0;

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


Honorable
Undefeatable Hero
posted July 01, 2012 03:30 PM
Edited by Salamandre at 16:17, 01 Jul 2012.

Try this:


!?FU77007;
!!VRv853:C0/0;
!!SN:X?y1; y1 stack number
!!BMy1:F?i;
!!VRi:&2;
!!BMy1&i>0:Sd50;
!!VRv853&i>0:Sy1;
!!VRv854&i>0:S99;


!?BG0&1000/v854=99;
!!BMv853:Sd-50;


@Edit: never mind, works only visual, not effective :P
I recall Bersy posted a solution for this. It was:

;redraw grid after speed was changed
!!UN:C6919200/4/?y2;
!!SN:E4797616/2/y2/0/1;
!!BU:R;

But: as I see your script gives speed to flying creatures. Why not use in BH trigger at battle start, and forget about BG? It will solve a lot of problems, notably the wait button.

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


Promising
Supreme Hero
posted July 01, 2012 05:55 PM
Edited by Hero_of_Light at 17:55, 01 Jul 2012.

I tried to include this !!if thing on the start of the script:

!#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;
!!FU&y-1<>0|-1:E; //checks for town type
!!if1:; if Castle
!!CA2: B3/19; //if upgraded Training ground is built
!!CA2:D2/2/165/1; //set our creatures' number accordingly
!!en:;
!!CA2:B3/43; //if upgraded Portal of Glory is built
!!CA2:M1/6/d/?i; //get current number of standard creatures
!!CA2:D6/2/169/i; //set our creatures' number accordingly
!!en:;

But apparently I am using it wrong. I need to make the script check for buildings SEPARATELY. That means that even if it doesn't find building 19 it will still check for 43 in this case. Can someone point me to the right direction here?
____________
Not idly do the leaves of Lorien fall.

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


Honorable
Undefeatable Hero
posted July 01, 2012 06:01 PM

Please upload an ERM file with the complete towns growth script, and also plugin, if there is one needed.

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


Promising
Supreme Hero
posted July 01, 2012 06:11 PM

Here is the link. It uses the battery plugin from MoP for third slots. When you open it search for "slots" so that you can find the section of the script in question.

I'll state my problem again so that you understand better what this needs.

When all the buildings in a town are already built then there's no problems at all (that's why I didn't realize this on previous tests). Some buildings have a third (and maybe fourth) slot and in some cases the third slot gives a fixed number of creatures.

This works ok when you build the buildings in the "correct" order as well. For instance, in Castle, if you build upgraded Griffins BEFORE the upgraded Portal of Glory then each third slot works ok. That's because the CHECK for griffin is BEFORE the check of Portal of Glory in the script.

However, if you upgrade portal of Glory first, then the script malfunctions (because the first check for upgraded griffins fails).

So I need this edited so that the checks work separately. I hope you know how and thank you for your interest
____________
Not idly do the leaves of Lorien fall.

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


Honorable
Undefeatable Hero
posted July 01, 2012 08:30 PM

I have no idea how this script works. I replaced 11 wog - neutral town.erm with your script but game will not run. Apparently it depends on other changes, please upload the whole data/s (only scripts, no pcx), and on wikisend, thanks.

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


Promising
Famous Hero
of infamy
posted July 01, 2012 11:30 PM

Quote:
Why not use in BH trigger at battle start, and forget about BG? It will solve a lot of problems, notably the wait button.


This is for the H2 mod so first off, there is no wait button but the main goal was to give flying creatures full movement without having them go first in battle, like initiative. So it can't be battle start based, but creature turn based. Works 100% AFAIK, if anyone wants initiative instead of speed (for fliers here):

!?BG0&1000;      current stack global
!!BG:N?v853;

!?BG1&1000;      add flier full speed
!!BG:N?y1;
!!BMy1:F?i S?y2;
!!VRi:&2;
!!BMy1&y2<50/i>0:Sd50;

!!UN:C6919200/4/?y2;    fix shadow
!!SN:E4797616/2/y2/0/1;
!!BU:R;

!?BG1&1000;   restore speed
!!BG:N?y2;
!!FU&v853=y2:E;
!!BMv853:S?y1;
!!BMv853&y1>50:Sd-50;
!!BMv853:S?y1;
!!BMv853&y1>50:Sd-50;
!!VRv854:S0;

!?BR;   make sure didn't end on a flier
!!FU&v997<1:E;
!!BMv853:S?y1;
!!BMv853&y1>50:Sd-50;

!?BR;  for the very first turn
!!FU&v997<>0:E;
!!VRv4000:S0;
!!BM0:S?v4001;
!!DO1222/1/41/1;

!!BMv4000:F?i;
!!VRi:&2;
!!FU&i<1:E;
!!BMv4000&i>0:Sd50;
!!VRv853:Sv4000;
!!VRv854:S1337;

!?FU1222; find the fastest monster
!!BMx16:S?y1;
!!VRv4000&y1>v4001:Sx16;
!!VRv4001&y1>v4001:Sy1;

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


Honorable
Undefeatable Hero
posted July 02, 2012 12:17 AM

What if slow was cast?

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
[ This thread is 228 pages long: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 (150) 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 ] . . . Next Thread >
Post New Poll Post New Topic Post New Reply

Page compiled in 0.1312 seconds