• 🏆 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!

[Spell] Cone spell based off of Hero Attribute

Status
Not open for further replies.
Level 2
Joined
Mar 15, 2017
Messages
6
Hello guys!

I've been trying to make a cone spell (Breath of Fire, Breath of frost - like) that would deal damage based on Hero Attribute. I've searched the net but haven't found a solution that would work for me. Could I get some advice?
Some info about the desired spell: It should be a simple breath of fire but w/o buff placer and should scale depending on hero's attribute
Thanks in advance!
 
Level 11
Joined
May 16, 2016
Messages
730
Hello guys!

I've been trying to make a cone spell (Breath of Fire, Breath of frost - like) that would deal damage based on Hero Attribute. I've searched the net but haven't found a solution that would work for me. Could I get some advice?
Some info about the desired spell: It should be a simple breath of fire but w/o buff placer and should scale depending on hero's attribute
Thanks in advance!
Damage and visual size of the breath wave are set in the "USE ABILITY" trigger. If you have GDD system in your map, then don't copy triggers in the "GDD DAMAGE DETECT" folder.
 

Attachments

  • Breath of Fire.w3x
    24.5 KB · Views: 47
Level 2
Joined
Mar 15, 2017
Messages
6
Damage and visual size of the breath wave are set in the "USE ABILITY" trigger. If you have GDD system in your map, then don't copy triggers in the "GDD DAMAGE DETECT" folder.
Fruit Forest, thank you very much!!! Yes, i do have GDD in my map but I could never think that to make this spell would require so much codeo_O I'm actually relatively new to the World Editor and I don't know a lot of things, like hash-tables. If it's ok, could you walk me through the triggers that you used and explain to me what each of them does so that I could use them in other spells? It's probably too much to ask but I'd be very grateful;)
 
Level 2
Joined
Mar 15, 2017
Messages
6
Are you familiar with damage engines? You could just use a dummy unit to cast the actual spell and modify damage done by checking whenever the damage source is your dummy.
Thanks for the tip! I tried to make the spell using a dummy but since I am a newbie I could not figure out exact commands(
 
Level 11
Joined
May 16, 2016
Messages
730
If it's ok, could you walk me through the triggers that you used and explain to me what each of them does so that I could use them in other spells?
1. Hashtable is a table which converts anything to number and you can store it just like variable, but in this case they are connected with the child of hashtable (unit, desructible or any other object in the game)
2. GDD system give you easy detection damage, it is needed to detect damage which dealt by dummy unit.
INIT:
3. You have two spells: empty one which doesn't deal any damage or doing anything and it is used by the caster, and the real one with visual wave, and it allow to damage.
USE ABILITY:
4. Then the hero casts the spell, the dummy unit appears to cast the real spell.
5. To store damage you must get the ID of dummy unit (get handleID). In this ID (integer, child of hashtable) i stored real (damage) and the unit-caster.
DAMAGE CALCULATION:
6. When the dummy hits enemy, then you must get its ID again, load stored damage value and the unit-caster.
7. Also I used the empty group "lock_damage_group" to avoid infinite loop (then unit deals damage, the trigger activates additional damage, which again enable the trigger again and it activates additional damage over and over so you need a blocking condition which stops the loop once).
8. First I load the unit-caster, because it must deal the stored damage, not the dummy. If the caster is alive then it will deal damage, else the dummy deals it.
CLEAR HASH:
9. Since hashtable store number you need to clean it or else the memory load is increased (leaks) with every time unit casts the spell. Then dummy dies the system cleans the stored damage and the caster unit from the memory.
 
Level 2
Joined
Mar 15, 2017
Messages
6
1. Hashtable is a table which converts anything to number and you can store it just like variable, but in this case they are connected with the child of hashtable (unit, desructible or any other object in the game)
2. GDD system give you easy detection damage, it is needed to detect damage which dealt by dummy unit.
INIT:
3. You have two spells: empty one which doesn't deal any damage or doing anything and it is used by the caster, and the real one with visual wave, and it allow to damage.
USE ABILITY:
4. Then the hero casts the spell, the dummy unit appears to cast the real spell.
5. To store damage you must get the ID of dummy unit (get handleID). In this ID (integer, child of hashtable) i stored real (damage) and the unit-caster.
DAMAGE CALCULATION:
6. When the dummy hits enemy, then you must get its ID again, load stored damage value and the unit-caster.
7. Also I used the empty group "lock_damage_group" to avoid infinite loop (then unit deals damage, the trigger activates additional damage, which again enable the trigger again and it activates additional damage over and over so you need a blocking condition which stops the loop once).
8. First I load the unit-caster, because it must deal the stored damage, not the dummy. If the caster is alive then it will deal damage, else the dummy deals it.
CLEAR HASH:
9. Since hashtable store number you need to clean it or else the memory load is increased (leaks) with every time unit casts the spell. Then dummy dies the system cleans the stored damage and the caster unit from the memory.
Thanks for clarification! Now it starts to make sense;)
 
Status
Not open for further replies.
Top