Heroes of Might and Magic Community
visiting hero! Register | Today's Posts | Games | Search! | FAQ/Rules | AvatarList | MemberList | Profile

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

LOGIN:     Username:     Password:         [ Register ]
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 thread is 240 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 229 230 231 232 233 234 235 236 237 238 239 240 ]
Aleee
Aleee


Known Hero
posted August 26, 2011 05:02 PM

Quote:
y2>186 or it is script for Heroes I?

Sure. Memory fault. Hope you're not tired yet to be my personal ERM proofreader

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


Honorable
Undefeatable Hero
posted August 26, 2011 05:04 PM

I learn from! well, at least when there are not obvious errors
____________

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


Promising
Famous Hero
of infamy
posted August 26, 2011 05:14 PM

Quote:
I used !!BU:D several times and it worked correctly.
You can check it with a script like this (right mouse click in battle):

!?CM4;
!!CM:F?y1 D?y2;
!!FU&y1<>0|y2>186:E;
!!BU:Dy2/?y3;
!!IF:M^Type:  %Y3^;





Lol yes now if only I wasn't so bad at coding... I was doing !!BUv123:D/?y1 which didn't give an error but obviously, wrong. Thanks.

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


Responsible
Supreme Hero
posted August 27, 2011 11:16 AM
Edited by JimV at 15:36, 03 Nov 2011.

The issue of changing a spell's damage but then getting the wrong damage shown in the Battle Scroll came up previously.  In my map "The Swords of Night and Day" the High Mages cast Chain Lightning, and I have scripted it to do 600 damage to each troop it hits (except for Golem resistance and Air Elemental effects, but these do not apply in the map).  However, I get a Battle Scroll message "The Chain Lightning does 220 damage."  This didn't bother me enough to fix it, but since the issue came up here I decided to investigate it, and found a fix.  The fix works for WoG 3.58, for ERA 1.8 installed after WoG, and for WoG+ERA 1.8 installed together - which are the three versions I have.  I don't know if it will work for the latest WoG+ERA package, but it could be made to.

Background:  the "The Chain Lightning does 220 damage" message comes from GENRLTXT.TXT in h3bitmap.lod, in the form "The %s does %d damage".  All of h3bitmap.lod (and maybe some other stuff too) gets loaded into a block of memory when Heroes III starts.  The location of this block can change from run to run.  I found a pointer to the first string of GENRLTXT ("Can't add a manager!"), and the offset from that string to the damage string - note, this assumes GENRLTXT.txt has not been customized and is in English.  Otherwise a different offset will be necessary.

Once the string is found in RAM, changing the first two bytes of the string to 20h 00h (blank character, string terminator) removes the message.  Changing them back to "Th" restores the message (which is also used whenever one stack hits another, e.g. "The Megathon does 4197 damage").

This script finds the damage string:

ZVSE

* SND_DamAdrs, JHV, August 27, 2011

* Find the address of "The %s does %d damage." battle scroll message from GENRLTXT.TXT
* Works for:  WoG 3.58f - Era 1.8 - WoG 3.58f+Era 1.8

* uses v30 to save address of string

!?PI;
!!UN:V?v1/?v2;
!!UN:C6970820/4/?v2; read address at 6A5DC4
!!VRv2:+44; 2Ch offset 0
!!UN:Cv2/4/?v30;
!!VRv30:+16530; offset 1 to first string of GENRLTXT, plus offset to damage string
!!UN:Cv30/2/?v4; first two bytes "Th" = 54 68 = 6854h = 26708
!!IF&v4<>26708:M^Error - GENRLTXT message not found - results unpredictable.^;

!?GM0;
!!UN:C6970820/4/?v2; read address at 6A5DC4
!!VRv2:+44; 2Ch offset 0
!!UN:Cv2/4/?v30;
!!VRv30:+16530; offset 1 to first string of GENRLTXT, plus offset to damage string
!!UN:Cv30/2/?v4; first two bytes "Th" = 54 68 = 6854h = 26708
!!IF&v4<>26708:M^Error - GENRLTXT message not found - results unpredictable.^;

The Chain Lightning is handled by this excerpt from the SND_Battles script:

!?MR1; spell damage/resistance trigger, final
!!MR:M?v1 S?v2; monster type, spell #
!!FU&v2<>19:E; exit if not Chain L
!!MR:F600; [D600--no effect on battle message, try MR0--D600 has no effect there too]
!!VRz10:S^The High Mage spell does 600 damage to the enemy.^;
!!BU:Mz10;
* eliminate message "The %s does %d damage." ("The Chain Lightning does 220")
!!UN:Cv30/2/8192; replace "Th" = 54 68 = 26708 with " " = 20 00 = 8192

!?BG1&1000;
!!UN:Cv30/2/26708; restore "Th"

Note:  the Chain Lightning effect is of course tailored to the characteristics of this map.  (Only High Mages cast the spell, Heroes do not, etc.)  Other conditional tests would be required to implement this effect in a different map.


