• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Peculiar solution to the Spelldamage problem.

Status
Not open for further replies.
Level 3
Joined
Dec 23, 2008
Messages
23
I've been really cracking my brain to find a viable solution to the problem of having a Spelldamage stat in a map I am working on. One solution is to make every single Spelldamage-using spell a triggered spell with a dummy spell as activator, but that means you can't have accurate descriptions of damage in your spell, so I found a way that I think might work. Well, it WILL work, but the question is if its viable and how its use of system resources will be..

When a player selects a hero that uses either +Spelldamage or +Healing, a leaderboard is created for the player listing his +Spelldamage or +Healing. The characters +Spelldamage or +Healing is calculated every second by a looping trigger that activates once a second, and the total +Spelldamage / Healing is equal to Int + Equipment modifiers (i.e. any equipment with + Spelldamage) and buff modifiers (if you have any buffs that affect +Spelldamage).

Here comes the part I'm uncertain about, instead of making the spells triggered spells, I was thinking that it might be possible to make a spell with, lets say, 500 levels. Every time the trigger is run that updates spelldamage, it sets the level of the Spelldamage spells to be equal to the players +Spelldamage. So, lets say that I have a Fireball spell, it causes 50 damage as base and an additional 50 damage every time it is levelled up, plus the players +Spelldamage. We know the spell can't do less than 60 damage, because the hero starts with 10 int, and 50 is the base damage of the spell.

So we set the damage of the level 1 spell to be 60, and then make it a 500 levels spell, increasing damage by 1 every level (if 500 is appropriate, you can always calculate what the spelldamage cap is for your map).

Every time the trigger is run that updates spelldamage, it sets the level of the spell to:

Level of the hero ability (which is a dummy ability placed in a spellbook) x 50

Plus current Spelldamage of the hero

Minus 60 (Since we start the spell at 60 damage as we know it is the minimum damage possible for the spell)

And the result would be that the spell should cause appropriate damage without making it a triggered spell at all.

Now, my question is, if the map has, for example, 4 players with casters heroes, would it cause lag to have a trigger activating once every second like this? Would it cause any lag to have a 500-level ability?

Making the actual 500-level ability isn't a *huge* problem, lots of copy / pasting involved, but not problematic I would think.
 
Level 16
Joined
Feb 22, 2006
Messages
960
the thing with the loop stuff is that it's not that efficient i would say. better try to modify any variable (lets say an integer) and store the value of spelldamage or +healing, then just trigger all spells and set damage/heal + value of spelldamage/+heal
so you wouldn't have those loops :)
 
Level 3
Joined
Dec 23, 2008
Messages
23
Good point, I made a test map with one single test ability. I set the base damage of the ability to 50, so initial damage is 50 + spell damage and put in various items that increase spell damage. I also made a leaderboard displaying the current spell damage of the hero.
 

Attachments

  • Spelldamage Test.w3x
    57.4 KB · Views: 37
Level 3
Joined
Dec 23, 2008
Messages
23
Okay, worked a bit further on the issue, sorting out a few chinks. Now what I really would like to know what the effect of 4 heroes with 4-5 different spell-based / crit-based spells each would have on a map, if it would run slower with X number of 500 level spells. Anyways, I'm adding the updated test map where I added crit.
 

Attachments

  • Spelldamage Test.w3x
    59.3 KB · Views: 42
Status
Not open for further replies.
Top