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: Is it possible to fix Dispel Bug?
Thread: Is it possible to fix Dispel Bug? This thread is 2 pages long: 1 2 · «PREV
Salamandre
Salamandre


Admirable
Omnipresent Hero
Wog refugee
posted November 22, 2010 03:41 AM
Edited by Salamandre at 03:45, 22 Nov 2010.

Thanks JimV, strange indeed. Time ago any email I sent to you returned asap if any http link was inside. But then was fixed. Let's hope.

(Maybe there were too many spells and my provider got overloaded?)

...

Kidding.
____________
Era II mods and utilities

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


Hired Hero
posted November 24, 2010 04:20 AM

A hint for JimV: I forgot the special terrain type-Magic Plains/Lucid Pools

I think it's easy for you(BU:G),my negligence: )

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


Responsible
Supreme Hero
posted November 24, 2010 05:13 AM
Edited by JimV at 05:15, 24 Nov 2010.

Another good point, Yexian7.  I forgot about that too.  Here is a version with special terrain accounted for:

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
!!BU:G?y7; terrain type, 1=MP, 6=LP
!!HEy3:S16/?y4;
!!FU&y2=35/y4<3/y7<>1/y7<>6:E;
!!FU&y2=64/y4<2/y7<>1/y7<>6: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;

As you know, but others may not, the ERM Help has the terrain codes for Magic Plains and Cursed Ground switched in its table (at least the original version of ERM Help which came from the WoG site; there are some other typos in the Help document which I would like to correct some day).  That is, in Format BI Magic Plains is listed as code 2 but 1 is correct.

I noticed something interesting when I tested this time.  If I cast a Force Field and the enemy Hero casts Dispel in the same round, then if I cast FF again in the next round at the same location, it disappears one round later, when the original FF would have disappeared.  Not only that, but if I cast FF again at that location in the third round, it disappears in the fourth round, and so on, until I run out of spell points.

This is certainly better than a crash, but not quite as good as having a FF which lasts two rounds (since the original location of the FF is probably a strategic location).  My original method of replacing FF's with cloud-hole obstacles would retain the two rounds, but would make the script even longer (and clumsier).

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


Hired Hero
posted November 24, 2010 08:42 AM
Edited by yexian7 at 08:42, 24 Nov 2010.

Yes,FF's original location is key location,hardcode is counting rounds to refresh Battlefield.

Leave the remaining work to time.Trees will grow slowly and script will be better

Day by day

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


Responsible
Supreme Hero
posted November 24, 2010 07:04 PM

Sorry for another long post.  This should be my last one, unless Yexian7 comes up with another new idea.  I will put all my comments in front, followed by a long script, composed of my original script with Yexian7's more elegant script added on.  The first part of the script turns Force Fields into cloud-hole obstacles, and removes them after two rounds.  It also removes cloud-hole-simulated-FF's if Expert Dispel is cast.  Then Yexian7's script checks for Expert Dispel or Advanced/Expert Remove Obstacle, and eliminates any (actual) FF's or Firewalls if either of these spells is cast.

Limitations (compared to how a bug-free version of Heroes should work):  the simulated FF spell does not reduce or increase the mana cost of the spell if Arch Mages or Silver Pegasi are present; and a Firewall cast in the next round and the same location as one which has just been cast and immediately Dispelled will only last one round.

ZVSE
* Dispel Bug Fix, JHV/Yexian7, 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 v884=v895 & 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)
!!BU:G?y7; terrain type, 1=MP, 8=RL
!!VRv4|y7=1/y7=8:S3;
!!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
!!VRv884:Cv1986/v1987/v1988/v1989/v1990/v1991/v1992/v1993/v1994/v1995/v1996/v1997;
!!VRv1986:Cv6/v884/v885/v886/v1/v888/v889/v890/v5/v892/v893/v894;
!!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
!!BU:G?y7; terrain type, 1=MP, 6=LP
!!FU&v4<3/y7<>1/y7<>6: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;

* 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

!?BG0;
!!BG:A?y1 S?y2 H?y3 D?y5;
!!FU|y1<>1/y3=-1:E;
!!FU&y2<>35/y2<>64:E; 35 Dispel – 64 Remove Obstacle
!!BU:G?y7; terrain type, 1=MP, 6=LP
!!HEy3:S16/?y4;
!!FU&y2=35/y4<3/y7<>1/y7<>6:E;
!!FU&y2=64/y4<2/y7<>1/y7<>6: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<>17/y1<>34/y1<>35:E; 17 Firewall, 35 the main shield, 34 force shield

!!BF:O88/x16;
!!BM0:C64/x16/3/3/0;

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


Hired Hero
posted November 25, 2010 01:24 AM

Script is one way,Hardcode is another way.

Perhaps someday this bug will be fixed from a better way.

So just keep on learning、trying and enjoy the game

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Jump To: « Prev Thread . . . Next Thread » This thread is 2 pages long: 1 2 · «PREV
Post New Poll    Post New Topic    Post New Reply

Page compiled in 0.0520 seconds