"The Swords of Night and Day" is available at the ByteBandit/Pol Yahoo Groups WoG Archive:

http://games.groups.yahoo.com/group/wakeofgodsmaparchive/files/WoG%20Maps%20T%20-%20Z/

(Free registration required.)

Update, Nov. 3, 2011 - revised the address calculation for a new method which tests okay on both a Windows 7 PC and an old Windows 98 PC.  Also, the same address no works for WoG 3.58f and Era 1.8.

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


Honorable
Undefeatable Hero
posted August 27, 2011 11:46 AM

This will be certainly be very useful in all situations when we need to blank some string from txt files. Probably the hardest thing remaining is finding the offset for each.
____________

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


Promising
Supreme Hero
posted August 27, 2011 12:35 PM

@JimV

I don't think that the message was the biggest issue on the chain Lightning thing. The problem was that it didn't work properly.

If you could help me on doing it right i would really appreciate it. I don't care about the message really. I just wanted to make Silver Pegasi to cast Chain Lightning after attack with a starting damage of 10 per Silver Pegasi.

If you can do this, please help. Again, the message is not important and i don't want to bother you with it at all.
____________
Not idly do the leaves of Lorien fall.

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


Honorable
Undefeatable Hero
posted August 27, 2011 01:05 PM
Edited by Salamandre at 13:12, 27 Aug 2011.

It could be done properly with EA abilities, but you wanted without. Therefore was a visual glitch if BM#:C used within !?BG1 section.

Also the right damage display is a very important issue for good players. You can't manage a battle if the damage you do <> the damage you see displayed. Myself I would not continue to play under those conditions.
____________

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


Promising
Supreme Hero
posted August 27, 2011 01:12 PM

Well, if it can be made right through ERA commmands then i have no problem but as i said there were other problems as well (besides the animation problem there was the damage dealt problem as well).

I actually got to terms with the fact that plain WOG is dead and if it can work with ERA then it's ok. If you can also make it 20% change to be cast (like Thinderbirds) that would be awesome too.
____________
Not idly do the leaves of Lorien fall.

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


Honorable
Undefeatable Hero
posted August 27, 2011 01:20 PM
Edited by Salamandre at 13:37, 27 Aug 2011.

WoG 3.58 is not dead, but it has no more support while ERA has. WoG 3.58 will still work for a long time, but if you want advanced features, then ERA can do them, and if problems, the author will correct as long he still has the wish to support.

And you still did not try DL, I love it because you are no more constraint by regular boxes/messages, you create your unique game with personal touch.

Specializing in spells:

____________

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


Promising
Supreme Hero
posted August 27, 2011 01:37 PM

You've been aching for an oportunity to share these pics weren't you?

Anyway, I don't know how that DL works and what these pop up windows are all about... If someone could help me then ok. As I said, i can make it work through stack experience already (and also give it a percentage chance of happening) but the only problem is that in that case the damage dealt is always the same (regardless the creature's numbers). If someone can edit the script you posted then fine...
____________
Not idly do the leaves of Lorien fall.

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


Honorable
Undefeatable Hero
posted August 27, 2011 01:40 PM
Edited by Salamandre at 13:45, 27 Aug 2011.

Quote:
You've been aching for an oportunity to share these pics weren't you?


Yes

I've seen better DL's, but they were not mine. This is my very first, my preciousss
____________

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


Responsible
Supreme Hero
posted August 27, 2011 01:52 PM
Edited by JimV at 14:04, 27 Aug 2011.

Thoughts on Pegasi casting Chain Lightning, for what they are worth:

There is an EA command for casting CL after an attack.  I tried it first in my SND_Battles script in "The Swords of Night and Day", but found that it only worked after hitting, not after shooting.  My High Mages are shooters, so I changed it to the form for before an attack, which works for shooters or hitters.  From SND_Battles:

*#EA35:B7/1/97/19/100/100/100/100/100/100/100/100/100/100/100; Chain Lightning after attack--works after hit only
!#EA35:B7/1/112/19/100/100/100/100/100/100/100/100/100/100/100; Chain Lightning before attack

(I left the original command "commented out" as a reminder to myself for the future.)

Since Pegasi are not shooters (unless modified), the after form should work okay for them.  Their creature number, not 35, should be used in the EA command.

The actual damage can be set under the !?MR1 trigger, along with a damage message, as shown in my previous post.  The general steps would be something like this:

1) Under BG0, find the acting stack and the action code (BG receiver).  Get the creature type and number of creatures for the acting stack (see BM receiver).  If the creature type is Silver Pegasus, set a flag (IF:V) which will be used to condition subsequent MR1 triggers.  Calculate (VR) the desired damage based onthe number of Silver Pegasi and save it in a permanent (v) variable.  Note the flag number and v-number must not conflict with any other scripts in the map.  See The List of the Claimed in ERM Help to avoid interferences with the original WoG 3.58f scripts.

