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: Ambush Tactics script = ack.
Thread: Ambush Tactics script = ack.
Russtops
Russtops

Tavern Dweller
posted April 16, 2006 05:06 AM
Edited by Russtops on 16 Apr 2006

Ambush Tactics script = ack.

I've been having trouble taking Sagamosa's Ambush ability and implanting it into Expert Tactics (for testing, I play "Elbow Room" with Inferno/Ignatius, and Level 5 start)...  At one point, I had it being annoying every time I clicked it.  Now, it just plain refuses to show anything when I go to right-click.  Not that that's a bad thing -- it's better than a hundred errors, but now I don't even have the benefit of a hundred errors to tell me why it's not running.

I know that it's relatively patchwork, and as I'm looking it over, I can see that there's a lot redundancy, but I haven't the foggiest clue as to where to go from here -- I've got a bit of distance on it, but now it's kind of...  lost.

Anyone have any ideas on how to help this script?

Quote:
ZVSE
ERMS_ScriptDate=15.4(April).2006
ERMS_PoweredBy=ERM Scripter v. 2004.10.5.945
_WARNING_#1=IMPORTANT! This file is not in a plain text format. NEVER use any editor except ERM_S for making any kind of changes!
*** Expert Tactics -> Ambush Tactics ***

!?FU4210; [Handle Ambushtactics for Hero x16]
!!HEx16:O?v4210;                   [get hero's owner]
!!HEx16:S19/?v4211;                [get tactics (S19) level (to v4211)]
!!VRv4212&v4211=3:S1;              [if v4211 = 3 (expert), then Set v4212 = 1]
!!VRv4211&v4211<3:E;               [if v4211 < 3, then End Right Now]
!!OW:Iv4210/?y-1;                  [owner v4210; y-1 = 1 if AI/ =0 if Human]

!?CM2;     [Right click trigger for rogue enabling/disabling]
*!UN:P215/?y-1;     [Check if this option was enabled in WOG options]
*!FU&y-1<>1:E;     [Exit if it isn't]

!!IF:W-1;     [w vars refer to current hero]
!!CM:I?y-1 S?y-5;     [Get click location and type]
!!FU&y-5<>14:E;     [Exit if no r-click]
!!FU|y-1<87/y-1>102:E;     [Exit if not on skill Names or skill Levels]
!!VRy-1|y-1=87/y-1=95:S1;     [Translate r-click location to skill number]
!!VRy-1|y-1=88/y-1=96:S2;
!!VRy-1|y-1=89/y-1=97:S3;
!!VRy-1|y-1=90/y-1=98:S4;
!!VRy-1|y-1=91/y-1=99:S5;
!!VRy-1|y-1=92/y-1=100:S6;
!!VRy-1|y-1=93/y-1=101:S7;
!!VRy-1|y-1=94/y-1=102:S8;

!!HE-1:Sy-1/?y-2/1;     [Ask what skill occupies this slot]
!!FU&y-2<>19:E;     [Exit if it isn't tactics]
!!CM:R0;     [Disable standard r-click info]
!!HE-1:S19/?e-3;     [Check for tactics level into e3]

!!VRw131&w131=0:S1; [Default it to ON]
** Ask if we want to enable Ambush Tactics

** Expert Tactics
!!IF&e-3=3/w131=2:Q2/20/62/2/^{Ambush Tactics}

If you have greater tactics than the enemies
encountered, your hero automatically attempts
to use ambush formation against them.

Would you like to utilize Ambush Tactics?^;

!!VRw131&-2:S2;
!!FU&-2:E;
*!!FU&-2&v4213=0:E;     [Exit if "no" answered]

!!IF&e-3=3/w131=1:Q2/20/62/2/^{Ambush Tactics}

If you have greater tactics than the enemies
encountered, your hero automatically attempts
to use ambush formation against them.

Would you like to turn off Ambush Tactics?^;

!!VRw131&-2:S2;
!!FU&-2:E;

** If we haven't exited by now, it means that we're cool with it.
!!VRw131&2:S1;

** End of right click trigger for ambush tactics enabling
-------------------------------------------------------------------------

* AMBUSH - allows the attacking hero to choose the ambush battle position in the coming battle
* (your opponent will be like in dwarven treasury)
* doesn't work in town battles or any other object battles (game would crash)

!?BA0; pre battle trigger
*!UN:P218/?y-1;     [Check if tactics is enabled in WoG options]
*!VRv9011&y-4=1:S0;     [set v var for enabling/disabling Ambush, 0=enabled (default)]
*!FU&y-1<>1:E;     [Exit if it isn't]

!!VRe5:S0; clear
!!BA:H0/?f; //attacker in vf
!!HEf:B0/?z-1; hero name
!!IF&f>=0:Wf;
!!BA&w4213=1:P?e1/?e2/?e3; where is battle
!!OBe1/e2/e3&w131=1:T?e4 U?e6; type / subtype of object
!!CAe1/e2/e3&w131=1:U?e8; is there town on this squre (if hero in town, its considered hero fight, don't allow ambush (game crashes)

!!BA:H1/?g; //defender hero in vg
!!IF&f>=0:Wf; attacker w vars
!!VRe5&g>=0/w131=1/e4<>98/e8=0:S98; if 2 hero fight, allow ambush (except for towns)

!!VRe5&e4=54/w131=1:S98;  if monster fight, allow ambush

!!BA:H0/?y-1;     [get attacking hero number]
!!BA:H1/?y-2;     [get defending hero number]
!!HEy-1:S19/?e35;     [get attackers tactics]
!!HEy-2&y-2>=0:S19/?e36;     [get defenders tactics - if any]
!!FU&e35=e36:E;     [Exit if equal tactics level (3)]

!!IF&w131=1/e5=98:V481/1;

!?BA0&481; ** Pre-battle trigger only triggers when FLAG 481 is TRUE

!!HEf:S19/?v4214;  **Check hero's current Tactic skill
!!HEf&v4214>0:R4/0;  **If hero has Tactics, disable it for the battle

!!HEf:C0/0/d/?y1; any monsters in stack 0
!!VRv10:S0;
!!VRv10&y1>0:+1;
!!HEf:C0/1/d/?y1; any monsters in stack 1
!!VRv10&y1>0:+1;
!!HEf:C0/2/d/?y1; any monsters in stack 2
!!VRv10&y1>0:+1;
!!HEf:C0/3/d/?y1; any monsters in stack 3
!!VRv10&y1>0:+1;
!!HEf:C0/4/d/?y1; any monsters in stack 4
!!VRv10&y1>0:+1;
!!HEf:C0/5/d/?y1; any monsters in stack 5
!!VRv10&y1>0:+1;
!!HEf:C0/6/d/?y1; any monsters in stack 6
!!VRv10&y1>0:+1;
--------------------------------------------------------------------------------
** prepare ambush position


!?BF&481/v10>2;
*war machines leave on the same spots for both players  / commanders don't move at all
*defender move first to clear battlefield for ambush shuffle

!!BF:C; clear battlefield (no obstacles)
!!BM21:B?v1 T?v2;        enemy 1st stack
!!BM21&v1>0/v2>=0:P94;
!!BM22:B?v1 T?v2;
!!BM22&v1>0/v2>=0:P97;
!!BM23:B?v1 T?v2;
g!!BM23&v1>0/v2>=0:P91;
!!BM24:B?v1 T?v2;
!!BM24&v1>0/v2>=0:P62;
!!BM25:B?v1 T?v2;
!!BM25&v1>0/v2>=0:P130;
!!BM26:B?v1 T?v2;
!!BM26&v1>0/v2>=0:P58;
!!BM27:B?v1 T?v2;
!!BM27&v1>0/v2>=0:P126;


*ambushing hero
*(set diffeent formation types for different number of attacker's stacks)
*if 3 stacks -  close formation
!!BM0:T?v2; creature type  (neglect commanders)
!!BM0&v10=3/v2<174/v2<>160/v2<>161/v2<162/v2<>163/v2<>145/v2<>146/v2<>147/v2<>148/v2<>149:P20;   1 stack positioning   (stays on the same spot!)
!!BM1:T?v2; creature type
!!BM1&v10=3/v2<174/v2<>160/v2<>161/v2<162/v2<>163/v2<>145/v2<>146/v2<>147/v2<>148/v2<>149:P31;   2 (upper right)
!!BM2:T?v2; creature type
!!BM2&v10=3/v2<174/v2<>160/v2<>161/v2<162/v2<>163/v2<>145/v2<>146/v2<>147/v2<>148/v2<>149:P156;  3 low left

*if 4 stacks -  loose formation  a bit
!!BM0:T?v2; creature type
!!BM0&v10=4/v2<174/v2<>160/v2<>161/v2<162/v2<>163/v2<>145/v2<>146/v2<>147/v2<>148/v2<>149:P2;   1 stack positioning   (stays on the same spot!)
!!BM1:T?v2; creature type
!!BM1&v10=4/v2<174/v2<>160/v2<>161/v2<162/v2<>163/v2<>145/v2<>146/v2<>147/v2<>148/v2<>149:P14;   2 (upper right)
!!BM2:T?v2; creature type
!!BM2&v10=4/v2<174/v2<>160/v2<>161/v2<162/v2<>163/v2<>145/v2<>146/v2<>147/v2<>148/v2<>149:P172;  3 low left
!!BM3:T?v2; creature type
!!BM3&v10=4/v2<174/v2<>160/v2<>161/v2<162/v2<>163/v2<>145/v2<>146/v2<>147/v2<>148/v2<>149:P184;  4 low right
*if 5 stacks -  loose formation
!!BM0:T?v2; creature type
!!BM0&v10=5/v2<174/v2<>160/v2<>161/v2<162/v2<>163/v2<>145/v2<>146/v2<>147/v2<>148/v2<>149:P2;   1 stack positioning   (stays on the same spot!)
!!BM1:T?v2; creature type
!!BM1&v10=5/v2<174/v2<>160/v2<>161/v2<162/v2<>163/v2<>145/v2<>146/v2<>147/v2<>148/v2<>149:P14;   2 (upper right)
!!BM2:T?v2; creature type
!!BM2&v10=5/v2<174/v2<>160/v2<>161/v2<162/v2<>163/v2<>145/v2<>146/v2<>147/v2<>148/v2<>149:P172;  3 low left
!!BM3:T?v2; creature type
!!BM3&v10=5/v2<174/v2<>160/v2<>161/v2<162/v2<>163/v2<>145/v2<>146/v2<>147/v2<>148/v2<>149:P184;  4 low right
!!BM4:T?v2; creature type
!!BM4&v10=5/v2<174/v2<>160/v2<>161/v2<162/v2<>163/v2<>145/v2<>146/v2<>147/v2<>148/v2<>149:P8;  5 upper middle
*if 6 stacks -  loose formation
!!BM0:T?v2; creature type
!!BM0&v10=6/v2<174/v2<>160/v2<>161/v2<162/v2<>163/v2<>145/v2<>146/v2<>147/v2<>148/v2<>149:P2;   1 stack positioning   (stays on the same spot!)
!!BM1:T?v2; creature type
!!BM1&v10=6/v2<174/v2<>160/v2<>161/v2<162/v2<>163/v2<>145/v2<>146/v2<>147/v2<>148/v2<>149:P14;   2 (upper right)
!!BM2:T?v2; creature type
!!BM2&v10=6/v2<174/v2<>160/v2<>161/v2<162/v2<>163/v2<>145/v2<>146/v2<>147/v2<>148/v2<>149:P172;  3 low left
!!BM3:T?v2; creature type
!!BM3&v10=6/v2<174/v2<>160/v2<>161/v2<162/v2<>163/v2<>145/v2<>146/v2<>147/v2<>148/v2<>149:P184;  4 low right
!!BM4:T?v2; creature type
!!BM4&v10=6/v2<174/v2<>160/v2<>161/v2<162/v2<>163/v2<>145/v2<>146/v2<>147/v2<>148/v2<>149:P8;  5 upper middle
!!BM5:T?v2; creature type
!!BM5&v10=6/v2<174/v2<>160/v2<>161/v2<162/v2<>163/v2<>145/v2<>146/v2<>147/v2<>148/v2<>149:P178;  6 lower middle
*if 7 stacks -  loose
!!BM0:T?v2; creature type
!!BM0&v10=7/v2<174/v2<>160/v2<>161/v2<162/v2<>163/v2<>145/v2<>146/v2<>147/v2<>148/v2<>149:P2;   1 stack positioning   (stays on the same spot!)
!!BM1:T?v2; creature type
!!BM1&v10=7/v2<174/v2<>160/v2<>161/v2<162/v2<>163/v2<>145/v2<>146/v2<>147/v2<>148/v2<>149:P14;   2 (upper right)
!!BM2:T?v2; creature type
!!BM2&v10=7/v2<174/v2<>160/v2<>161/v2<162/v2<>163/v2<>145/v2<>146/v2<>147/v2<>148/v2<>149:P172;  3 low left
!!BM3:T?v2; creature type
!!BM3&v10=7/v2<174/v2<>160/v2<>161/v2<162/v2<>163/v2<>145/v2<>146/v2<>147/v2<>148/v2<>149:P184;  4 low right
!!BM4:T?v2; creature type
!!BM4&v10=7/v2<174/v2<>160/v2<>161/v2<162/v2<>163/v2<>145/v2<>146/v2<>147/v2<>148/v2<>149:P8;  5 upper middle
!!BM5:T?v2; creature type
!!BM5&v10=7/v2<174/v2<>160/v2<>161/v2<162/v2<>163/v2<>145/v2<>146/v2<>147/v2<>148/v2<>149:P178;  6 lower middle
!!BM6:T?v2; creature type
!!BM6&v10=7/v2<174/v2<>160/v2<>161/v2<162/v2<>163/v2<>145/v2<>146/v2<>147/v2<>148/v2<>149:P66;  7 middle right
** end of pre-battle trigger
--------------------------------------------------------------------------------
**Post-battle trigger
!?BA1&481; **Do the following while FLAG 4214 is still TRUE

!!HEf&v4214>0:R4/-1;
**If hero had Tactics before the battle, now give it back

!!IF:481/0; **Now set FLAG 4214 to FALSE because battle is over

-------------------------------------------------------------------------------


____________

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


Hired Hero
Grove Project
posted April 17, 2006 07:01 AM

You say about Sagamosa...
There is a lot of time that I didn't listen anything about his scripts...
Where is he??? It would be very good, if his script will be compatible with Wog before the Wog 3.59 or with Wog 3.59...

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

Tavern Dweller
posted April 17, 2006 07:32 AM

Quote:
You say about Sagamosa...
There is a lot of time that I didn't listen anything about his scripts...
Where is he??? It would be very good, if his script will be compatible with Wog before the Wog 3.59 or with Wog 3.59...



I'm pretty sure I thought that he was working with them, but I'm not sure -- it would be nice to see at least some of his programming make it into 3.59.
____________

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


Promising
Famous Hero
posted April 17, 2006 08:58 AM
Edited by Fnord on 17 Apr 2006

Quote:
Quote:
You say about Sagamosa...
There is a lot of time that I didn't listen anything about his scripts...
Where is he??? It would be very good, if his script will be compatible with Wog before the Wog 3.59 or with Wog 3.59...



I'm pretty sure I thought that he was working with them, but I'm not sure -- it would be nice to see at least some of his programming make it into 3.59.


We did invite him to the WoG Team shortly after 3.58f came out (if I recall) and he accepted and joined. He also sent a test map and stuff at that time but I think that was middle of 2004.

He's been very quiet since then and hasn't made any posts in the last year so I don't know if he's even still around or if he's interested in integrating his scripts for 3.59.

I can probably find an old email for him and I'll see if I can get a reply.


____________

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Jump To: « Prev Thread . . . Next Thread »
Post New Poll    Post New Topic    Post New Reply

Page compiled in 0.0612 seconds