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 > Library of Enlightenment > Thread: New Spells Plugin, The
Thread: New Spells Plugin, The This thread is 14 pages long: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 · «PREV / NEXT»
AlexSpl
AlexSpl


Responsible
Supreme Hero
posted April 01, 2022 04:54 PM
Edited by AlexSpl at 16:56, 01 Apr 2022.

Here is the latest build with all the necessary assets. Just copy the content of this archive into your C++ projects folder and build the solution. Make sure to set the solution configuration to Release and structures member alignment to 1 byte.

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


Responsible
Supreme Hero
posted April 01, 2022 06:33 PM
Edited by AlexSpl at 18:38, 01 Apr 2022.

In the example above I forgot about initialization of spell parameters before battle.

Initialize them here -

void initSpellParams()
{
  setupSpellMastery();

  for (int side = ATTACKER; side <= DEFENDER; ++side)
  {
     for (int j = 0; j < 21; ++j)
     {
        pCombatManager->stack[side][j].Field<float>(0x4C8) = 1.0f;
        slowSpell[side][j].speedMod = 100;
        fearSpell[side][j].speedMod = 100;
        diseaseSpell[side][j].speedMod = 100;
        ageSpell[side][j].healthMod = 100;
        toughnessSpell[side][j].healthMod = 100;
        explosionSpell[side][j].speedPenalty = false;
        // your initializations
     }
  }
}


More complex spells will need additional coding. For example, you may want to do something at the beginning of every round, or when your army is being hit by specific enemy army or specific spells. I can say that with this plugin you have almost all the possibilities which were available to the original programmers of the game.

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


Known Hero
posted April 02, 2022 06:27 PM

Well i have created something
But i think that my plugin is a train wreck with no survivors

My junk

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


Responsible
Supreme Hero
posted April 02, 2022 06:32 PM

Quote:
Do you need to download more than a few files at a time? No problem! Upgrade to a MediaFire Premium account to gain access to features like Bulk-Download.

How I hate those file sharing services

Have you managed to build your plugin and tested in the game?

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


Known Hero
posted April 02, 2022 07:17 PM

Yes i manage to do it...
but sadly i was forced to unistall visual studio community 2022

