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

Dark Matter

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
Well I haven't published anything in a while due to me being well...
Anyway this was made for a spell contest at a other site which should have judged the spell 3 months ago stating that I were not allowing to post it in any other place etc. Anyway the contest never ended so here I'm publishing my spell Dark Matter.


  • DM hash
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set IV_table = (Last created hashtable)
  • DM cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Dark Matter
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (IV_Casters is empty) Equal to True
        • Then - Actions
          • Trigger - Turn on DM loop <gen>
        • Else - Actions
      • -------- Change variables below this line --------
      • Set IV_damage = (25 + (50 x (Level of (Ability being cast) for (Triggering unit))))
      • -------- The damage when you stop/finish casting the spell --------
      • Set IV_channel_time = 4
      • -------- in seconds --------
      • Set IV_knock_back_distance = 500
      • -------- Knockback distance in the end --------
      • -------- Change variables above this line --------
      • -------- do not change this --------
      • Set IV_channel_time = (IV_channel_time x 33)
      • -------- do not change this --------
      • Set IV_point1 = (Target point of ability being cast)
      • Unit - Create 1 Black Hole Dummy2 for (Owner of (Triggering unit)) at IV_point1 facing Default building facing degrees
      • Set IV_dummy = (Last created unit)
      • Unit - Create 1 Black Hole Dummy for (Owner of (Triggering unit)) at IV_point1 facing Default building facing degrees
      • Set IV_dummy2 = (Last created unit)
      • Unit - Create 1 Black Hole Dummy5 for (Owner of (Triggering unit)) at IV_point1 facing Default building facing degrees
      • Set IV_dummy3 = (Last created unit)
      • Hashtable - Save IV_channel_time as 0 of (Key (Triggering unit)) in IV_table
      • Hashtable - Save IV_damage as 1 of (Key (Triggering unit)) in IV_table
      • Hashtable - Save Handle OfIV_dummy as 2 of (Key (Triggering unit)) in IV_table
      • Hashtable - Save Handle OfIV_dummy2 as 3 of (Key (Triggering unit)) in IV_table
      • Hashtable - Save Handle OfIV_dummy3 as 4 of (Key (Triggering unit)) in IV_table
      • Hashtable - Save IV_knock_back_distance as 5 of (Key (Triggering unit)) in IV_table
      • Unit Group - Add (Triggering unit) to IV_Casters
      • Custom script: call RemoveLocation(udg_IV_point1)
  • DM loop
    • 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
          • (IV_Casters is empty) Equal to True
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
      • Unit Group - Pick every unit in IV_Casters and do (Actions)
        • Loop - Actions
          • Set IV_channel_time = (Load 0 of (Key (Picked unit)) from IV_table)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • IV_channel_time Less than or equal to 0
            • Then - Actions
              • Unit - Order (Picked unit) to Stop
            • Else - Actions
              • Set IV_channel_time = (IV_channel_time - 1)
              • Hashtable - Save IV_channel_time as 0 of (Key (Picked unit)) in IV_table
              • Set IV_dummy = (Load 2 of (Key (Picked unit)) in IV_table)
              • Set IV_point1 = (Position of IV_dummy)
              • Set IV_unit = (Picked unit)
              • Set IV_group1 = (Units within 500.00 of IV_point1 matching ((((Matching unit) is paused) Equal to False) and ((((Owner of (Matching unit)) is an ally of (Owner of (Picked unit))) Equal to
  • False) and (((Matching unit) is A structure) Equal to False))))
    • Unit Group - Pick every unit in IV_group1 and do (Actions)
      • Loop - Actions
        • Set IV_unit2 = (Picked unit)
        • Set IV_point2 = (Position of (Picked unit))
        • Set IV_point3 = (IV_point2 offset by 5.00 towards (Angle from IV_point2 to IV_point1) degrees)
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Terrain pathing at IV_point3 of type Walkability is off) Equal to False
          • Then - Actions
            • Custom script: call SetUnitY((udg_IV_unit2), GetLocationY(udg_IV_point3))
            • Custom script: call SetUnitX((udg_IV_unit2), GetLocationX(udg_IV_point3))
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (Distance between IV_point1 and IV_point2) Less than or equal to 10.00
              • Then - Actions
                • Set IV_Boolean = (Load 15 of (Key (Picked unit)) from IV_table)
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • IV_Boolean Equal to False
                  • Then - Actions
                    • Set IV_Boolean = True
                    • Hashtable - Save IV_Boolean as 15 of (Key (Picked unit)) in IV_table
                    • Animation - Change (Picked unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with 100.00% transparency
                    • Unit - Pause (Picked unit)
                    • Unit - Turn collision for (Picked unit) Off
                    • Unit - Create 1 Black Hole Dummy4 for (Owner of IV_dummy) at IV_point1 facing Default building facing degrees
                    • Unit - Add a 0.25 second Generic expiration timer to (Last created unit)
                    • Set IV_facing = (Angle from IV_point2 to IV_point1)
                    • Hashtable - Save IV_facing as 9 of (Key (Picked unit)) in IV_table
                    • Unit - Move (Picked unit) instantly to IV_point1
                  • Else - Actions
              • Else - Actions
          • Else - Actions
        • Custom script: call RemoveLocation(udg_IV_point2)
        • Custom script: call RemoveLocation(udg_IV_point3)
    • Custom script: call RemoveLocation(udg_IV_point1)
    • Custom script: call DestroyGroup(udg_IV_group1)
  • DM finish Channrling
    • Events
      • Unit - A unit Stops casting an ability
      • Unit - A unit Is issued an order with no target
      • Unit - A unit Is issued an order targeting a point
      • Unit - A unit Is issued an order targeting an object
      • Unit - A unit Finishes casting an ability
    • Conditions
      • ((Triggering unit) is in IV_Casters) Equal to True
    • Actions
      • Unit Group - Remove (Triggering unit) from IV_Casters
      • Set IV_dummy = (Load 2 of (Key (Triggering unit)) in IV_table)
      • Set IV_dummy2 = (Load 3 of (Key (Triggering unit)) in IV_table)
      • Set IV_dummy3 = (Load 4 of (Key (Triggering unit)) in IV_table)
      • Set IV_damage = (Load 1 of (Key (Triggering unit)) from IV_table)
      • Set IV_knock_back_distance = (Load 5 of (Key (Triggering unit)) from IV_table)
      • Set IV_point1 = (Position of IV_dummy2)
      • Unit - Create 1 Black Hole Dummy3 for (Owner of (Triggering unit)) at IV_point1 facing Default building facing degrees
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (IV_group4 is empty) Equal to True
        • Then - Actions
          • Trigger - Turn on DM knockback <gen>
        • Else - Actions
      • Set IV_group2 = (Units within 40.00 of IV_point1 matching ((((Matching unit) is paused) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True)))
      • Unit Group - Pick every unit in IV_group2 and do (Actions)
        • Loop - Actions
          • Unit - Unpause (Picked unit)
          • Unit - Cause (Triggering unit) to damage (Picked unit), dealing (Real(IV_damage)) damage of attack type Spells and damage type Magic
          • Animation - Change (Picked unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with 0.00% transparency
          • Set IV_facing = (Load 9 of (Key (Picked unit)) from IV_table)
          • Hashtable - Save IV_knock_back_distance as 10 of (Key (Picked unit)) in IV_table
          • Unit Group - Add (Picked unit) to IV_group4
          • Unit - Turn collision for (Picked unit) On
      • Unit - Kill IV_dummy
      • Unit - Kill IV_dummy2
      • Unit - Kill IV_dummy3
      • Unit - Kill (Last created unit)
      • Hashtable - Clear all child hashtables of child (Key (Triggering unit)) in IV_table
      • Custom script: call RemoveLocation(udg_IV_point1)
  • DM knockback
    • 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
          • (IV_group4 is empty) Equal to True
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
      • Unit Group - Pick every unit in IV_group4 and do (Actions)
        • Loop - Actions
          • Set IV_knock_back_distance = (Load 10 of (Key (Picked unit)) from IV_table)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • IV_knock_back_distance Greater than or equal to 15
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Terrain pathing at IV_point5 of type Walkability is off) Equal to False
                • Then - Actions
                  • Set IV_knock_back_distance = (IV_knock_back_distance - 15)
                  • Set IV_facing = (Load 9 of (Key (Picked unit)) from IV_table)
                  • Set IV_point4 = (Position of (Picked unit))
                  • Set IV_point5 = (IV_point4 offset by 15.00 towards IV_facing degrees)
                  • Unit - Move (Picked unit) instantly to IV_point5
                  • Special Effect - Create a special effect at IV_point4 using Abilities\Spells\Items\AIil\AIilTarget.mdl
                  • Special Effect - Destroy (Last created special effect)
                  • Hashtable - Save IV_knock_back_distance as 10 of (Key (Picked unit)) in IV_table
                  • Custom script: call RemoveLocation(udg_IV_point4)
                  • Custom script: call RemoveLocation(udg_IV_point5)
                • Else - Actions
                  • Unit Group - Remove (Picked unit) from IV_group3
                  • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in IV_table
            • Else - Actions
              • Unit Group - Remove (Picked unit) from IV_group3
              • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in IV_table


Keywords:
Dark matter, telekenisis, dark, Aradar, Baaabuuu, push, drag, hero, undead, mage.
Contents

Dark Matter (Map)

Reviews
12th Dec 2015 IcemanBo: For long time as NeedsFix. Rejected. 11:10, 3rd Jun 2011 Maker: This could be approved, but do some of the improvements I suggested in post #3 of this thread. Turning off DM finish Channeling and the unit group empty...

Moderator

M

Moderator

12th Dec 2015
IcemanBo: For long time as NeedsFix. Rejected.

11:10, 3rd Jun 2011
Maker:
This could be approved, but do some of the improvements I suggested in post #3 of this thread. Turning off DM finish Channeling and the unit group empty check are the most important ones. You also leak IV_group2 in the finish cnanneling trigger.
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
The learn icon should be active, it's passive now.
Instead of using DM finish Channrling trigger, you could just test the current order of the caster inside the loop. If you still decie to use that trigger, then turn it on/off when needed, don't have it on all the time.
These checks should only be done after a unit is removed from the group:
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (IV_group4 is empty) Equal to True
    • Then - Actions
      • Trigger - Turn off (This trigger)
    • Else - Actions
Owner of triggering unit -> triggering player. That works faster and produces the same result.
Store the Key(Triggering unit) into an integer variable, and use the variable when you save stuff into hashtable. Same for Key(Picked unit) in the loop when you save/load data.
Instead of storing the unit group into a variable, you could do this:
  • Custom script: set bj_wantDestroyGroup = true
  • Unit Group - Pick every unit in (Units within 500 of...)
The boolean will ensure that the group is destroyed after it is used. This works faster than setting the group into a variable.
Remove unnecessary variables, like point4 and point5. You could use point1 and point2 instead of those for example.
The knockback speed could decrease during every loop, now the units just stop abruptly.
 
Top