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

[Trigger] Trying to do a GUI 3-hit combo, it's not working

Status
Not open for further replies.
Level 3
Joined
Jul 3, 2013
Messages
25
Trying to do a triggered 3-hit combo (non-JASS), it's not working

  • Events
    • Unit - A unit Starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to Triple Dragon Claw
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Level of Triple Dragon Claw for (Triggering unit)) Equal to 1
      • Then - Actions
        • Custom script: local unit udg_tripleHitCaster
        • Custom script: local unit udg_tripleHitTarget
        • Set tripleHitCaster = (Triggering unit)
        • Set tripleHitTarget = (Target unit of ability being cast)
        • Unit - Pause tripleHitCaster
        • Unit - Pause tripleHitTarget
        • Animation - Play tripleHitCaster's attack animation
        • Animation - Play tripleHitTarget's death animation
        • Unit - Cause tripleHitCaster to damage tripleHitTarget, dealing (50.00 + (0.25 x (Real((Agility of tripleHitCaster (Include bonuses)))))) damage of attack type Normal and damage type Normal
        • Wait 0.33 seconds
        • Animation - Play tripleHitCaster's attack animation
        • Animation - Play tripleHitTarget's death animation
        • Unit - Cause tripleHitCaster to damage tripleHitTarget, dealing (65.00 + (0.40 x (Real((Agility of tripleHitCaster (Include bonuses)))))) damage of attack type Normal and damage type Normal
        • Wait 0.33 seconds
        • Animation - Play tripleHitCaster's slam animation
        • Animation - Play tripleHitTarget's death animation
        • Unit - Cause tripleHitCaster to damage tripleHitTarget, dealing (100.00 + (0.80 x (Real((Agility of tripleHitCaster (Include bonuses)))))) damage of attack type Normal and damage type Normal
        • Unit - Unpause tripleHitCaster
        • Unit - Unpause tripleHitTarget
        • Set tripleHitCaster = No unit
        • Set tripleHitTarget = No unit
      • Else - Actions
Every time I try to enable the trigger, it gives me an "Expected 'endif'" error on two specific lines:

local unit udg_tripleHitCaster
local unit udg_tripleHitTarget

What should I do to fix it?

-Edit-

I tried putting it at the beginning of the trigger (before the if/then/else function) and while it does let me enable the trigger, the 3 attacks end up continuously looping until the target dies. That isn't exactly what I had in mind xD

Also, this is more of a minor detail than anything, but the 'slam' animation is the one for a critical strike, correct? I wanted to make it seem like 2 attacks and then one big one for the finisher.
 
Last edited:
Level 3
Joined
Jul 3, 2013
Messages
25
Is it possible because you have an extra "I" here?

  • Custom script: local unit udg_tripleHiitTarget
Nothing else seems to be jumping out at me, but maybe I'm too tired :grin:

I doubt it, otherwise it wouldn't have picked up an error on the second line either.

I just checked and changed it, no change.

Also, I tried looking up global variables, but it says that I should right-click the lower left area of the trigger editor, which doesn't give me new->variable at all.

I tried clicking on the orange 'x' for the variable list and adding it manually like that - no dice either.

Unless I have to redo the trigger from scratch? Not like I don't have the time to (I'm sick so I don't really get out atm) but it's a pain to retype everything
 
Level 3
Joined
Jul 3, 2013
Messages
25
keep things simple and add a 0.01 wait before the spell starts

Sorry I'm kinda slow, but what would that help with? The only thing I'd see this do is maybe stop the looping, but then I'd have to get the trigger to work to begin with (and just moving the scriptlines isn't going to help much considering it creates deadweight lines in the trigger)
 
Level 17
Joined
Jul 17, 2011
Messages
1,864
using locals this way does not work because the if then else gets converted into separate jass functions when you save the map thus the local ends up being in a separate function and cannont be acessed by the right calls thus the syntax changes and you get an error to solve this simply use regular gui user defined variables you create in the variable editor
its very incovinient i guess but gui was not meant to be compatible with jass
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
@TO
the double i in here needs to be removed or it wont work.
  • Custom script: local unit udg_tripleHiitTarget
that will stop this from working.
also the unexpected endif is because u use a custom script with if things here.
u need to find it and put an endif at the end. it is not in this trigger.
Also the custom script u use is JASS
u should take a look at my tutorial called things a GUIer should know to understand triggers a little more.

@chaosy
shadowing locals is fine to use.

@gorillabull
that last statement was kinda bad considering that GUI gets translated into jass upon saving. There are a few things that when translated get messed up like how they call other functions rather than just having the condition in the ITE.
 
Level 3
Joined
Jul 3, 2013
Messages
25
I'll try what you guys are saying but I really am new to this, so most of the stuff here is going way over my head @-@

You need a cooldown on your spell, if you don't have a cooldown it will keep casting the spell over and over again once the unit is unpaused.

It has a 1 second cooldown. Maybe that's the problem why it's looping?

-Edit-

So far the seems to have fixed the problem, having the 0.33 second waits just made it bypass the 1 second cooldown. Maybe.

I'll come back here if additional bugs arise from the trigger.
 
You need a cooldown on your spell, if you don't have a cooldown it will keep casting the spell over and over again once the unit is unpaused.

I like this answer. If your spell duration lasts any amount of time the trigger will continue firing until the duration ends (maybe its cooldown but I think its "spell durration").

Many times people look for solutions with more GUI triggers or Jass when the answer is really in OE.

I always check the simplest possible solutions first and work my way up.

Jass is better of course but it seems like you have a simple spell that should work and produce a really cool result so I see no reason to start over or learn jass now. Though I recommend learning it in the near future.
 
Status
Not open for further replies.
Top