Don't know why it was crashing for me;( with pain, but i manage to create my plugin. But i don't have the tools to make anything now;(

I think it has something to do with low space disk.

but nonetheless, here is my
plugin:

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


Responsible
Supreme Hero
posted April 02, 2022 07:30 PM

Install the fastest VS2008 Express Edition. It's small, sufficient for any tasks related to plugins, autonomous and doesn't require an infamous Microsoft account.

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


Responsible
Supreme Hero
posted April 03, 2022 01:40 AM

I added your spell, but there is a problem with transparency -



Also your animation is too short for your sound file.

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


Responsible
Supreme Hero
posted April 03, 2022 03:52 AM
Edited by AlexSpl at 04:09, 03 Apr 2022.

Here is how the Hour of Power case looks like -

case SPELL_HOUR_OF_POWER:
 army->CancelIndividualSpell(SPELL_CURSE);
 army->CancelIndividualSpell(SPELL_BLESS);
 army->CancelIndividualSpell(SPELL_BLOODLUST);
 army->CancelIndividualSpell(SPELL_FORTUNE);
 army->CancelIndividualSpell(SPELL_SLAYER);

 army->active_spell_duration[SPELL_BLESS] = forceCappedDuration[SPELL_HOUR_OF_POWER];
 army->active_spell_duration[SPELL_BLOODLUST] = forceCappedDuration[SPELL_HOUR_OF_POWER];
 army->active_spell_duration[SPELL_FORTUNE] = forceCappedDuration[SPELL_HOUR_OF_POWER];
 army->active_spell_duration[SPELL_SLAYER] = forceCappedDuration[SPELL_HOUR_OF_POWER];

 army->bless_value = o_Spell[SPELL_BLESS].effect[eMasteryExpert];
 army->bloodlast_value = o_Spell[SPELL_BLOODLUST].effect[eMasteryExpert];
 if (hero)
 {
spellSpecialtyEffect = hero->GetHeroSpellBonus(SPELL_BLOODLUST, army->creature.level, eMasteryExpert);
army->bloodlast_value += spellSpecialtyEffect;
 }

 army->Field<int>(0x484) = o_Spell[SPELL_FORTUNE].effect[eMasteryExpert];
 if (hero)
 {
spellSpecialtyEffect = hero->GetHeroSpellBonus(SPELL_FORTUNE, army->creature.level, eMasteryExpert);
army->Field<int>(0x484) += spellSpecialtyEffect;
 }

 army->Field<int>(0x48C) = o_Spell[SPELL_SLAYER].effect[eMasteryExpert];

 {
float healthMul = army->healthMul();
int hourOfPowerHealthMod = o_Spell[SPELL_HOUR_OF_POWER].effect[schoolLevel];
hourOfPowerSpell[army->side][army->index_on_side].healthMod = hourOfPowerHealthMod;

double fullHealth = (double)army->full_hp * healthMul * hourOfPowerHealthMod / 100.0;

if (army->active_spell_duration[SPELL_AGE])
fullHealth *= ageSpell[army->side][army->index_on_side].healthMod / 100.0;

if (army->active_spell_duration[SPELL_TOUGHNESS])
fullHealth *= toughnessSpell[army->side][army->index_on_side].healthMod / 100.0;

int health = (int)(fullHealth + 0.95);

army->creature.hit_points = health;

if (health - 1 < army->lost_hp)
army->lost_hp = health - 1;
 }

 break;


I'm ready to release it for testing, but I need at least a fixed picture for the spell book.

It's indeed a unique spell because of the idea of augmenting several spells power into one. I tried to get rid of any potential mess that this spell could induce, but I need you as a tester.

Also I recommend to use AI algorithms to smoothen your pictures. You may see the difference on the example of downscaling the Age spell's picture.

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


Known Hero
posted April 03, 2022 02:16 PM
Edited by Szaman at 14:17, 03 Apr 2022.

Quote:
...but there is a problem with transparency.

That's strange... in ERA it works OK.. but will check it now.

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


Responsible
Supreme Hero
posted April 03, 2022 02:22 PM

Try to use an editor that doesn't change the original palette. Other pictures of yours are OK. Only this one has such a problem.

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


Responsible
Supreme Hero
posted April 03, 2022 03:35 PM
Edited by AlexSpl at 15:51, 03 Apr 2022.

I've rewritten the case for the Hour of Power after analyzing the side effects this spell could introduce.

The main questions are:

1) when your army is already under any of the following spells: Bless, Curse, Fortune, Misforture, Bloodlust, Slayer, what to do with them?

2) when you try to cast one of the above mentioned spells at unit under Hour of Power, how to handle such situations?

3) what to do with coloring, representing effects your army is currently under?

So, I decided to separate Bless, Fortune, Bloodlust, and Slayer components of the Hour of Power spell, so you could freely cast them later. Really blending those effects into one requires much more coding and introduces misunderstandings of what spells really affect your army at the current moment and what are their durations. The icon of the Hour of Power Spell represents now its core effect - 50% health increase.


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


Known Hero
posted April 04, 2022 12:45 AM
Edited by Szaman at 00:48, 04 Apr 2022.

AlexSpl said:
Try to use an editor that doesn't change the original palette. Other pictures of yours are OK. Only this one has such a problem.


Here you go
Sorry for my absence all day. Had a busy sunday, but here it is.

Hour of power Icon

Quote:
1) when your army is already under any of the following spells: Bless, Curse, Fortune, Misforture, Bloodlust, Slayer, what to do with them?


