• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Simple Index HammerThrow

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
Well this is my first index system i hope its leakless and its MUI...

UPDATES: Hero abilitie now + stat depending.

TRIGGERS:

  • ThrowHammer cast
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to (==) Throw Hammer
    • Actions
      • -------- Loop Is not needed only thing it dose it creating x3 hammers... --------
        • Do Multiple ActionsFor each (Integer A) from 1 to 3, do (Actions)
          • Loop - Actions
            • Set TH_INT[1] = (TH_INT[1] + 1)
            • Set TH_INT[2] = (TH_INT[2] + 1)
            • -------- Seting the index ^ --------
            • Set TempPoint[1] = (Position of (Triggering unit))
            • -------- Position of cast ^ --------
            • Set TempPoint[2] = (Target point of ability being cast)
            • -------- Position of Target ^ --------
            • Unit - Create 1 DummyHammer for (Owner of (Triggering unit)) at TempPoint[1] facing ((Random real number between -15.00 and 15.00) + (Angle from TempPoint[1] to TempPoint[2])) degrees
            • Unit - Turn collision for (Last created unit) Off
            • -------- The dummy unit ^ --------
            • Set TH_Caster[TH_INT[1]] = (Triggering unit)
            • -------- The unit who will get the kill (the unit who casts the spell) ^ --------
            • Set TH_Missile[TH_INT[1]] = (Last created unit)
            • -------- The thing that will fly ^ --------
            • Set TH_Damage[TH_INT[1]] = ((Real((Strength of (Triggering unit) (Include bonuses)))) x ((Real((Level of Throw Hammer for (Triggering unit)))) x 2.00))
            • -------- The damage dealt you can use w/e here no need to use random number, --------
            • Set TH_Range[TH_INT[1]] = 800.00
            • -------- The range that the projectile will travel.^ --------
            • Set TH_Speed[TH_INT[1]] = (Random real number between 30.00 and 45.00)
            • -------- How fast that the projectile will travel.(to fast can couse it to miss units in its way)^ --------
              • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • TH_INT[1] Equal to (==) 1
                • Then - Actions
                  • Trigger - Turn on ThrowHammer loop <gen>
                • Else - Actions
            • -------- Remove Leaks --------
            • Custom script: call RemoveLocation(udg_TempPoint[1])
            • Custom script: call RemoveLocation(udg_TempPoint[2])
  • ThrowHammer loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Do Multiple ActionsFor each (Integer TempINT) from 1 to TH_INT[1], do (Actions)
        • Loop - Actions
          • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (TH_Missile[TempINT] is alive) Equal to (==) True
            • Then - Actions
              • Set TempPoint[1] = (Position of TH_Missile[TempINT])
              • Set TempPoint[2] = (TempPoint[1] offset by TH_Speed[TempINT] towards (Facing of TH_Missile[TempINT]) degrees)
              • Set TempUnitGroup = (Units within 150.00 of TempPoint[1] matching ((((Matching unit) belongs to an enemy of (Owner of TH_Missile[TempINT])) Equal to (==) True) and (((Matching unit) is alive) Equal to (==) True)))
              • Unit Group - Pick every unit in TempUnitGroup and do (Actions)
                • Loop - Actions
                  • Unit - Cause TH_Caster[TempINT] to damage (Picked unit), dealing TH_Damage[TempINT] damage of attack type Spells and damage type Normal
                • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • (Number of units in TempUnitGroup) Greater than or equal to (>=) 1
                  • Then - Actions
                    • Unit - Kill TH_Missile[TempINT]
                    • Set TH_INT[2] = (TH_INT[2] - 1)
                  • Else - Actions
                • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • TH_Range[TempINT] Less than or equal to (<=) 0.00
                    • (TH_Missile[TempINT] is alive) Equal to (==) True
                  • Then - Actions
                    • Unit - Kill TH_Missile[TempINT]
                    • Set TH_INT[2] = (TH_INT[2] - 1)
                  • Else - Actions
                    • Unit - Move TH_Missile[TempINT] instantly to TempPoint[2]
                    • Set TH_Range[TempINT] = (TH_Range[TempINT] - TH_Speed[TempINT])
              • Unit Group - Remove all units from TempUnitGroup
              • Custom script: call DestroyGroup(udg_TempUnitGroup)
              • Custom script: call RemoveLocation(udg_TempPoint[1])
              • Custom script: call RemoveLocation(udg_TempPoint[2])
            • Else - Actions
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • TH_INT[2] Less than or equal to (<=) 0
        • Then - Actions
          • Set TH_INT[1] = 0
          • Trigger - Turn off (This trigger)
        • Else - Actions
Keywords:
hammer throw, thror, hammer, dwarth.
Contents

HammerThrow (Map)

Reviews
12th Dec 2015 IcemanBo: Too long as NeedsFix. Rejected. Simple Index HammerThrow | Reviewed by Maker | 2nd Jun 2013 NEEDS FIX The event should be Starts the effect of an ability The death type of the dummy should be can't...

Moderator

M

Moderator

12th Dec 2015
IcemanBo: Too long as NeedsFix. Rejected.


Simple Index HammerThrow | Reviewed by Maker | 2nd Jun 2013
NEEDS FIX


126248-albums6177-picture66522.png


  • The event should be Starts the effect of an ability
  • The death type of the dummy should be can't raise, does not decay
  • Dummies give too much vision
126248-albums6177-picture66523.png


  • Units with locust don't have collision, no need to use an action
    to turn it off
  • You don't need arrays for the locations
  • Take TH_INT[1] Equal to 1 check out of the loop
  • You could use dynamic indexing
  • Don't check this during every loop: TH_INT[2] Less than or equal to 0
  • If number of units in group >= 1, you don't need to check
    missile is alive or the range
126248-albums6177-picture66524.png
[tr]
[tr][td]
 
because 0.03 is the standard time for periodic loop triggers, it does not cause lag or bugs, using 0.02 is too fast and will cause lag 0.01 is completely excessive, but 0.03-0.04 are the standard rates (beyond that and smoothness for projectiles will start to be lost)

Edit: I'll also add to my comments on improvements, using co-ordinates over locations would vastly improve the performance of the spell
 
Level 9
Joined
May 27, 2012
Messages
116
btw whate ????
you shall always use 0.03 Losam.

0.05 will look like the missile is blinking or some thing and...
I will need to increasse the the distance it moves every time that makes it able to miss the targets...

so no thx i keep it at 0.03 there is should be...

like is there any leak ect...
 
Last edited by a moderator:
Level 29
Joined
Oct 24, 2012
Messages
6,543
plz do not double post. also asking for rep is against the rules. same with trading rep.
u will get rep when u earn it or someone deems necessary.
sry if i sounded rude.

@TO
the indexing method u use is outdated and slow. You can learn a better indexing method in my tutorial Things a GUIer Should Know.
if u need any help learning it im glad to help u.

also this
  • Set TH_Damage[TH_INT[1]] = ((Real((Strength of (Triggering unit) (Include bonuses)))) x ((Real((Level of Throw Hammer for (Triggering unit)))) x 2.00))
should be changed since u put triggering unit into a variable already. u should use that variable. As a rule of thumb. anything u use twice or more store into a variable and use it for efficiency and speed. Also it helps with editing things.

Can u plz put ur triggers in hidden tags ? thanks
 
Top