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 ... 92 93 94 95 96 ... 100 150 200 250 300 350 400 407 · «PREV / NEXT»
Aleee
Aleee


Known Hero
posted August 26, 2011 11: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
Salamandre


Admirable
Omnipresent Hero
Wog refugee
posted August 26, 2011 11:04 PM

I learn from! well, at least when there are not obvious errors
____________
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 26, 2011 11: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 05:16 PM
Edited by JimV at 20: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
Salamandre


Admirable
Omnipresent Hero
Wog refugee
posted August 27, 2011 05:46 PM

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.
____________
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 27, 2011 06: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
Salamandre


Admirable
Omnipresent Hero
Wog refugee
posted August 27, 2011 07:05 PM
Edited by Salamandre at 19: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.
____________
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 27, 2011 07: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
Salamandre


Admirable
Omnipresent Hero
Wog refugee
posted August 27, 2011 07:20 PM
Edited by Salamandre at 19: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:

____________
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 27, 2011 07: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
Salamandre


Admirable
Omnipresent Hero
Wog refugee
posted August 27, 2011 07:40 PM
Edited by Salamandre at 19: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
____________
Era II mods and utilities

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


Responsible
Supreme Hero
posted August 27, 2011 07:52 PM
Edited by JimV at 20: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
Salamandre


Admirable
Omnipresent Hero
Wog refugee
posted August 27, 2011 08:17 PM
Edited by Salamandre at 04:08, 28 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.
____________
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 29, 2011 08: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 09: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 10: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
Salamandre


Admirable
Omnipresent Hero
Wog refugee
posted August 29, 2011 10:17 PM
Edited by Salamandre at 00:27, 30 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 #?
____________
Era II mods and utilities

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


Promising
Famous Hero
feanor on DF2.ru
posted August 30, 2011 01:02 AM

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
Salamandre


Admirable
Omnipresent Hero
Wog refugee
posted August 30, 2011 01:16 AM
Edited by Salamandre at 01:19, 30 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?
____________
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 30, 2011 12:25 PM

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
Jump To: « Prev Thread . . . Next Thread » This Popular Thread is 407 pages long: 1 50 ... 92 93 94 95 96 ... 100 150 200 250 300 350 400 407 · «PREV / NEXT»
Post New Poll    Post New Topic    Post New Reply

Page compiled in 0.5953 seconds