It is possible to "shutdown" those spells (Bless, Fortune,bloodlust and slayer), when Power of Hour is enabled? They just do nothing when this spell is active.

Now Curse, and Misfortune... hmm.. in normal conditions they are just overwritten by their counterparts.. Making immune to Curse and misfortune when HoP is on would make this spell way too overpowered... so let's compromise it.

When someone cast curse or misfortune on a unit with hour of power. The spell hour of power vanish.

Quote:
2) when you try to cast one of the above mentioned spells at unit under Hour of Power, how to handle such situations?



They do nothing, except curse and misfortune which disable HoP.

Quote:
3) what to do with coloring, representing effects your army is currently under?


I don't quite understand? you mean the green/red bar when a spell is active on a unit?

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


Responsible
Supreme Hero
posted April 04, 2022 10:58 AM
Edited by AlexSpl at 16:06, 04 Apr 2022.

Quote:
It is possible to "shutdown" those spells (Bless, Fortune,bloodlust and slayer), when Power of Hour is enabled?

It's possible to give temporary immunity to those spells for units under the Hour of Power, though it's not so easy to implement this.

Quote:
They just do nothing when this spell is active.

By casting them you can prolong their duration, if you want.

Quote:
When someone cast curse or misfortune on a unit with hour of power. The spell hour of power vanish.

This would be illogical, but it's also possible.

Quote:
I don't quite understand? you mean the green/red bar when a spell is active on a unit?

Every positive effect shifts the bar color to green, every negative one - to red. Now the Hour of Power is a composite spell with 5 different effects. Should it be considered as a spell just with one effect like Bless, for example? If so, it will require much more coding, while at the very nature the Hour of Power spell will stay composite, and will feel composite, too.

"Decomposing" it to spell components would solve all the above mentioned problems, not ruining the original spell mechanics. To really blend its effects into one will require a lot of work for not so interesting result (basically, you just cast 5 spells at once: Bless, Bloodlust, Fortune, Slayer and Toughness).

* * *
Well, I've decided to blend these spells into one after looking at the code. It will require ~10 hooks -

Bless: 442416, 4424A9, 4429B4, 442F64, 443480 (?), 492F9F
Bloodlust: 44215A, 43BF8D
Fortune: 43DC9F
Slayer: 44216F


But I have yet another question about spell specialists. Do we consider their bonuses?

* * *
Another thought - why don't your follow the standard pattern for HoMM3 spells in case of the Hour of Power? You don't change its effect, it is the same for Basic/Advanced/Expert Water Magic. It just gets cheaper what's not that exciting for players. Maybe we should think about how to make it less boring?

Btw, now the problem with transparency is gone

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


Responsible
Supreme Hero
posted April 04, 2022 08:34 PM
Edited by AlexSpl at 22:47, 04 Apr 2022.

Done. Needs testing. NewSpells_Szaman

It would be great to add more cadres to the Hour of Power spell animation def, though.

The first bug found by myself. Units under the Hour of Power inflict too much damage. Will check if it's somehow connected with broken Slayer part of the spell.

* * *
It was not what I had thought of There weren't any bugs with Slayer. It's just difference in damage between defending units and not defending units. Still, I fixed bonuses from spell specialists. So, if you'll find something, let me know and I'll try to fix it.

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


Known Hero
posted April 05, 2022 04:24 PM

Sorry for my absence... this week seems "interesting" for me.

Quote:
It's possible to give temporary immunity to those spells for units under the Hour of Power, though it's not so easy to implement this.


I was not thinkg about immunity but rather "doing nothing" just like having Angel Feather Arrows or Bow of Elven Cherrywood with no archery skill, basiclly those artifacts are doing nothing with no archery.

But if "immunity" to those spells is the "only way" to "disable" those spells when HoP is enabled, so be it.

Quote:
By casting them you can prolong their duration, if you want.
No... Hour o Power with itself is a powerful spell, prolonging it's durations would make it "unbalanced".

