Very simple but *HELL* useful script :))

Official forum of the Wake of Gods mod to Heroes of Might and Magic III.

Moderator: Moderators

LarvaExotech
Leprechaun
Leprechaun
Posts: 28
Joined: 01 Jan 2007

Very simple but *HELL* useful script :))

Postby LarvaExotech » Oct 28 2009, 9:50

Instant battle resolve like in Disciples 2.

How it works?

While in combat, you can click "Auto combat" button and click yes, AI will automatically and quickly resolve battle. You don't see AI battling with your forces, but immediate result of combat (like in quick combat). Though combat is real, script combat works, spells and AI plays from the part you have clicked auto-resolve.

It means, you can for example with Necromancer, put your vampire lords forward while leaving skeletons, zombies and wights behind (on starting positions). and then click instant-resolve and.. tada! battle is won and no losses! and with regular "quick combat" you could lose some wights because AI would fly them on start combat :)

Code: Select all

!?CM4; click on battlefield
!!CM:F?y-1;
!!CM:I?y-2;
!!BA:E?y-3;
!!FU&y-1<>0:E; exit if not 0
!!FU&y-2<>2004:E; exit if not 2004
!!FU&y-3<>0:E; exit if not fighting on this pc (multiplayer battle)
!!IF:Q1^{Resolve Battle}

Do you want to automatically resolve battle?^;
!!CM&-1:R0;
!!FU&-1:E; exit if "no"

!!BA:Q1;


Screenshoots:

Image

Image

Image

I think that it could be EXTREMELY useful when playing online (it would work great in TE edition :D)

User avatar
solitaire345
Peasant
Peasant
Posts: 88
Joined: 16 Jul 2008
Location: Lithuania, Vilnius

Postby solitaire345 » Oct 30 2009, 16:07

so simple and nobody came up to this idea? :D great work ;)

User avatar
Beholder
Scout
Scout
Posts: 150
Joined: 27 Feb 2006
Location: Poland, Kraków
Contact:

Postby Beholder » Oct 31 2009, 13:18

Are you sure it really works? Try giving your hero 100 centaurs, 200 vampires and fight with 2000 centaurs. Are you sure that the AI won't push the centaurs forward?
Beholder

User avatar
solitaire345
Peasant
Peasant
Posts: 88
Joined: 16 Jul 2008
Location: Lithuania, Vilnius

Postby solitaire345 » Nov 1 2009, 9:10

@LarvaExotech: you forgot to turn auto combat off after battle:

Code: Select all

!?BA1; after battle end
!!BA:Q0; turn auto combat off

LarvaExotech
Leprechaun
Leprechaun
Posts: 28
Joined: 01 Jan 2007

Postby LarvaExotech » Nov 1 2009, 12:41

Thanks for correcting :)

Are you sure it really works? Try giving your hero 100 centaurs, 200 vampires and fight with 2000 centaurs. Are you sure that the AI won't push the centaurs forward?


AI will play dumb like always but sometimes circumstances allow you to finsih battle w/o losses. Example

You have 40 skeleton warriors and 8 vampire lords. You are fighting with "Lots" familiars, which are 5 groups of 10 familiars.

A)
If you would play battle manually:
You are pushing vampires forward and attack only with vampires (def with skeletons). Even with one retaliation they will manage to kill all of familiars w/o losing any vampire (resurrection ability).

B)
If you would play with quick combat:
AI is pushing vamps forward and skeletons forward. Few packs of familiars are now able to attack skeletons and of course they will go for it making you lose some skellys. Other familiars are killing themelesves agains vampire.

C)
If you play with my script:
Its start of combat, you are pushing vamps forward and def with skeletons. All of familiars stack are attacking vamps and one is killed with retaliation. Its now turn of vampire, you are attacking second stack of familiars killing them. Familiars are attacking vampires again, one stack is down agains vamp retaliation. Enemy is left with 2 stacks of familiars and its now turn of skeletons. You can click "quick resolve" because even if AI advance with skeletons, familiars wont be able to get them and will be attacking skeletons till the rest of combat. And you have won a battle without loses.

User avatar
Beholder
Scout
Scout
Posts: 150
Joined: 27 Feb 2006
Location: Poland, Kraków
Contact:

Postby Beholder » Nov 3 2009, 14:39

That was exactly my point :) Thanks for pointing that out.
Beholder

LarvaExotech
Leprechaun
Leprechaun
Posts: 28
Joined: 01 Jan 2007

Postby LarvaExotech » Nov 3 2009, 19:06

I'm playing almost everyday with that script, and there are much more examples.

For example if I'm battling with hero that has 50 troggs and 30 harpy hags with 20-49 gnolls then i'm doing it in simple way. I'm entering combat, click "wait" with hags and then auto-resolve combat and beat gnolls without losing harpies. If I would do normal quick battle, then AI wouldnt "wait" with mine harpies but fly them as far as they can making all gnolls stack to hit mine harpies.

Other example is when playing tower+solmyr, sometimes my friend (we are playing hotseat) is entering battle, casting ChainLight on enemies and auto-resolve.

The same goes with Conflux and firebirds. They have very low vitality so even low level stacks can kill one with mass attack. With quick combat AI would fly them and attack first stack, while other stacks would hit me. With my scirpt, I'd enter battle, click WAIT with birds and then let computer end battle for me. Waited firebird would get to move twice (because its fastest) so it could kill two stacks (and 3rd with retaliations).

There are a lot of examples. It also can speed up some tiring battles, when you have only shooters and you are fighting with mass-slowed dendroid guards.. it'd be just time to kill them, but you can click "A"->"Yes" and AI would do the same thing you would (shoot enemies) but it would take 0.5s instead of 5 minutes :))

Iluvatar
Leprechaun
Leprechaun
Posts: 25
Joined: 10 Jan 2006
Location: Poland

Postby Iluvatar » Jun 5 2010, 10:56

Possibly stupid question - how to make this script working?

I've copy&pasted it to ERM Script editor and saved in Data/s as script78.erm (number 1 higher than highest existing), ran the game, went into any battle, pressed the "auto fight" button and... Everything is as it was before :(

And also - is the "patch" from 3rd post needed? If so, at which place of the script shall I append it?

Please answer as it sound really extremely useful, but I couldn't get it working :(

User avatar
Ojcar
Peasant
Peasant
Posts: 66
Joined: 23 May 2010
Location: Spain

Postby Ojcar » Jun 5 2010, 17:00

Such script applied on wog options would be a great adition.

Iluvatar
Leprechaun
Leprechaun
Posts: 25
Joined: 10 Jan 2006
Location: Poland

Postby Iluvatar » Jun 7 2010, 14:20

Sorry to bother... Any hint on using it? I still can't force it to work...

User avatar
Salamandre
Genie
Genie
Posts: 1032
Joined: 13 May 2006
Location: France
Contact:

Postby Salamandre » Jun 7 2010, 15:42

You have to open map editor, open the map you're playing, open events, add event, paste the script inside, put it to trigger on day 672, save, play.



Full script (with ZVSE command)

ZVSE

!?CM4; click on battlefield
!!CM:F?y-1;
!!CM:I?y-2;
!!BA:E?y-3;
!!FU&y-1<>0:E; exit if not 0
!!FU&y-2<>2004:E; exit if not 2004
!!FU&y-3<>0:E; exit if not fighting on this pc (multiplayer battle)
!!IF:Q1^{Resolve Battle}

Do you want to automatically resolve battle?^;
!!CM&-1:R0;
!!FU&-1:E; exit if "no"

!!BA:Q1;


Return to “Wake of Gods”

Who is online

Users browsing this forum: No registered users and 4 guests