• 🏆 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] Dash MUI

Status
Not open for further replies.
Level 3
Joined
Aug 18, 2009
Messages
21
Dash With Damage MUI

Greetings... Could you please help me with this code. It's supposed to be a dash skill that deals damage once when you hit a unit. I'm trying to use the GUI Unit Indexer by Bribe but I can't get it to work. It deals continuous damage to a unit even though it's hit. I hope you guys could help me.
These are the triggers I made:
  • Dash
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Light Strike
    • Actions
      • Set DashKey = (Custom value of (Triggering unit))
      • Set DashCaster[DashKey] = (Triggering unit)
      • Set Location[1] = (Position of (Triggering unit))
      • Set DashAngle[DashKey] = (Facing of (Triggering unit))
      • Set DashHitGroup[DashKey] = DashHitGroup[DashKey]
      • Set DashDist[DashKey] = 0.00
      • Unit Group - Remove all units from DashHitGroup[DashKey]
      • Custom script: call RemoveLocation(udg_Location[1])
      • Unit Group - Add (Triggering unit) to DashHit
      • Unit - Pause (Triggering unit)
  • Dasg Mov
    • Events
      • Time - Every 0.04 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in DashHit and do (Actions)
        • Loop - Actions
          • Set DashKey = (Custom value of (Picked unit))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Integer(DashDist[DashKey])) Less than 350
            • Then - Actions
              • Set Location[1] = ((Position of DashCaster[DashKey]) offset by 30.00 towards DashAngle[DashKey] degrees)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Terrain pathing at Location[1] of type Walkability is off) Equal to True
                  • ((Unit-type of DashCaster[DashKey]) is Snared) Equal to True
                • Then - Actions
                • Else - Actions
                  • Unit - Move DashCaster[DashKey] instantly to Location[1]
              • Special Effect - Create a special effect at Location[1] using adad
              • Special Effect - Destroy (Last created special effect)
              • Custom script: set bj_wantDestroyGroup = true
              • Unit Group - Pick every unit in (Units within 150.00 of Location[1] matching (((Matching unit) belongs to an enemy of (Owner of DashCaster[DashKey])) Equal to True)) and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ((Picked unit) is alive) Equal to True
                      • ((Picked unit) belongs to an enemy of (Owner of DashCaster[DashKey])) Equal to True
                      • ((Picked unit) is Mechanical) Equal to False
                      • ((Picked unit) is in DashHitGroup[DashKey]) Equal to False
                    • Then - Actions
                      • Unit Group - Add (Picked unit) to DashHitGroup[DashKey]
                      • Set DamageEventType = DamageTypePhysical
                      • Unit - Cause DashCaster[DashKey] to damage (Picked unit), dealing (0.00 + (1.00 x (Real((Agility of DashCaster[DashKey] (Include bonuses)))))) damage of attack type Hero and damage type Normal
                      • Custom script: call RemoveLocation(udg_Location[1])
                    • Else - Actions
              • Custom script: call RemoveLocation(udg_Location[1])
              • Set DashDist[DashKey] = (DashDist[DashKey] + 30.00)
            • Else - Actions
              • Unit - Unpause DashCaster[DashKey]
              • Unit Group - Remove (Picked unit) from DashHit
 
Last edited:
Level 4
Joined
Jul 19, 2008
Messages
37
Shouldn't
  • Set DashKey = (Custom value of (Triggering unit))
be at the top of the Dash trigger or?

And your replacing the Value of Dash key every 0.04 seconds. That could interfere with your periodic trigger. Try replacing every DashKey in your Periodic trigger to another integer variable.
 

Cokemonkey11

Spell Reviewer
Level 30
Joined
May 9, 2006
Messages
3,537
Actually, he is using hash tables. He's referencing sets of data using an id which comes from a key (unit custom value)

Just because he's not using the hashtable data type, doesn't mean he isn't using hash tables, which by the way are a real programming concept ( http://en.wikipedia.org/wiki/Hash_table )

I chose not to ignore this thread because I can offer sound GUI advice, and after reading the original post and judging Cyberend's obvious understanding of basic programming, I chose to suggest learning jass instead of struggling with implementing hash tables in this trashcan that some people still insist on using.

So now rather than questioning my logic, why don't you offer a better solution?
 
Level 3
Joined
Aug 18, 2009
Messages
21
Ugh guys lets not create conflict in this thread or something...
I'm sorry but I'm to lazy to learn jass. It might take me a month or so just to memorize the function names etc. So I just want to use gui because I just click for the functions to show up. Again sorry and if you could please help me resolve this crappy trigger >_<
 

Cokemonkey11

Spell Reviewer
Level 30
Joined
May 9, 2006
Messages
3,537
Try adding this -

pick every unit in unit group DashHitGroup[DashKey] and do multiple actions
-set fx=AddSpecialEffect(Position of picked unit)
-destroy effect fx

This will help you see if any units are being added to the group in the first place. (alternatively you could just display the units names in a debug message)

Edit: Have you called "create group" on the DashHitGroup array? (I don't know if you have to call this in GUI or not)
 
Level 3
Joined
Aug 18, 2009
Messages
21
Hmmm ok thanks. It does not add those units to the group. Any ideas what may have caused the problem? I originally made it as a hashtable skill but it gave the same errors so I made it using Bribe's unit indexer.
 
Level 11
Joined
Nov 15, 2007
Messages
781
It does not crash but it did not resolve the issue. Thanks for your help. For now I just made the unit group as a non array group. It worked but I'm not sure if it;s fully MUI.

It isn't. The same unit won't be able to be damaged by simultaneous dashes from two different units.

And this problem is strange. I wonder if you could post the map, or copy/paste the offending triggers and abilities into a test map?
 
Status
Not open for further replies.
Top