Quote:
This would be illogical, but it's also possible.


Have to agree, it is illogical, but "compromising". The spell it self is powerful even with one turn with this spell can change the tides of battle (if use good).

Quote:
Every positive effect shifts the bar color to green, every negative one - to red. Now the Hour of Power is a composite spell with 5 different effects. Should it be considered as a spell just with one effect like Bless, for example? If so, it will require much more coding, while at the very nature the Hour of Power spell will stay composite, and will feel composite, too.

"Decomposing" it to spell components would solve all the above mentioned problems, not ruining the original spell mechanics. To really blend its effects into one will require a lot of work for not so interesting result (basically, you just cast 5 spells at once: Bless, Bloodlust, Fortune, Slayer and Toughness).


Never thought of that.. in this part do as you wish, for the best results (in your opinion).

Quote:
But I have yet another question about spell specialists. Do we consider their bonuses?


Spell Specialists? Give a break even your spells don't have hero specialists for them.

Quote:
Another thought - why don't your follow the standard pattern for HoMM3 spells in case of the Hour of Power? You don't change its effect, it is the same for Basic/Advanced/Expert Water Magic. It just gets cheaper what's not that exciting for players. Maybe we should think about how to make it less boring?


Will think about that... but not in this week. I have to much work IRL and i don't have to head to think about this right now. But i will see to it.

Quote:
Btw, now the problem with transparency is gone


Good to hear, BTW. don't you know anyone who would have a "empty" background spell icon? Believe my under the "picture" it's a "artistic mess", and it would speed up future spell for me.

Quote:
Done. Needs testing. NewSpells_Szaman

It would be great to add more cadres to the Hour of Power spell animation def, though.


Thanks and will do! I see about the cadres and will add more if needed.

Quote:
It was not what I had thought of  There weren't any bugs with Slayer. It's just difference in damage between defending units and not defending units. Still, I fixed bonuses from spell specialists. So, if you'll find something, let me know and I'll try to fix it.



Of Course! Just give me a day or two ok?

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


Responsible
Supreme Hero
posted April 05, 2022 05:21 PM
Edited by AlexSpl at 17:23, 05 Apr 2022.

Quote:
But if "immunity" to those spells is the "only way" to "disable" those spells when HoP is enabled, so be it.

For me temporary immunity is better than the absense of any effect. In the first case a player at least knows that nothing will happen.

Quote:
Spell Specialists? Give a break even your spells don't have hero specialists for them.

I'm telling about Bless/Bloodlust/Fortune/Slayer specialists. The question is should they enhance the corresponding spell components of the Hour of Power, or not. Now they do. But if you think it's too much, I'll remove that feature.

Quote:
BTW. don't you know anyone who would have a "empty" background spell icon?

I think I have. Will share later.

Quote:
Of Course! Just give me a day or two ok?

Take your time. You know, you can't be the only tester for a bug-free result


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


Known Hero
posted April 08, 2022 02:48 AM
Edited by Szaman at 02:52, 08 Apr 2022.

As promised i have done some testing.
Didn't encounter some major bugs, only one.

-The spell give 2 points of luck, not 3.

But my second thought was "meh.. it's good". So don't change it, let it be 2 points/ranks of luck instead of 3.

The "bless" effect, works.
The "slayer" effect, works. Tested in on Angels, behemoths and hydras.
The "Bloodlust" effect, works.
The "Fortune" effect, gives 2 points, instead of 3. But leave it. Two points are enough.
The "50%hp" works fine. Tested in on all 7 lvl creatures.

Tested on all skill levels from nothing to expert, no bugs to report.

The Spell points cost also are good.
--------
I have a second thought about the duration of the spell, let's prolong it from 3 turns to 5.

