• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

"Fury" +70 Ms +5 Hp regen.

Status
Not open for further replies.
Level 6
Joined
Oct 4, 2011
Messages
226
Hi. Ive been working more lately to get better at making abilities.. I have just made my first 'MUI' ability 100% on my own and I would like to get it leak-proofed. The abilities duration lasts 5 seconds, increases movement speed by +70 and adds a +5 Hitpoint regeneration bonus. Here they are
  • Fury
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Fury (Minotaur)
    • Actions
      • Set Fury_CasterUnit = (Casting unit)
      • Animation - Change Fury_CasterUnit's vertex coloring to (100.00%, 65.00%, 65.00%) with 0.00% transparency
      • Unit Group - Add Fury_CasterUnit to Fury_CasterGroup
      • Set Fury_CasterSpeed = (Default movement speed of Fury_CasterUnit)
      • Set Fury_TimeReal = 5.00
      • Custom script: set udg_Fury_IDInteger = GetHandleId(udg_Fury_CasterUnit)
      • Hashtable - Save Handle OfFury_CasterUnit as (Key caster) of Fury_IDInteger in Fury_HashTable
      • Unit - Set (Load (Key caster) of Fury_IDInteger in Fury_HashTable) movement speed to ((Default movement speed of (Load (Key caster) of Fury_IDInteger in Fury_HashTable)) + 70.00)
      • Hashtable - Save Fury_TimeReal as (Key time) of Fury_IDInteger in Fury_HashTable
      • Hashtable - Save Fury_CasterSpeed as (Key speed) of Fury_IDInteger in Fury_HashTable
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Fury timer <gen> is on) Equal to False
        • Then - Actions
          • Trigger - Turn on Fury timer <gen>
        • Else - Actions
Loop trigger:

  • Fury timer
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in Fury_CasterGroup) Greater than 0
        • Then - Actions
          • Unit Group - Pick every unit in Fury_CasterGroup and do (Actions)
            • Loop - Actions
              • Set Fury_TempUnit = (Picked unit)
              • Custom script: set udg_Fury_IDInteger = GetHandleId(udg_Fury_TempUnit)
              • Set Fury_TimeReal = (Load (Key time) of Fury_IDInteger from Fury_HashTable)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Fury_TimeReal Greater than 0.00
                • Then - Actions
                  • Hashtable - Save (Fury_TimeReal - 0.03) as (Key time) of Fury_IDInteger in Fury_HashTable
                • Else - Actions
                  • Unit - Set (Load (Key caster) of Fury_IDInteger in Fury_HashTable) movement speed to (Default movement speed of (Load (Key caster) of Fury_IDInteger in Fury_HashTable))
                  • Animation - Change (Load (Key caster) of Fury_IDInteger in Fury_HashTable)'s vertex coloring to (100.00%, 100.00%, 100.00%) with 0.00% transparency
                  • Hashtable - Clear all child hashtables of child Fury_IDInteger in Fury_HashTable
                  • Unit Group - Remove Fury_TempUnit from Fury_CasterGroup
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Fury_TimeReal Equal to 4.04
                • Then - Actions
                  • Unit - Set life of Fury_TempUnit to ((Life of Fury_TempUnit) + 5.00)
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Fury_TimeReal Equal to 3.08
                • Then - Actions
                  • Unit - Set life of Fury_TempUnit to ((Life of Fury_TempUnit) + 5.00)
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Fury_TimeReal Equal to 2.12
                • Then - Actions
                  • Unit - Set life of Fury_TempUnit to ((Life of Fury_TempUnit) + 5.00)
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Fury_TimeReal Equal to 1.16
                • Then - Actions
                  • Unit - Set life of Fury_TempUnit to ((Life of Fury_TempUnit) + 5.00)
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Fury_TimeReal Equal to 0.20
                • Then - Actions
                  • Unit - Set life of Fury_TempUnit to ((Life of Fury_TempUnit) + 5.00)
                • Else - Actions
        • Else - Actions
          • Trigger - Turn off (This trigger)
I used a calculator and foundout where numbers where convinient by subtracting .03 from 5.00 and in these sweet-spots is where i added in the healing process.
 
Use (Triggering unit) instead of (Casting unit).
  • Unit - Set (Load (Key caster) of Fury_IDInteger in Fury_HashTable) movement speed to ((Default movement speed of (Load (Key caster) of Fury_IDInteger in Fury_HashTable)) + 70.00)
