HoMM IV - Possible to script spells to cast at start of battle?

Maps and the art of mapmaking.
Khannot
Leprechaun
Leprechaun
Posts: 4
Joined: 05 Aug 2022

HoMM IV - Possible to script spells to cast at start of battle?

Unread postby Khannot » 05 Aug 2022, 17:26

Hi all,

Making a campaign in which the player encounters an overly powerful enemy army, which can be reduced in power if the player completes certain tasks (triggering events on the army). One takes creatures away (no problem), while another grants the player extra creatures to fight them (also shouldn't be a problem). The third is meant to place serious debuffs on the enemy army. Ideally, I would like to a bunch of mass debuffing spells to be cast on them (Curse, Weakness, etc) when the battle begins.

Unfortunately, there isn't such an option under the Encountered tab (or any other). I do recall some other maps containing enemy heroes which came with Guardian Angel or Potions of Immortality pre-cast on them. But after looking at Rakne Fne's Hundred Years' War, all I was able to find was that the enemy hero had the Guardian Angel spell.

Is there any way to pull this off, or should I just think of something else? I notice that heroes can be debuffed and that morale and luck can be reduced (though I also know that script is very buggy). Is that the best that can be done? If it is, what can I do the make the possible debuffs equal in power to the other two options? (They are mutually exclusive, as their availability is tied to the player's choice of advance class)


Context:
The campaign is a historical campaign based on the life of Genghis Khan. The first mission covers his period of exile after his family was cast out of their tribe, hence the lack of troops (or hero power). One of the problems the Mongol and other steppe tribes faced in this period was interference from Chinese empires to the south (primarily of the Jin Dynasty, which they later conquered). In the mission, Temujin (his actual name - this is before he got the title Genghis Khan) encounters a large Jin army which he has to reduce in power by either triggering a landslide to destroy part of their army (Placed Event near rocks triggering Take Creatures script on army), luring a group of Frenzied Gnashers into attacking them (quest hut giving them to him), and poisoning an oasis they are drinking from (the debuffs). Earlier in the map, Temujin will have the chance to select an Advanced Class, with his choice conferring special abilities (dual might classes get Attack and Defence boosts, dual magic classes get spells unlocked automatically and extra mana and speed, mixed might/magic classes get morale and luck boosts). This will also determine how specific quests can be completed (as is the case here).

On a side note, is there a solution to the Decrease Luck/Morale script bug?

User avatar
iLiVeInAbOx05
Equilibris Team
Equilibris Team
Posts: 785
Joined: 21 Jul 2014

Re: HoMM IV - Possible to script spells to cast at start of battle?

Unread postby iLiVeInAbOx05 » 06 Aug 2022, 14:22

Well, you could start by giving the enemy hero certain artifacts that give them buffs, and then if they need to be debuffed based on the player's choice you can debuff the hero by removing those artifacts.

You can also give the hero certain spells based on the player's class, so the hero gets weaker spells if they are supposed to be debuffed.

Just a couple thoughts off the top of my head. Might think of others later :)

Khannot
Leprechaun
Leprechaun
Posts: 4
Joined: 05 Aug 2022

Re: HoMM IV - Possible to script spells to cast at start of battle?

Unread postby Khannot » 08 Aug 2022, 14:19

That's a brilliant idea! Very clever, especially as a way to circumvent morale/luck bugs. I suppose I could give the heroes artifacts like the Sword of the Gods and Adamantine Shield, which boost their creatures, then 'debuff' the creatures by taking those away.

Alternatively, I think I'll set a morale/luck debuff using a placed event (which Iirc doesn't bug) and debuff the heroes' stats and mana (so no spellcasting for them). This will render the spellcaster mostly powerless and allow the tactics hero to be killed off quickly, thereby 'debuffing' the army by removing his bonuses. Might go with the latter as it's a bit more telegraphed and thus easier for the player to see the significance of their actions. Will definitely keep the artifact removal idea in mind though.

Thanks a lot!

User avatar
iLiVeInAbOx05
Equilibris Team
Equilibris Team
Posts: 785
Joined: 21 Jul 2014

Re: HoMM IV - Possible to script spells to cast at start of battle?

Unread postby iLiVeInAbOx05 » 08 Aug 2022, 14:21

No prob, glad I could help!

Khannot
Leprechaun
Leprechaun
Posts: 4
Joined: 05 Aug 2022

Re: HoMM IV - Possible to script spells to cast at start of battle?

Unread postby Khannot » 08 Aug 2022, 14:22

Another question: As a mapmaker, how do you ensure that battles are balanced, especially for different difficulties? Do you just test manually until you get it right, or is there a rough way to gauge whether a fight is winnable (like DnD CR or whatever)?

On my first map, which is mostly hero-based with no mines (thinking of adding some weekly ones) and recruitment only from a few dwellings, I think that fights might be way too easy on lower difficulties and too difficult on higher ones. At least, that's what's happened in the tests I've run.

An additional issue is the balancing between subclasses. I think some subclasses (Demonologist) may have a far easier time than others. Is this likely? Is there any way to fix it?

(Should this be its own topic?)
Last edited by Khannot on 08 Aug 2022, 14:25, edited 1 time in total.

Khannot
Leprechaun
Leprechaun
Posts: 4
Joined: 05 Aug 2022

Re: HoMM IV - Possible to script spells to cast at start of battle?

Unread postby Khannot » 08 Aug 2022, 14:22

iLiVeInAbOx05 wrote: 08 Aug 2022, 14:21 No prob, glad I could help!
:)

Zhulikkulik
Leprechaun
Leprechaun
Posts: 5
Joined: 23 Aug 2024

Re: HoMM IV - Possible to script spells to cast at start of battle?

Unread postby Zhulikkulik » 06 Sep 2024, 06:03

I'm working on my first campaign rn.
You can measure difficulty by getting players gold in the beginning. if(resource amount Gold = 20000) set numeric variable DIFFICULTY to 5 else if (resource amount Gold = 15000) etc. Then use continuous event on creatures to set up number of creatures and debuffs (take away 999 creatures. if DIFFICULTY = 5 give 15 creatures else if... Give 10 creatures ... etc. Just uncheck "only on player's turn" or whatever that checkbox is so that script runs all the time. If you want to allow growth but have control over it, it's a lot more complicated but doable.

Basic starting gold is 20k 15k 10k 5k and 0 for easiest to hardest respectively. Check it before doing anything else.

I don't think there's anything like hommbase for heroes iv, so i guess the only way is to manually test each fight. You can make a debug map where you can set any possible value (skills, items, etc) using huts and just put creatures with script for encountered that lets you choose the amount of enemies (put one creature so it never grows and recursively ask if you want to add a creature)

Equilibris fixes a number of scripts, including combat and also lets you subtract movement points, so you can basically mix moveable and static neutrals, so i suggest to use that if you still don't. But it also includes some balance edits so you need to dig up some info on each change it makes (maybe they're all in pdf/txt/chm file when you install it, i can't remember)

Edit: there is exp calculator if you need it tho. Allows to calculate how much will player gain for killing a given number of given creatures based on difficulty level. I use it because there's no way to get character's exp, only level and also i have some extra exp.sources, but I want to change how much exp needed per level. I just measure everything and keep my own exp count.
But this program is very old and written in Java. So you either need to install jvm, or set up localhost and install cheerpj plugin for your browser to run this app. I just chose second option and pinned that tab so I don't have to manually 127.0.0.1/h4xpc/blablabla.html every time :D


Return to “Mapmaking Guild”

Who is online

Users browsing this forum: No registered users and 0 guests