• 🏆 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!
  • ✅ HD Level Design Contest #1 POLL is now OPEN! Check out the stunning visuals of the final entries. 🔗Click here to cast your vote!

[Trigger] 3 Hit Combo Ability

Status
Not open for further replies.
Level 1
Joined
Jun 21, 2009
Messages
282
I'm not sure if this spell is leakless, multiple players with different heroes will use this so i'm not sure if this spell will bug up because of that, I used waits in this ability so i'm not sure, please check this out and tell me if its okay for more than 1 player are able to use it at the same time.

  • Three Hit Combo Process
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to 3 Hit Combo
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of 3 Hit Combo for (Triggering unit)) Equal to 1
        • Then - Actions
          • Unit - Pause (Target unit of ability being cast)
          • Unit - Pause (Triggering unit)
          • Animation - Play (Triggering unit)'s attack animation
          • Animation - Play (Target unit of ability being cast)'s death animation
          • Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing 15.00 damage of attack type Normal and damage type Normal
          • Wait 0.33 seconds
          • Animation - Play (Triggering unit)'s attack animation
          • Animation - Play (Target unit of ability being cast)'s death animation
          • Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing 15.00 damage of attack type Normal and damage type Normal
          • Wait 0.33 seconds
          • Animation - Play (Triggering unit)'s attack animation
          • Animation - Play (Target unit of ability being cast)'s death animation
          • Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing 15.00 damage of attack type Normal and damage type Normal
          • Unit - Unpause all units
        • Else - Actions
 
Level 7
Joined
Apr 1, 2010
Messages
289
you should use locals it will make the whole thing more efficient
so you should use:
  • Custom Script: local unit udg_triggering
  • Custom Script: local unit udg_target
and create some global unit variables called triggering, and target.
but as it is its mui, but not very efficient.
 
Level 1
Joined
Jun 21, 2009
Messages
282
Like this?

  • Three Hit Combo Process
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to 3 Hit Combo
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of 3 Hit Combo for (Triggering unit)) Equal to 1
        • Then - Actions
          • Custom script: local unit udg_caster3hitcombo
          • Custom script: local unit udg_targetof3hitcombo
          • Unit - Pause targetof3hitcombo
          • Unit - Pause caster3hitcombo
          • Animation - Play caster3hitcombo's attack animation
          • Animation - Play targetof3hitcombo's death animation
          • Unit - Cause caster3hitcombo to damage targetof3hitcombo, dealing 15.00 damage of attack type Normal and damage type Normal
          • Wait 0.33 seconds
          • Animation - Play caster3hitcombo's attack animation
          • Animation - Play targetof3hitcombo's death animation
          • Unit - Cause caster3hitcombo to damage targetof3hitcombo, dealing 15.00 damage of attack type Normal and damage type Normal
          • Wait 0.33 seconds
          • Animation - Play caster3hitcombo's attack animation
          • Animation - Play targetof3hitcombo's death animation
          • Unit - Cause caster3hitcombo to damage targetof3hitcombo, dealing 15.00 damage of attack type Normal and damage type Normal
          • Unit - Unpause targetof3hitcombo
          • Unit - Unpause caster3hitcombo
        • Else - Actions
Ehh.. i've done something wrong, tryed to test map and it came out as an error.
 
Level 7
Joined
Apr 1, 2010
Messages
289
you need to put the custom script at the start of the trigger, it has to do with the way you declare variables
  • Three Hit Combo Process
    • Events
    • Unit - A unit Starts the effect of an ability
    • Conditions
    • (Ability being cast) Equal to 3 Hit Combo
    • Actions
      • Custom script: local unit udg_caster3hitcombo
      • Custom script: local unit udg_targetof3hitcombo
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
    • (Level of 3 Hit Combo for (Triggering unit)) Equal to 1
    • Then - Actions
      • Unit - Pause targetof3hitcombo
      • Unit - Pause caster3hitcombo
      • Animation - Play caster3hitcombo's attack animation
      • Animation - Play targetof3hitcombo's death animation
      • Unit - Cause caster3hitcombo to damage targetof3hitcombo, dealing 15.00 damage of attack type Normal and damage type Normal
      • Wait 0.33 seconds
      • Animation - Play caster3hitcombo's attack animation
      • Animation - Play targetof3hitcombo's death animation
      • Unit - Cause caster3hitcombo to damage targetof3hitcombo, dealing 15.00 damage of attack type Normal and damage type Normal
      • Wait 0.33 seconds
      • Animation - Play caster3hitcombo's attack animation
      • Animation - Play targetof3hitcombo's death animation
      • Unit - Cause caster3hitcombo to damage targetof3hitcombo, dealing 15.00 damage of attack type Normal and damage type Normal
      • Unit - Unpause targetof3hitcombo
      • Unit - Unpause caster3hitcombo
      • Else - Actions
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
If you use Narogog's method then don't forget to null the variables at the end of the trigger.

Also note that a wait of 0.33 seconds produces values between 0.425 and 0.525 seconds in single player. At least on my computer. In multiplayer it can be even more unreliable.

  • If - Conditions
    • (Level of 3 Hit Combo for (Triggering unit)) Equal to 1
