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

[Trigger] What's wrong with this MUI system?

Status
Not open for further replies.
Level 9
Joined
Oct 11, 2009
Messages
477
As the title says..... Anyway I wanna ask what is wrong with my Hashtable-based MUI Knockback System... I used weep's damage detection system. Here are the triggers:


  • Initialize Knockback Hashtable
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set KnockbackHashtable = (Last created hashtable)


  • Start Knockback
    • Events
      • Game - GDD_Event becomes Equal to 0.00
    • Conditions
      • (Level of Knockback (Item Skill) for GDD_DamageSource) Greater than 0
      • (Random integer number between 1 to 100) Less than 31
    • Actions
      • Unit Group - Add GDD_DamageSource to KnockbackKnockingUnits
      • Unit Group - Add GDD_DamagedUnit to KnockbackKnockedUnits
      • Unit Group - Pick every unit in KnockbackKnockingUnits and do (Actions)
        • Loop - Actions
          • Hashtable - Save Handle Of(Position of (Picked unit)) as (Key location2) of (Key (Picked unit)) in KnockbackHashtable


  • Knocking Back
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in KnockbackKnockingUnits and do (Actions)
        • Loop - Actions
          • Hashtable - Save Handle Of(Picked unit) as 0 of (Key knocking unit) in KnockbackHashtable
          • Unit Group - Pick every unit in KnockbackKnockedUnits and do (Actions)
            • Loop - Actions
              • Hashtable - Save Handle Of(Position of (Picked unit)) as (Key location) of (Key (Picked unit)) in KnockbackHashtable
              • Hashtable - Save ((Load (Key distance) of (Key (Picked unit)) from KnockbackHashtable) + 4.50) as (Key distance) of (Key (Picked unit)) in KnockbackHashtable
              • Hashtable - Save Handle Of((Load (Key location) of (Key (Picked unit)) in KnockbackHashtable) offset by 4.50 towards (Angle from (Load (Key location) of (Key (Picked unit)) in KnockbackHashtable) to (Load (Key location2) of (Key (Load 0 of (Key knocking unit) in KnockbackHashtable)) i as (Key location3) of (Key (Picked unit)) in KnockbackHashtable
              • Hashtable - Save Handle Of((Load (Key location3) of (Key (Picked unit)) in KnockbackHashtable) offset by 8.00 towards (Angle from (Load (Key location) of (Key (Picked unit)) in KnockbackHashtable) to (Load (Key location2) of (Key (Load 0 of (Key knocking unit) in KnockbackHashtable)) as (Key location4) of (Key (Picked unit)) in KnockbackHashtable
              • Destructible - Pick every destructible within 192.50 of (Load (Key location4) of (Key (Picked unit)) in KnockbackHashtable) and do (Destructible - Kill (Picked destructible))
              • Custom script: call RemoveLocation( LoadLocationHandleBJ(StringHash("location4"),GetHandleIdBJ(GetEnumUnit()),udg_KnockbackHashtable))
              • Special Effect - Create a special effect at (Load (Key location3) of (Key (Picked unit)) in KnockbackHashtable) using Abilities\Spells\Human\FlakCannons\FlakTarget.mdl
              • Special Effect - Destroy (Last created special effect)
              • Unit - Move (Picked unit) instantly to (Load (Key location3) of (Key (Picked unit)) in KnockbackHashtable)
              • Custom script: call RemoveLocation( LoadLocationHandleBJ( StringHashBJ("location"), GetHandleIdBJ(GetEnumUnit()), udg_KnockbackHashtable ))
              • Custom script: call RemoveLocation( LoadLocationHandleBJ( StringHashBJ("location3"), GetHandleIdBJ(GetEnumUnit()), udg_KnockbackHashtable ))
              • Unit - Cause (Load 0 of (Key knocker) in KnockbackHashtable) to damage (Picked unit), dealing 0.45 damage of attack type Normal and damage type Normal
              • Hashtable - Save Handle Of(Units within 200.00 of (Load (Key location4) of (Key (Picked unit)) in KnockbackHashtable) matching (((Matching unit) is alive) Equal to True)) as 0 of (Key excess units) in KnockbackHashtable
              • Hashtable - Save Handle Of(Picked unit) as 0 of (Key knocked unit) in KnockbackHashtable
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Or - Any (Conditions) are true
                    • Conditions
                      • (Number of units in (Load 0 of (Key excess units) in KnockbackHashtable)) Greater than 0
                      • (Load (Key distance) of (Key (Picked unit)) from KnockbackHashtable) Greater than 249.99
                      • ((Picked unit) is dead) Equal to True
                • Then - Actions
                  • Unit Group - Remove (Picked unit) from KnockbackKnockedUnits
                  • Custom script: call RemoveLocation( LoadLocationHandleBJ( StringHashBJ("location2"), GetHandleIdBJ(LoadUnitHandleBJ( 0, StringHashBJ("knocking unit"), udg_KnockbackHashtable )), udg_KnockbackHashtable ))
                  • Hashtable - Save 0.00 as (Key distance) of (Key (Picked unit)) in KnockbackHashtable
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Number of units in (Load 0 of (Key excess units) in KnockbackHashtable)) Greater than 0
                    • Then - Actions
                      • Unit Group - Pick every unit in (Load 0 of (Key excess units) in KnockbackHashtable) and do (Actions)
                        • Loop - Actions
                          • Unit - Cause (Load 0 of (Key knocker) in KnockbackHashtable) to damage (Picked unit), dealing (250.00 - (Load (Key distance) of (Key (Load 0 of (Key knocked unit) in KnockbackHashtable)) from KnockbackHashtable)) damage of attack type Normal and damage type Normal
                          • Special Effect - Create a special effect attached to the foot of (Picked unit) using Abilities\Weapons\AncientProtectorMissile\AncientProtectorMissile.mdl
                      • Custom script: call DestroyGroup( LoadGroupHandleBJ(0,StringHash("excess units"),udg_KnockbackHashtable))
                    • Else - Actions
                • Else - Actions


Thanks in advance!:grin::grin:
 
Level 9
Joined
Oct 11, 2009
Messages
477
What's wrong about it? It perfectly works but when the system initializes, the unit in the group is not knockbacked and is still moving freely.....


Help me please.....
 
Level 17
Joined
Jun 17, 2010
Messages
2,275
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  • If - Conditions
  • Or - Any (Conditions) are true
  • Conditions
  • (Number of units in (Load 0 of (Key excess units) in KnockbackHashtable)) Greater than 0
  • (Load (Key distance) of (Key (Picked unit)) from KnockbackHashtable) Greater than 249.99
  • ((Picked unit) is dead) Equal to True
  • Then - Actions
  • Unit Group - Remove (Picked unit) from KnockbackKnockedUnits
  • Custom script: call RemoveLocation( LoadLocationHandleBJ( StringHashBJ("location2"), GetHandleIdBJ(LoadUnitHandleBJ( 0, StringHashBJ("knocking unit"), udg_KnockbackHashtable )), udg_KnockbackHashtable ))
  • Hashtable - Save 0.00 as (Key distance) of (Key (Picked unit)) in KnockbackHashtable
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  • If - Conditions
  • (Number of units in (Load 0 of (Key excess units) in KnockbackHashtable)) Greater than 0
  • Then - Actions
  • Unit Group - Pick every unit in (Load 0 of (Key excess units) in KnockbackHashtable) and do (Actions)
  • Loop - Actions
  • Unit - Cause (Load 0 of (Key knocker) in KnockbackHashtable) to damage (Picked unit), dealing (250.00 - (Load (Key distance) of (Key (Load 0 of (Key knocked unit) in KnockbackHashtable)) from KnockbackHashtable)) damage of attack type Normal and damage type Normal
  • Special Effect - Create a special effect attached to the foot of (Picked unit) using Abilities\Weapons\AncientProtectorMissile\AncientProtectorMissile.mdl
  • Custom script: call DestroyGroup( LoadGroupHandleBJ(0,StringHash("excess units"),udg_KnockbackHashtable))
  • Else - Actions
  • Else - Actions
in this mutliple actions you remove the units in the unit group and then activate the other multiple actions that does damage to the unit group which you just removes, is that multi action in "Then" supposed to be in "Else" because it looks like that might be it
 
Level 11
Joined
Jan 25, 2009
Messages
572
  • Unit - Cause (Load 0 of (Key knocker) in KnockbackHashtable) to damage (Picked unit), dealing 0.45 damage of attack type Normal and damage type Normal
Shouldn't this be

  • Unit - Cause (Load (Key knocker) of (Key (Picked Unit)) in KnockbackHashtable) to damage (Picked unit), dealing 0.45 damage of attack type Normal and damage type Normal
 
Level 17
Joined
Jun 17, 2010
Messages
2,275
who are the knockkockbackunits? is your variable set to the correct unit group? Post all your variables that are set that you used for this trigger

Edit: Heres what i think, if it doesnt even damage the units then there are no units in the unit group. Damage usually always happens unless its not triggered correctly or there are no units to damage, If it was only knockback but still damage it would be a different problem
 
Status
Not open for further replies.
Top