|
Thread: Is it possible to fix Dispel Bug? | This thread is pages long: 1 2 · NEXT» |
|
yexian7
Hired Hero
|
posted October 12, 2010 10:45 PM |
|
|
Is it possible to fix Dispel Bug?
If cast Expert Dispel and there's "force field" or "fire wall" in battle field,game crashed.
Remove Obstacle has the same problem.
Is it possible to do something for this?
|
|
yexian7
Hired Hero
|
posted October 16, 2010 01:55 AM |
|
Edited by yexian7 at 01:56, 16 Oct 2010.
|
Never happened in English Version?
|
|
songfx
Adventuring Hero
|
posted October 16, 2010 05:07 PM |
|
|
Indeed, it never happens in English version. But why it happens in Chinese version. It is so annoying.
____________
Chinese WOG Forum
|
|
Salamandre
Admirable
Omnipresent Hero
Wog refugee
|
posted October 16, 2010 05:24 PM |
|
|
|
yexian7
Hired Hero
|
posted October 17, 2010 05:54 AM |
|
|
|
songfx
Adventuring Hero
|
posted October 23, 2010 11:47 AM |
|
Edited by songfx at 11:47, 23 Oct 2010.
|
I am sorry.
I have tested all version in my hands, including english version. Unfortunately, they all crashed after cast force field and dispel.
Anybody can help to make a test about this with your H3 version ?
Test like this,
1.cast spell force field or fire wall
2.cast spell dispel
3.continue the battel for 3-4 rounds.
Does the game crash ?
____________
Chinese WOG Forum
|
|
JimV
Responsible
Supreme Hero
|
posted November 13, 2010 06:51 PM |
|
Edited by JimV at 21:20, 13 Nov 2010.
|
I think almost anything is possible to do in Heroes 3 using ERM, although the result may be clumsy and imperfect. Here is a case in point: an ERM fix for the Dispel/Force Field bug. This bug seems to me to be native to the Heroes III program itself (it happens in H3 without the WoG addon). It appears that after Expert Dispel has disolved a FF, the program continues to count down the two turns for the FF and then crash when the two turns have ocurred since the FF was cast, probably in the act of trying to remove a FF which is no longer there. The instruction address for the crash always (for me) is 0x46641B, so a good coder with access to the source could probably fix it in a few hours. (That address is protected under WoG 3.58 - UN:C has no effect on it.) In lieu of that, here is a clumsy way to fix it with an ERM script:
ZVSE
* Dispel Bug Fix, JHV, Nov., 2010
* replace Force Field-cast with cloud hole obstacles (88)
* remove obstacles if expert Dispel cast or after 2 rounds
* (must cast Remove Obstacle to remove, unfortunately)
* Note: effect of Mages and Silver Pegasi on FF spell cost is not accounted for (sorry)
* uses unclaimed variables v900=v911 & v1984-v1997 during battles
* and temporary variables v1=v7
* and unclaimed functions FU1984-FU1986
!?BA0&1000;
!!VRv1984:S0; no. of active Force Fields
!?BR&1000;
!!VRv1985:Sv997; save round # for other triggers
!!FU1984&v1984>0:P;
!?FU1984; pop FIFO list of FF's
!!VRy1:Sv1984+1985; index to earliest FF end-round
!!FU&vy1>v1985:E;
!!VRy2:Sv1984+1989; index to earliest FF start-hex
!!VRy3:Sv1984+1993; index to earliest FF end-hex
!!FU1985:Pvy2/vy3; remove earliest FF
!!VRv1984:-1;
!!FU1984&v1984>0:P;
!?FU1985; remove FF obstacles
** Attacking hero does Remove Obstacle on battlefield positions x1-x2
!!BH0:N?y2; hero
!!HEy2:I?y3/1; spell points
!!HEy2:Id30/1; add more than enough mana for RO casts
!!BH0:C64/x1/3/0;
!!VRy1:Sx1:17%2; even/odd starting row
!!VRx1:-16-y1;
!!BH0:C64/x1/3/0;
!!BH0&x1>x2:C64/x2/3/0; cast expert Remove Obstacle
!!HEy2:Iy3/1; restore Spell points
!!BH0:M0; renable casting
!?BG0&1000; check for FF and replace with obstacles
!!BG:A?v1 S?v2;
!!FU|v1<>1/v2<>12:E; FF not cast
!!BG:D?v1 Q?v2; get hex and side
!!BHv2:N?v3 M1; get hero, disable casting this round
!!FU&v3<0:E; gotta be a hero to cast, but just in case ...
!!HEv3:S17/?v4; get Earth skill level 0-3 (2,2,3,3 hexes)
!!VRv8:Sv4+2:3*3-12; mana cost w/o Mages or Silver Pegasi
!!HEv3:Idv8/1;
!!VRv4: :2+2; v4=# of FF hexes
!!VRv7:Sv1:17%2; 0-even row, 1-odd row
!!VRv5:Sv4-1*-17+v1; ending hex for 3 hexes or odd starting row
!!VRv5&v4=2/v7=0:+1;
!!VRv6:Sv1985+2; end round
* make room in FIFO lists and add latest FF data
!!VRv900:Cv1986/v1987/v1988/v1989/v1990/v1991/v1992/v1993/v1994/v1995/v1996/v1997;
!!VRv1986:Cv6/v1986/v1987/v1988/v1/v1990/v1991/v1992/v5/v1994/v1995/v1996;
!!VRv1984:+1;
* plot obstacle 88 in lieu of FF
!!BF:O88/v1;
!!VRv1:-16-v7;
!!BF:O88/v1;
!!BF&v1>v5:O88/v5;
!!BG:A0; cancel instead of casting FF
!?BG0&1000/v1984>0; check for Dispel (v2=35) and remove all FF obstacles if so
!!BG:A?v1 S?v2;
!!FU|v1<>1/v2<>35:E; Dispel not cast
!!BG:Q?v2; get side
!!BHv2:N?v3; get hero
!!FU&v3<0:E; gotta be a hero to cast, but just in case ...
!!HEv3:S16/?v4; get Water skill level 0-3
!!FU&v4<3:E; only Expert Dispel removes FF
!!DO1986/1/v1984/1:P;
!?FU1986; remove all FF obstacles, x16=# in FIFO list
!!VRy1:Sx16+1985; index to earliest FF end-round
!!VRy2:Sx16+1989; index to earliest FF start-hex
!!VRy3:Sx16+1993; index to earliest FF end-hex
!!FU1985:Pvy2/vy3; remove earliest FF
!!VRv1984:-1;
I have tested this script and it seems to work okay. A similar fix could probably be done for the Dispel/Fire Wall bug, but that will cost extra. Sorry for the long post. (It is my first one, so probably will be screwed up some way.)
____________
|
|
Salamandre
Admirable
Omnipresent Hero
Wog refugee
|
posted November 13, 2010 07:08 PM |
|
|
Welcome Jim, you can edit your post and disable smileys (red cross on left), it is specially done for ERM codes.
____________
Era II mods and utilities
|
|
JimV
Responsible
Supreme Hero
|
posted November 13, 2010 09:23 PM |
|
|
|
Salamandre
Admirable
Omnipresent Hero
Wog refugee
|
posted November 13, 2010 10:33 PM |
|
|
Quote: The instruction address for the crash always (for me) is 0x46641B, so a good coder with access to the source could probably fix it in a few hours.
Feanor from russian forums is comfortable with those addresses, maybe he can fix this? I never noticed any crash when force field is present, but noticed crashes notably in Alexander map, when AI is casting dispel. In general, WoG AI casts dispel when human creatures are buffed with a lot of boosted specialties ie prayer, haste and fire shield, and sometimes the game just shut up, in a few situations.
I am almost certain that AI will never cast dispel if force field is present, and no creature is buffed. It is a weakness related to original SOD, where you can hide behind the FF a whole battle as long as you don't cast any spell on your creature, without being disturbed.
____________
Era II mods and utilities
|
|
yexian7
Hired Hero
|
posted November 14, 2010 07:10 AM |
|
Edited by yexian7 at 07:12, 14 Nov 2010.
|
JimV,thank you for your help.
This is the ERM i wrote in past days.Fortunately,our ideas are so similar.I hope you try this:)
ZVSE
!?BG;
!!BG:A?y1 S?y2 H?y3;
!!FU|y1<>1/y3=-1:E;
!!FU&y2<>35/y2<>64:E; 35净化 64移除障碍
!!HEy3:S16/?y4;
!!FU&y2=35/y4<3:E;
!!FU&y2=64/y4<2:E;
!!DO24000/1/185/1:P100;
!?FU24000&x1=100;
!!BU:Ox16/?y1;
!!FU&y1<>17/y1<>34/y1<>35:E; 17火墙 35主力盾 34次力盾
!!BF:O88/x16;
!!BM0:C64/x16/3/3/0;
*END
Chinese forum has patch to fix this bug from EXE,but only for Heroes3.1(not for WoG).If you need,i will paste the link.
|
|
JimV
Responsible
Supreme Hero
|
posted November 14, 2010 05:05 PM |
|
|
Yexian7, thank you for your reply and for showing your script, which is very interesting. It seems to me that it works by placing cloud-hole obstacles over the Force Field and then removing them, which causes the FF to become invisible (and it is passible in that state). Also, the Dispel spell does not know it is there either, and does not remove it, so there is no crash. Then two turns after the FF was placed, it flashes back into view briefly and then fades away normally. This is more clever than my script, which was a brute-force method. It was a bit of coincidence that we both chose to use the cloud-hole obstacle, but probably we both thought that obstacle bears some resemblance to a force-field (more than a rock, anyway).
I will remember your technique because it might be useful in some other application also. As it turns out, there was no need for me to post my script (you didn't need any help), but it caused me to learn something.
If there is a patch for the Heroes exe, then I think that should solve the problem for WoG also (if WoG is installed over the patched version of Heroes), but maybe I am missing something there too. I wonder if the Heroes patch solves the other Dispel problem which Salamandre referred to? (It has been some time since I played the excellent "Alexander the Great" map, so I don't recall what the circumstances of that are. While testing my script, I saw the AI cast Dispel several times without causing a crash.)
|
|
songfx
Adventuring Hero
|
posted November 14, 2010 11:26 PM |
|
|
Haha, you are all great.
It seems that the fatal bug has been fixed with ERM method.
The patch for SOD chinese version has no effect to WOG.
Yexian7, congratulations to you, you have done it.
____________
Chinese WOG Forum
|
|
yexian7
Hired Hero
|
posted November 15, 2010 11:24 AM |
|
Edited by yexian7 at 11:28, 15 Nov 2010.
|
Here's the patch http://hotfile.com/dl/82685052/77670c2/Project1.rar.html
Choose your Heroes path,run it.The patch will generate a new exe,use it to play game.
About "Alexander the Great",there are many scripts in the map.If there's a savefile,it will be helpful.
|
|
yexian7
Hired Hero
|
posted November 15, 2010 11:26 AM |
|
Edited by yexian7 at 11:28, 15 Nov 2010.
|
Quote: Haha, you are all great.
It seems that the fatal bug has been fixed with ERM method.
The patch for SOD chinese version has no effect to WOG.
Yexian7, congratulations to you, you have done it.
Thanks!
|
|
JimV
Responsible
Supreme Hero
|
posted November 20, 2010 02:03 AM |
|
|
Here is a very small improvement to Yexian7's excellent script:
ZVSE
* Dispel bug fix by Yexian7, modified by JHV, Nov., 2010
* checks for Dispel or Remove Obstacle,
* puts cloud hole over FF or FW, then removes with cast of RO
!?BG;
!!BG:A?y1 S?y2 H?y3 D?y5;
!!FU|y1<>1/y3=-1:E;
!!FU&y2<>35/y2<>64:E; 35 Dispel 64 Firewall
!!HEy3:S16/?y4;
!!FU&y2=35/y4<3:E;
!!FU&y2=64/y4<2:E;
!!DO24000/1/185/1&y2=35:P100;
!!FU&y2=35:E;
!!BU:Oy5/?y6;
!!FU&y6<>17/y6<>34/y6<>35:E; 17 Firewall, 35 the main shield, 34 force shield
* note action not possible for y6=34-35 & y4=2
!!BF:O88/y5;
!!BM0:C64/y5/3/3/0;
!!FU&y6<>34:E;
* find main shield
!!VRy8:Sy5+16;
!!BU:Oy8/?y9;
!!VRy8&y9<>35:Sy5+17;
!!BU:Oy8/?y9;
!!VRy8&y9<>35:Sy5+34;
!!BF:O88/y8;
!!BM0:C64/y8/3/3/0;
!?FU24000&x1=100;
!!BU:Ox16/?y1;
!!FU&y1<>34/y1<>35:E; 17 Firewall, 35 the main shield, 34 force shield
!!BF:O88/x16;
!!BM0:C64/x16/3/3/0;
The original script eliminates all crashes which are due to casting Dispel or Remove Obstacle on Force Fields or Fire Walls, but it also eliminates FF's and FW's when RO is cast on some other object, such as a natural obstacle. That is, for the original version, some RO actions which would not cause a crash will eliminate all FF's and FW's on a battlefield. Also, if RO is cast on a FF or FW and there are other FF's and/or FW's on the battlefield, all will be eliminated, by the original version, not just the one which would cause the crash. The modified script above will only eliminate those FF's or FW's which would otherwise cause a crash.
Probably in practice there is no real disadvantage to using the original version, so this was only an academic exercise.
|
|
yexian7
Hired Hero
|
posted November 20, 2010 01:51 PM |
|
Edited by yexian7 at 13:57, 20 Nov 2010.
|
Thanks for your academic communication, it's constructive.
A little suggestion:
I think it's better to do this new function on every grid that FF existed.Because you need to refresh the passability, make those grids passable.
|
|
JimV
Responsible
Supreme Hero
|
posted November 20, 2010 05:57 PM |
|
|
Good point, Yexian7!
ZVSE
* Dispel/RO bug fix by Yexian7, modified by JHV, Nov., 2010
* checks for Dispel or Remove Obstacle,
* puts cloud hole over FF or FW, then removes with casts of RO
!?BG;
!!BG:A?y1 S?y2 H?y3 D?y5;
!!FU|y1<>1/y3=-1:E;
!!FU&y2<>35/y2<>64:E; 35 Dispel 64 Firewall
!!HEy3:S16/?y4;
!!FU&y2=35/y4<3:E;
!!FU&y2=64/y4<2:E;
!!DO24000/1/185/1&y2=35:P100;
!!FU&y2=35:E;
!!BU:Oy5/?y6;
!!FU&y6<>17/y6<>34/y6<>35:E; 17 Firewall, 35 the main shield, 34 force shield
* note action not possible for y6=34-35 & y4=2
!!BF&y6=17:O88/y5;
!!BM0&y6=17:C64/y5/3/3/0;
!!FU&y6=17:E;
* find main shield
!!VRy8:Sy5;
!!VRy8&y6=34:Sy5+16;
!!BU:Oy8/?y9;
!!VRy8&y6=34/y9<>35:Sy5+17;
!!BU:Oy8/?y9;
!!VRy8&y6=34/y9<>35:Sy5+34;
!!BF:O88/y8;
!!BM0:C64/y8/3/3/0;
!!VRy9:Sy8-16;
!!BU:Oy9/?y10;
!!VRy9&y10<>34:Sy8-17;
!!BF:O88/y9;
!!BM0:C64/y9/3/3/0;
!!VRy9:Sy8-34;
!!BF:O88/y9;
!!BM0:C64/y9/3/3/0;
!?FU24000&x1=100;
!!BU:Ox16/?y1;
!!FU&y1<>34/y1<>35:E; 17 Firewall, 35 the main shield, 34 force shield
!!BF:O88/x16;
!!BM0:C64/x16/3/3/0;
|
|
yexian7
Hired Hero
|
posted November 21, 2010 03:38 AM |
|
|
Good work
|
|
JimV
Responsible
Supreme Hero
|
posted November 22, 2010 01:40 AM |
|
|
Thanks, Yexian7 - and thanks for your script.
Salamandre, if you happen to see this, when I tried to send you the weapons and spells list, my emails bounced back with this error message:
Remote host said: 554 too many errors detected from your IP
Now the free.fr website says my IP is blocked for 24 hours
I will try again tomorrow (Monday, November 22, 2010). If it still doesn't work, I will look for another email provider. I am sorry for the delay, which I am sure is the fault of my email service.
|
|
|
|