Where exactly did you find this Condition Trigger?

It is an integer comparison, Unit - level of ability.
 
Level 5
Joined
Jul 16, 2009
Messages
88
I wouldn't say it leaks, but I would advice you to make a periodic event trigger just to play safe.

You probably wanted to do less work, so here's a thread for you to read through. Self-assurance while others are helping you as well. =)

Here's a small mistake that I've noticed at the end of your first trigger:
  • Unit - Unpause all units
This will unpause units of other instances. Instead, try using:
  • Unit - Unpause (Triggering unit)
  • Unit - Unpause (Target of ability being cast)
Doing so will specify only 2 units to be unpaused.
 
Level 13
Joined
Mar 16, 2008
Messages
941
What the hell is going on here. Such a load of mistakes and nobody saying anything?
First: this is not even MUI at all. Waits allow "Triggering unit" but kill all references to all other units like "Target unit of ability being cast".
So, you will NEED locals (or a system with multiple triggers).
Then, for gods sake: If people recommend to use locals in GUI, make it correct!
a) The locals need to be declared in the IF-block. If-blocks are new functions in GUI what makes it impossible to use locals from outside it
b) Assign the values. You didn't even assign them? try this:

  • Three Hit Combo Process
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to 3 Hit Combo
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of 3 Hit Combo for (Triggering unit)) Equal to 1
        • Then - Actions
          • Custom script: local unit udg_threeHitCaster
          • Custom script: local unit udg_threeHitTarget
          • set threeHitCaster = Triggering Unit
          • set threeHitTarget = Target unit of ability being cast
          • Unit - Pause (threeHitTarget)
          • Unit - Pause (threeHitCaster)
          • Animation - Play (threeHitCaster)'s attack animation
          • Animation - Play (Target unit of ability being cast)'s death animation
          • Unit - Cause (threeHitCaster ) to damage (threeHitTarget), dealing 15.00 damage of attack type Normal and damage type Normal
          • Wait 0.33 seconds
          • Animation - Play (threeHitCaster)'s attack animation
          • Animation - Play (threeHitTarget)'s death animation
          • Unit - Cause (threeHitCaster) to damage (threeHitTarget), dealing 15.00 damage of attack type Normal and damage type Normal
          • Wait 0.33 seconds
          • Animation - Play (threeHitCaster)'s attack animation
          • Animation - Play (threeHitTarget)'s death animation
          • Unit - Cause (Triggering unit) to damage (threeHitTarget), dealing 15.00 damage of attack type Normal and damage type Normal
          • Unit - Unpause (threeHitTarget)
          • Unit - Unpause (threeHitCaster)
          • set threeHitCaster = no unit
          • set threeHitTarget = no unit
        • Else - Actions
However, keep in mind that Pause-Functions are NEVER mui unless you use a stack for this which counts how long units are paused. New casts of this spell will be unpaused earlier by the first cast.

EDIT: Don't forget to create two globals: threeHitTarget and threeHitCaster.
 
Level 5
Joined
Jul 16, 2009
Messages
88
What the hell is going on here. Such a load of mistakes and nobody saying anything?
Read the first post PROPERLY!! The thread starter is just asking whether it is MUI or not. He isn't asking for ANY corrections!!

Instead of pointing out mistakes so abruptly, please acknowledge others that you are offering some probably better solution.

Thanks.
 
Level 9
Joined
Dec 12, 2007
Messages
489
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Level of 3 Hit Combo for (Triggering unit)) Equal to 1
    • Then - Actions
      • Custom script: local unit udg_threeHitCaster
      • Custom script: local unit udg_threeHitTarget
      • set threeHitCaster = Triggering Unit
      • set threeHitTarget = Target unit of ability being cast

like narogog already said, it should be like this:
  • Custom script: local unit udg_threeHitCaster
  • Custom script: local unit udg_threeHitTarget
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Level of 3 Hit Combo for (Triggering unit)) Equal to 1
    • Then - Actions
      • set threeHitCaster = Triggering Unit
      • set threeHitTarget = Target unit of ability being cast
local variable declaration can't be done inside an if.
and can only be done at the start of the script.
 
Level 13
Joined
Mar 16, 2008
Messages
941
@yurneric: The mistakes were done by all, not only by Itachi.
@Dark Axl: Wrong. All If-Conditions in GUI are new functions, allowing you (no, even forcing you) to create locals there or it won't work. All locals have to be declared at the start of the function they are local to, and that is the IF-condition due to the amazing bad coded GUI from blizzard.
 
Level 9
Joined
Dec 12, 2007
Messages
489
@Dark Axl: Wrong. All If-Conditions in GUI are new functions, allowing you (no, even forcing you) to create locals there or it won't work. All locals have to be declared at the start of the function they are local to, and that is the IF-condition due to the amazing bad coded GUI from blizzard.

ah yes, my bad... have forgotten how the code flows in GUI...
but if i remember correctly, not all If-Conditions in GUI will root in another new function, for example the single action of If-Conditions (not the multi action one), or not?

meh, i guess i should halt myself when responding to GUI questions now.
 
Status
Not open for further replies.
Top