2) Under MR1&flag, apply the previously-calculated damage (MR:F), along with a Battle Scroll message (BU:M).  See the previous post for a simplified version - which gives all stacks which are hit by the CL the same damage.  If you want decreasing damage instead, calculate twice the amount of the first damage and divide the damage by two under MR1&flag (!!VRv#: :2;  !!MR:Fv#;).

3) Under BG1&flag, reset the flag to zero.

Disabling and re-enabling the standard damage message could also be done under the MR1 and BG1 triggers, as in the previous post, if desired.

Recommended reading first:  all (100%) of ERM Help, or at least the BG and MR triggers, the sequence of battle triggers, the VR receiver, the BG receiver, the BM receiver, and the IF receiver.

A Note on the ERM Help for the MR receiver.  It says:

------------------------------------------
D$; Basic (without resistance) damage.

Comments:
This may be got or set. Both make sense. If you change this in !?MR0, your value will be used as a basic spell damage for the creature by resistance calculating routine.

Comments:
If you check it in !?MR0, it will be equal to D$ value. Setting this value in !?MR0 makes no sense for this value will be set by resistance calculating routine. Though it is very useful to be set in !?MR1. Using this way you can ignore a default WoG resistance and set your
own value that will be returned as a final damage applied to the creature stack.

F$; Final (corrected) damage.
----------------------------------------------

There is an error here.  The second comment should be under the F$, like this:

-----------------------------------------
D$; Basic (without resistance) damage.

Comments:
This may be got or set. Both make sense. If you change this in !?MR0, your value will be used as a basic spell damage for the creature by resistance calculating routine.

F$; Final (corrected) damage.

Comments:
If you check it in !?MR0, it will be equal to D$ value. Setting this value in !?MR0 makes no sense for this value will be set by resistance calculating routine. Though it is very useful to be set in !?MR1. Using this way you can ignore a default WoG resistance and set your
own value that will be returned as a final damage applied to the creature stack.
----------------------------------------------------
There are some other typographical errors in ERM Help, which someday I would like to correct (after I learn HTML) - but it is 99% accurate.

Note to Salamandre:  a) offsets for any h3bitmap.lod text strings are available on request; b) great DL!

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


Honorable
Undefeatable Hero
posted August 27, 2011 02:17 PM
Edited by Salamandre at 22:08, 27 Aug 2011.

Thanks, I had great examples to learn from.

I am sure a correct ERM help could be released with ERA 1.9, if you can get HTML working. There are many things to change in DL for example, and fix the SP to SS for example, which is big mistake.

Quote:
Anyway, I don't know how that DL works and what these pop up windows are all about...


It is obvious: it allows the player to specialize in spells, by selecting which one he wants to improve. The cost of each upgrade can be doubled or more, and once you got specialized in enough spells, you can unlock a special feature, as casting twice or other.

The DL uses only regular resources from LODs and does not take any additional space, except a tiny txt. file containing the coordinates of items. A feature rarely used until now, I hope it will be more praised, because I have a lot of questions about. The ERM help about DL is very scarce.
____________

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


Promising
Famous Hero
of infamy
posted August 29, 2011 02:33 PM

Is there a way to remove a dead body from the battlefield so it cannot be resurrected or clicked on?

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


Promising
Famous Hero
feanor on DF2.ru
posted August 29, 2011 03:09 PM

Add flag 4194304

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


Promising
Famous Hero
of infamy
posted August 29, 2011 04:00 PM

Quote:
Add flag 4194304


With MA:X ? Is that even a bit...? Will do though thanks.

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


Honorable
Undefeatable Hero
posted August 29, 2011 04:17 PM
Edited by Salamandre at 18:27, 29 Aug 2011.

BM:F

You can get it with BU:D, but how to say he was on your side I am curious if can be done. Does the dead stack keep its #?
____________

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


Promising
Famous Hero
feanor on DF2.ru
posted August 29, 2011 07:02 PM

Quote:
Does the dead stack keep its #?

Yes, all dead stacks keep their ID

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


Honorable
Undefeatable Hero
posted August 29, 2011 07:16 PM
Edited by Salamandre at 19:19, 29 Aug 2011.

Makes sense, speaking about stupid questions. Of course they keep ID, because a resurrected unit needs ID. Sorry.

How resurrect is proceeded when two stacks die on same hex? In ID order?
____________

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


Promising
Supreme Hero
posted August 30, 2011 06:25 AM

I'm pretty sure that when two stacks die in the same place you can't ressurect neither of them. At least that was the case in the original Heroes III. However, if one of your creatures and one of the enemies creatures dies in the same place that's not a problem, since each hero has only one creature on that place and it can be ressurected.
____________
Not idly do the leaves of Lorien fall.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
[ This thread is 240 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 229 230 231 232 233 234 235 236 237 238 239 240 ] . . . Next Thread >
Post New Poll    Post New Topic    Post New Reply

Page compiled in 0.1168 seconds