The spell is a good fusion with counterstrike. Just throw Counterstrike and hour of power on 7 rank unit (on second round) and see how your foes are droping to your units kness. The hydras are now godlike creatures with this spell.
--------
Also i have "fix" animation durations, just added some more frames. But from my part i can say, for me the "fixed" animations are a bit to slow now. I like it how it is now. You  are probably playing on max speed animations, i'm playing on medium speed so on my side it is good, but i'm aware that on max speed the animations could be a little "short".

But here it is. (Changed to Megafile, this time. I hope you don't get any ads, this time).

----------
EDIT:
Maybe it will a little rude from my side... but are you still interested to adding new spells?

The Hour of Power spell was only a "novity" spell (good, but not "game changing"), but this new spell is more functional spell (if posibble to do it).

INVISIBILITY:

Maybe i will change the icon, looks a bit ugly... I will give you full inscription if you are interested to do it (or is it impossible to do it.)
This time a adventure map spell.

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


Responsible
Supreme Hero
posted April 08, 2022 01:35 PM

Quote:
-The spell give 2 points of luck, not 3.

But my second thought was "meh.. it's good". So don't change it, let it be 2 points/ranks of luck instead of 3.

Actually, it exacltly how Expert Fortune works +1/+1/+2/+2 to all at None/Basic/Advanced/Expert.

Quote:
I have a second thought about the duration of the spell, let's prolong it from 3 turns to 5.

You can do it yourself by editing <ForceCappedDuration>'s value in NewSpells.ini. For me, it's already OP

Quote:
Also i have "fix" animation durations, just added some more frames. But from my part i can say, for me the "fixed" animations are a bit to slow now. I like it how it is now. You  are probably playing on max speed animations, i'm playing on medium speed so on my side it is good, but i'm aware that on max speed the animations could be a little "short".


Quote:
Maybe it will a little rude from my side... but are you still interested to adding new spells?

Lack of good pictures/animations/sounds is what stops me from adding new spells to the game. I don't want new spells to look too out of the original style, even if I understand that you can always change graphics later. An impression from good-looking picture and animation can change a lot about how a player sees a spell as a whole. Of course, if you aren't an artist, you cannot replicate the original style, but at least you have to strive for it

Also I don't like how many high-level spells we have already, some of them are clearly OP. But you can always use them for campaigns. Even the Fear spell, I guess, was created originally for one of RoE camapaigns (probably for the undead King Gryphonheart's campaign).

It would be great to add a low-level spell that would be in harmony with the original spells and, at the same time, would be felt as something new by players.

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


Known Hero
posted April 08, 2022 07:24 PM
Edited by Szaman at 19:24, 08 Apr 2022.

Quote:
It would be great to add a low-level spell that would be in harmony with the original spells and, at the same time, would be felt as something new by players.


Well i also made first/second/third level spells.

Example:
STORM lvl 3 spell
Video
Just a "mini" armageddon make only 25% damage that armageddon does (the sounds, doesn't work, don't know why).
Does the animations are good for you?
Icons, work in progress

MEDITATION: lvl 1 spell (map spell)
Gives XXX SP points, but takes XXX movement points.
Icons, have to make them. That's no problem.

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


Responsible
Supreme Hero
posted April 08, 2022 08:57 PM

Quote:
Just a "mini" armageddon make only 25% damage that armageddon does (the sounds, doesn't work, don't know why).
Does the animations are good for you?

Well, I will tell you the truth. No one of the new spells fits my expectations. Though Rolex did a great job for sure. At least, his spells blend somehow with the original ones, there is no a huge gap between them, at least. From my side I promise a filigree work. I even take care of the AI weighting functions, what, I doubt, possible even in ERA. So, in return, I expect graphics assets that demand the same level of dedication. From my side, I have no limits. I will code anything you will ask. The price is my time, of course. But I can guarantee tangible results, so I expect quality from you as well.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Jump To: « Prev Thread . . . Next Thread » This thread is 14 pages long: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 · «PREV / NEXT»
Post New Poll    Post New Topic    Post New Reply

Page compiled in 0.0985 seconds