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

Damage over time MUI Spell

Status
Not open for further replies.
Level 4
Joined
Oct 11, 2008
Messages
90
I have a trigger spell based on the channel ability that looks like this:

  • Events
    • Unit - A unit starts the effect of an ability
  • Conditions
    • Ability being cast equal to Rage
  • Actions
    • Set Caster = Casting Unit
    • Set Target = Target unit of abiltity being cast
    • Set Random = Random integer number between 2 and 3
    • For each (integer A) from 1 to Random do actions
      • Loop - Actions
        • Unit - Cause Caster to damage Target dealing 100 damage of attack type spell and damage type normal
        • Wait 2.00 seconds
This ability can be cast by many units so i need to make this spell MUI. Since the Wait function is there, this may be a little difficult. Is there any way to solve this?
 
Level 13
Joined
Nov 22, 2006
Messages
1,260
Maybe use the all new hashtables? This spell isn't MUI, but you can make it MUI either with hashtables or arrays (each variable is an array of about 10 and you have one integer variable which increases with each spell cast and when it comes to 10, reset it back to 1?).

Sounds good?
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
  • Activate Skill
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Holy Light
    • Actions
      • Set Temp_Integer_1 = (Random integer number between 2 and 4)
      • -------- -------------------- --------
      • Hashtable - Save 0 as (Key index) of (Key (Target unit of ability being cast)) in Random_Hash
      • Hashtable - Save 100.00 as (Key dmg) of (Key (Target unit of ability being cast)) in Random_Hash
      • Hashtable - Save Temp_Integer_1 as (Key loops) of (Key (Target unit of ability being cast)) in Random_Hash
      • Hashtable - Save Handle Of(Triggering unit) as (Key caster) of (Key (Target unit of ability being cast)) in Random_Hash
      • -------- -------------------- --------
      • Unit Group - Add (Target unit of ability being cast) to Random_Group
      • -------- -------------------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Do Damage <gen> is on) Equal to False
        • Then - Actions
          • Trigger - Turn on Do Damage <gen>
        • Else - Actions
  • Do Damage
    • Events
      • Time - Every 2.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in Random_Group and do (Actions)
        • Loop - Actions
          • Set Temp_Integer_1 = (Load (Key loops) of (Key (Picked unit)) from Random_Hash)
          • Set Temp_Integer_2 = (Load (Key index) of (Key (Picked unit)) from Random_Hash)
          • -------- -------------------- --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Temp_Integer_2 Less than or equal to Temp_Integer_1
            • Then - Actions
              • Set Temp_Unit_1 = (Load (Key caster) of (Key (Picked unit)) in Random_Hash)
              • Set Temp_Real_1 = (Load (Key dmg) of (Key (Picked unit)) from Random_Hash)
              • -------- -------------------- --------
              • Unit - Cause Temp_Unit_1 to damage (Picked unit), dealing Temp_Real_1 damage of attack type Spells and damage type Normal
              • -------- -------------------- --------
              • Set Temp_Integer_2 = (Temp_Integer_2 + 1)
              • -------- -------------------- --------
              • Hashtable - Save Temp_Integer_2 as (Key index) of (Key (Picked unit)) in Random_Hash
            • Else - Actions
              • Unit Group - Remove (Picked unit) from Random_Group
              • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in Random_Hash
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in Random_Group) Equal to 0
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
Do you want the effect to stack?
 
Level 4
Joined
Oct 11, 2008
Messages
90
I'm a noob at hashtable. I don't know how to create one. I can't even find the hashtable in the variables section.
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
I'm a noob at hashtable. I don't know how to create one. I can't even find the hashtable in the variables section.

Do you have patch 1.24(b)?

imo hashtables are stupid. use indexing instead

Interesting opinion. How do you feel they are stupid? I used to make MUI spells with arrays/indexing, but wouldn't go back now that hashtables are available. Hashtables are easier IMO.
 
Last edited:
Just use triggering unit and target unit of ability cast. It works even with waits.

I agree with the triggering unit but I tried the target unit some time ago and it seems to bug especially after a long wait it seems that the game don't remember the target unit of ability being cast....

one thing though, triggering unit does not work if the unit dies in the effect of incineration (I noticed it in a creep revive system using waits, units that die while under incineration won't get revived maybe because the units "dont exist" anymore it's the same if their corpses got removed before the end of the wait)

before I used to use locals because they seem to work fine for me.... but most people here say that they still cause bug with waits..... and I don't usually use them anymore but they worked fine for me....
 
Level 20
Joined
Oct 21, 2006
Messages
3,231
Interesting opinion. How do you feel they are stupid? I used to make MUI spells with arrays/indexing, but wouldn't go back now that hashtables are available. Hashtables are easier IMO.
You remember when you made hashtables for me to make a MUI spell? It dropped my fps to 54 from 60. But in my way (indexing, not sure) fps dropped maybe to 56. Yes my pc sux. :)
 
Status
Not open for further replies.
Top