|
|
mister_kalu
Known Hero
|
posted November 02, 2011 12:26 AM |
|
|
okay, finally I used the Salamander's script but perfected
!?BA0;
!!SS38?v47; get R initial power to resurrection
!!VRv48:Sv47*2; R modifier
!!BA:H0/?v8; [get attacking hero's number]
!!BA:H1/?v9; [get defending hero's number]
!!HEv8:A2/50/?y1/?v45; check for ankh
!!HEv9&v9>-1:A2/148/?y1/?v46; check for ankh
!?BG0;
!!BG:Q?y1; get side
!!SS38&y1=0/v45=1v48; increase R if ankh left side
!!SS38&y1=0/v45=0v47; reset
!!SS38&y1=1/v46=1v48; increase R if ankh right side
!!SS38&y1=1/v46=0v47; reset
!?BA1;
!!VRv47:Sv48:2; R modifier
!!SS38v47; get R final power
thanks it works
|
|
mister_kalu
Known Hero
|
posted November 02, 2011 01:44 AM |
|
|
hello there, i saw recently in sptraits.txt a lot of WOG Spells that never had
(previous version of wog)
these spells are blank spells, and i can use them ? or not? .. and if the answer is yes.. what are those numbers?
|
|
Bersy
Honorable
Supreme Hero
|
posted November 02, 2011 02:31 PM |
|
|
Hi, Jim.
Spell power is kept in [[6919200] + 21460 + 4 * Side].
For left hero:
!!VRy1:S6919200;
!!UN:Cy1/4/?y2;
!!VRy2:+21460;
!!UN:Cy2/4/?y3;
; y3 is spell power
|
|
JimV
Responsible
Supreme Hero
|
posted November 02, 2011 04:38 PM |
|
|
Bersy, thanks for the information. I take it those are the Era 1.9 addresses for battle spell power. I see from your example that the block address can be read directly as a 4-byte value. This is probably true for the WoG 3.58f block address also, but I have noticed that Heroes 3 memory blocks always seem to start at addresses of the form 0xXXXX0000 so I search for the top part (XXXX) and then multiply it by 0x10000. This may get me into trouble some day, but I think one time I found that only the XXXX part was stored and a search for XXXX0000 found nothing. This was probably some mistake on my part though. In the future I will check to see if the address exists in 4-byte form.
As I said, I was surprised to see that changing a Hero's primary skills in battle does not affect the battle, but now that I know this it may actually be convenient for customizing.
If Solitaire345 is listening, this would be more good information to add to his ERM Help document. (Of course he will never be finished if he takes all such suggestions.) I may add the WoG 3.58f addresses to the 3.58 ERM Help, but first I need to look at Solitaire's last revisions and see if they apply to 3.58 also. I am play-testing my maze map, which takes up most of my Heroes time now.
|
|
Bersy
Honorable
Supreme Hero
|
posted November 02, 2011 04:43 PM |
|
|
In fact, it's where the SoD stores data. So the code is for SoD/WoG/TE/Era/...
|
|
JimV
Responsible
Supreme Hero
|
posted November 02, 2011 06:45 PM |
|
|
Bersy, thanks for the clarification. I tried this test:
!!UN:C6919482/2/?v703;
!!VRv703:*65536+343028; side 0 Power (WoG 3.58f)
!!VRv704:Sv703+4; side 1 Power
!!IF:M^My v703=%V703^;
!!UN:C6919200/4/?v703;
!!VRv703:+21460; side 0 Power
!!VRv704:Sv703+4; side 1 Power
!!IF:M^Bersy's v703=%V703^;
and got the same address with both methods, for 3.58f (naturally), so I think now what you are saying is that your method will work for all versions, whereas perhaps my version will only work for WoG 3.58f. So if I add this note to the 3.58f ERM Help I will use your version. Thanks again for your time in researching this.
|
|
Bersy
Honorable
Supreme Hero
|
posted November 02, 2011 08:14 PM |
|
|
Thanks for the work on updating help.
It seems that you've found a dynamic memory address. They can be reproduced on your machine, but will crash the game at others. This note also possibly concerns the previously found addresses. The only way to get real stable addresses is to load exe in debugger and trace control/data flow to find out the structures and pointers.
For instance, to find out the specified spell powers I found particular hero spell power address (ArtMoney can be used), then attached the debugger, put hardware breakpoint on memory access and got the code, where it's used.
Generally there are 5-6 "managers", big static structures with pointers to game dynamic structures. That's why the root is AdventureManager (6919200). 21460 and 21464 are static offsets, where powers are saved.
I would recommend not to put not 100% safe addresses to ERM help. This could save many nerves for future modders.
Here is my custom pack of OllyDebugger and plugins. I dont know if you are famular with assembler (basic commands are not hard, imo), but this tool can simplify the work greatly.
http://www.multiupload.com/A5Q7JKBO55
Also many tutorials can be found in google on assembler and win32 debugging.
|
|
JimV
Responsible
Supreme Hero
|
posted November 02, 2011 10:11 PM |
|
|
Thanks very much for the good advice and for the download.
On my system, the Heroes program always reserves a block of memory that is 0x100000 bytes long (among others), and the side-0 Power is always offset by 0x53BF4 from the start of the block (there are other addresses with battle stack information at different offsets in that same block). The location of this block changes from run to run, but the starting address of this block in memory is always given at 0x69954A, which is within the h3wog.exe memory.
My mental model of this is that the Heroes program (as long as it is the same version as mine) will always ask for the 0x100000 block (not sometimes split it into different blocks) to use for data storage, and will always record the starting address of the block, so that it knows where to find the data. However, to test this hypothesis I will have to find other systems to run the Heroes program on, which I will do, just to satisfy my curiosity. (Prior to seeing your response I had tested my method under Era 1.8 and found that it also worked there - on my machine.)
In any case, I will always use your addresses as the official ones. Thanks again for providing them.
|
|
Bersy
Honorable
Supreme Hero
|
posted November 03, 2011 12:10 PM |
|
Edited by Bersy at 16:42, 03 Nov 2011.
|
Sorry for disturbing, just tested the above-mentioned WoG 3.58f code. Message displays different results on my machine.
|
|
Salamandre
Admirable
Omnipresent Hero
Wog refugee
|
posted November 03, 2011 04:24 PM |
|
Edited by Cepheus at 01:13, 04 Nov 2011.
|
I have a strange issue with moving monsters around when right click on. A few times, they don't move and a red bubble (type 71) appears at destination.
I don't know a fix for this, but I can only delete the red bubble on right-click and continue the game.
____________
Era II mods and utilities
|
|
JimV
Responsible
Supreme Hero
|
posted November 03, 2011 05:54 PM |
|
Edited by JimV at 18:33, 03 Nov 2011.
|
@Bersy: I also found different results on an old, Windows 98 laptop, late last night. So my hypothesis is right out. I have spent this morning so far checking other UN:C addresses that I had researched previously. The one I posted previously for battle-stack town-type was also specific to my Windows 7/32-bit/Dell laptop. I found a better one using your hints and have revised the earlier post, in case anyone reads it.
The better town-type address is [6919200]+21824 - that is, get the contents of memory address 6919200 as a four-byte value and add 21284 to it, and that is the address for stack 0 (add 1352 times the stack number for other stacks).
My address for the GENRL.TXT damage message "The %s does %d damage." also does not work on my W98 laptop, and I have spent several hours so far trying to find a more general one, so far unsuccessfully. It is easy to find a dynamic address which will work on my system, harder to find a general solution - but I will keep looking.
Thanks again for your heads-up on this.
@Salamandre, I have downloaded your file, but the odds are 1000:1 that you or someone else will figure out what is happening before I do, because my priority is to fix UN:C addresses which I have previously posted. Good luck.
Update - I took a break from pointer-scanning and tried the game:
a) It is a nice puzzle.
b) I spent about 15 minutes moving the golems and got one at the center, without ever seeing a red bubble appear. I ran on a WoG 3.58f system with no modifications. Maybe it is some effect of modding? Try it under a plain WoG, if you have one.
|
|
Salamandre
Admirable
Omnipresent Hero
Wog refugee
|
posted November 03, 2011 06:45 PM |
|
|
15 minutes without a single red bubble? I usually get one after 15-20 moves, I run ERA 1.91. After trials it seems that the cell where a previous monster was is not updated enough fast, but can't be sure. Thanks anyway.
I don't have 3.58 and can't install it, the updater refuses wog files, and breaks. Unknown reason.
____________
Era II mods and utilities
|
|
JimV
Responsible
Supreme Hero
|
posted November 03, 2011 07:09 PM |
|
|
I also just now tried under Era 1.8, and then again in plain WoG 3.58f. I can't make a red bubble on my system, it appears. I tried with music off and on. Maybe some other people will try and report.
At first I tried with IF:M statements added to the functions, to see if I could catch the type or subtype changing, but I took those out again after my first trial, and have done the puzzle three more times since.
If I had gotten a bubble, I would have tried adding a delay to the functions, but as we engineers say, if it ain't broke, don't fix it, and it doesn't seem to be broken on my laptop.
|
|
Salamandre
Admirable
Omnipresent Hero
Wog refugee
|
posted November 03, 2011 07:13 PM |
|
|
Thank you for your time. I tried to add a check inside the function so the function exits if the object clicked is not golems subtype, but then I get error when clicking on plain map instead of red bubble. Dead end, it seems.
____________
Era II mods and utilities
|
|
Bersy
Honorable
Supreme Hero
|
posted November 03, 2011 08:32 PM |
|
|
I managed to reproduce Salamandre's error. Very strange indeed. Some in-game structures simply become corrupted. ERM says that several objects cannot be put via UN:I, also it worths trying the 6-th parameter usage: map update (1).
|
|
JimV
Responsible
Supreme Hero
|
posted November 03, 2011 08:51 PM |
|
Edited by JimV at 20:53, 03 Nov 2011.
|
I still haven't seen it on my system, but maybe it would be less likely to happen if the Golem objects were not deleted and replaced continuously across the map, but only deleted once at the start of a move and replaced once at the end of the move. The intermediate positions can't be seen anyway, at least not on my machine.
Meanwhile I have found what I think is a better address calculation for the string which shows spell damage during a battle ("The %s does %d damage."). (The object was to disable this message when a spell's damage is altered via ERM so that the player is not confused by seeing the original damage in the battle scroll.)
The start of the first message in GENERLTX.TXT is at [[6970820]+44]+43. If GENRLTXT is in English and has not been modified, there is an additional offset of 16487 (16530 total, including the 43) to the start of the damage message. This version works both on my Windows 7 PC and an old Windows 98 PC, under both WoG 3.58f and Era 1.8. I have revised my previous post on this subject (circa page 94) accordingly.
|
|
Salamandre
Admirable
Omnipresent Hero
Wog refugee
|
posted November 03, 2011 09:15 PM |
|
|
The previous occupied cell was keeping the creature subtype, instead of 0, -1 (empty square), therefore if I click on a empty previous occupied cell it gave me 0/xx (xx=moved creature subtype) and asked me to "move it", therefore the red bubble appeared.
Solved by adding !!OBx1/x2/x3:T0 U-1; after moving it, so the previous cell always match empty square. I also tested outside this script and found that when you delete an object, the empty square type is changed to zero, the subtype not, and will produce further errors when manipulating again this cell.
____________
Era II mods and utilities
|
|
JimV
Responsible
Supreme Hero
|
posted November 03, 2011 11:55 PM |
|
Edited by JimV at 02:25, 04 Nov 2011.
|
That is good information which I will add the notes about object placement at the end of the UN page, in my next ERM Help update, thank you.
I only clicked the Golems, not empty squares. Now that I know how to do it, I can make the red bubbles too.
If you change the exit condition from this:
!!FU&v227<>54/v228<>33/v228<>32/v228<>116:E;
to this:
!!FU&v228<>33/v228<>32/v228<>116|v227<>54:E;
then you will not react to 0/xx squares.
For the first statement, all four conditions must be satisfied to exit. For the second, if either all of the first three conditions are true *or* the fourth condition (v227 not 54) is true, then the code will exit. E.g., type/subtype = 0/33 will not exit the first statement (because the second condition is not true), but will exit the second statement (because the last condition is true).
Still, I think it is an excellent idea to "clean up" by setting the subtype to -1 after UN:O. This is easy to do for the Golems because they only set a single square. For an object with several red squares, each location would have to be reset. To test this, add a red square to one of the Golems in the map editor, and display the object parameters for each click:
!?CM0;
!!CM:P?y1/?y2/?y3;
!!OBy1/y2/y3:T?v227 U?v228;
!!UN&v227=71/v228=0:Oy1/y2/y3;
!!IF:M^Loc.=%Y1/%Y2/%Y3, T=%V227, U=%V228^; <--- added
!!FU&v228<>33/v228<>32/v228<>116|v227<>54:E; <--- changed
!!VRz1:S^Golems options^;
!!VRz2:S^Move right^;
!!VRz3:S^Move left^;
!!VRz4:S^Move up^;
!!VRz5:S^Move down^;
!!VRz6:S^Reset golems^;
!!VRz7:S^Exit (no action)^;
!!IF:G1/244/32/1/2/3/4/5/6/7;
!!FU&v244=32:E;
!!CM:R0;
!!FU77&v244=1:Py1/y2/y3/v227/v228;
!!FU78&v244=2:Py1/y2/y3/v227/v228;
!!FU79&v244=4:Py1/y2/y3/v227/v228;
!!FU80&v244=8:Py1/y2/y3/v227/v228;
!!IF&v244=16:M^Not implemented yet^;
**FU81&v244=16:P;
!!CM:R0;
!!FU82:P;
;x1-x3=coordinates, x4= type, x5=subtype
!?FU77;
!!VRy1:Sx1+1;
!!TRy1/x2/x3:T?y2/d/d/d/d/d/d/d;
!!FU&y2<>0:E; exit if no dirt or another object
!!OBy1/x2/x3:T?y4;
!!FU&y4=54:E;
!!UN:Ox1/x2/x3;
!!OBx1/x2/x3:T0 U-1; <-- added (will reset yellow sq loc. but not red sq. loc.)
!!UN:Iy1/x2/x3/x4/x5;
!!FU77:Py1/x2/x3/x4/x5;
...
|
|
Salamandre
Admirable
Omnipresent Hero
Wog refugee
|
posted November 04, 2011 02:08 AM |
|
|
Thanks, I did not know we can mix "or" with "and". For extended cells click, I already saw that Fnord is acting same in 24.erm, for adventure map dwellings. I will stick to one cell objects for now, it looks like calculating all the cells around is quite complicated when you don't know in advance where are the red cells.
____________
Era II mods and utilities
|
|
Bersy
Honorable
Supreme Hero
|
posted November 04, 2011 12:05 PM |
|
|
Great research, guys!
I also found in ERM that only 1000 objects can have custom hints or enabled/disabled settings. Static array, as usual.
|
|
|