->
  • Unit - Set (Triggering unit) movement speed to ((Default movement speed of (Triggering unit) + 70.00)
Load values when working with triggers other than the main trigger. Otherwise, just refer to the plain event responses.

Prefer working with Integers as saving values, since StringHash creates unnecessary leaks (once, but cannot be removed).

  • Hashtable - Save Handle OfFury_CasterUnit as (Key caster) of Fury_IDInteger in Fury_HashTable
Redundant; you add the caster to the unit group. When you enumerate the units, just use (Picked unit), instead of loading the caster from the caster (!). Set (Fury_TempUnit)'s speed to (Load the default speed).

Instead of using this large if then else block, save the interval (just like the duration) to the caster; let's say it's once per second.
  • Hashtable - Save 1 as (Key interval) of Fury_IDInteger in Fury_HashTable
Loop trigger:
  • Set Fury_Interval = (Load Key(interval) of Fury_IDInteger in Fury_HashTable
  • If (All conditions are true) then do (Actions) else do (Actions)
    • If - Conditions
      • Fury_Interval Greater than 0
    • Then - Actions
      • Hashtable - Save (Fury_Interval - 0.03) as (Key(interval)) of Fury_IDInteger in Fury_Hashtable
    • Else - Actions
      • Hashtable - Save 1 as (Key(interval)) of Fury_IDInteger in Fury_Hashtable
      • Unit - Set life of Fury_TempUnit to ((Life of Fury_TempUnit) + 5.00))
 
Level 6
Joined
Oct 4, 2011
Messages
226
Wow thanks :) this interval method is way more effecient! Also I dont gotta use a .96 interval using this because it heals 30 hp that way.. I can have a flat 1 second interval now and it seems to work great.
  • Fury
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Fury (Minotaur)
    • Actions
      • Set Fury_CasterUnit = (Triggering unit)
      • Animation - Change Fury_CasterUnit's vertex coloring to (100.00%, 65.00%, 65.00%) with 0.00% transparency
      • Unit Group - Add Fury_CasterUnit to Fury_CasterGroup
      • Set Fury_CasterSpeed = (Default movement speed of Fury_CasterUnit)
      • Set Fury_TimeReal = 5.00
      • Custom script: set udg_Fury_IDInteger = GetHandleId(udg_Fury_CasterUnit)
      • Hashtable - Save Handle OfFury_CasterUnit as (Key caster) of Fury_IDInteger in Fury_HashTable
      • Unit - Set (Triggering unit) movement speed to ((Default movement speed of (Triggering unit)) + 70.00)
      • Hashtable - Save Fury_TimeReal as (Key time) of Fury_IDInteger in Fury_HashTable
      • Hashtable - Save Fury_CasterSpeed as (Key speed) of Fury_IDInteger in Fury_HashTable
      • Hashtable - Save 1.00 as (Key interval) of Fury_IDInteger in Fury_HashTable
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Fury timer <gen> is on) Equal to False
        • Then - Actions
          • Trigger - Turn on Fury timer <gen>
        • Else - Actions
LOOP:

  • Fury timer
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in Fury_CasterGroup) Greater than 0
        • Then - Actions
          • Unit Group - Pick every unit in Fury_CasterGroup and do (Actions)
            • Loop - Actions
              • Set Fury_TempUnit = (Picked unit)
              • Custom script: set udg_Fury_IDInteger = GetHandleId(udg_Fury_TempUnit)
              • Set Fury_TimeReal = (Load (Key time) of Fury_IDInteger from Fury_HashTable)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Fury_TimeReal Greater than 0.00
                • Then - Actions
                  • Hashtable - Save (Fury_TimeReal - 0.03) as (Key time) of Fury_IDInteger in Fury_HashTable
                • Else - Actions
                  • Unit - Set (Load (Key caster) of Fury_IDInteger in Fury_HashTable) movement speed to (Default movement speed of (Load (Key caster) of Fury_IDInteger in Fury_HashTable))
                  • Animation - Change (Load (Key caster) of Fury_IDInteger in Fury_HashTable)'s vertex coloring to (100.00%, 100.00%, 100.00%) with 0.00% transparency
                  • Hashtable - Clear all child hashtables of child Fury_IDInteger in Fury_HashTable
                  • Unit Group - Remove Fury_TempUnit from Fury_CasterGroup
              • Set Fury_Interval = (Load (Key interval) of Fury_IDInteger from Fury_HashTable)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Fury_Interval Greater than 0.00
                • Then - Actions
                  • Hashtable - Save (Fury_Interval - 0.03) as (Key interval) of Fury_IDInteger in Fury_HashTable
                • Else - Actions
                  • Hashtable - Save 1.00 as (Key interval) of Fury_IDInteger in Fury_HashTable
                  • Unit - Set life of Fury_TempUnit to ((Life of Fury_TempUnit) + 5.00)
        • Else - Actions
          • Trigger - Turn off (This trigger)
 
Level 6
Joined
Oct 4, 2011
Messages
226
I've tried to figure out what you mean by "You can include interval within the Then branch of the duration." I've tried moving the interval variable around in various locations and it just causes the heal to be 1 tick short. I did change the loop unit to Temp unit though thanks.
 
Status
Not open for further replies.
Top