• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[trigger]Unit - begins casting ability (GUI not working)

Status
Not open for further replies.
[SOLVED] Unit - begins casting ability (GUI not working)

So I want to create an event using
  • Unit - Unit begins casting an ability
And the a conditions
  • (ability being cast) Equal to "Hero Bonus On"
For some reason a few of the actions that follow are working but not all of them. For example a "special effect" works and a "sound" plays, however, the "Unit - add ability" action fails along with the "turn on "x trigger" and "turn off (this trigger)". I tried using "channel" as the dummy spell and I tried with "war stomp." I've looked at several tutorials and they seem to be telling me that this should work but its not working. The simplest way to state my question is this - How can I create an Event which starts when a ability icon is clicked, that turns on a trigger. I know this is an easy question and there must be a tutorial on it but I can't find one that works. Thanks in advance for any and all input.
 
Last edited:
sorry, I'm at work. I don't have the full trigger here, but I will add it when I get home. The trigger worked fine with
  • Player - (Player One (Red)) presses down arrow
But, I want to use a spell icon rather than an arrow key. I tried using "begins casting," "begins channeling" and "starts the effect of an ability," I had some luck with channeling but still I couldn't turn it off which means, the "turn on (gen_trigger x)" action was not working. I'm sorry for the incomplete trigger, I will post it soon.
 
Last edited:
  • Returns to Lock
    • Events
      • Unit - A unit owned by Player 1 (Red) Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Bonus On
    • Actions
      • Trigger - Turn on Camera Locks unit <gen>
      • Trigger - Turn on Reset Camera <gen>
      • Trigger - Turn on Reset attributes <gen>
      • Camera - Change camera smoothing factor to 0.00
      • Camera - Set Player 1 (Red)'s camera Distance to target to 800.00 over 0.30 seconds
      • Unit - Set Red_Unit movement speed to ((Current movement speed of Red_Unit) + 150.00)
      • Unit - Add Trigger Hero Stat Bonus (+8 All Stats) to (Triggering unit)
      • If ((Red_Unit is A Hero) Equal to True) then do (Special Effect - Create a special effect attached to the origin of Red_Unit using Abilities\Spells\Human\Resurrect\ResurrectTarget.mdl) else do (Do nothing)
      • If ((Red_Unit is A Hero) Equal to True) then do (Special Effect - Create a special effect attached to the hand, right of Red_Unit using Abilities\Weapons\FaerieDragonMissile\FaerieDragonMissile.mdl) else do (Do nothing)
      • Set Fx1[1] = (Last created special effect)
      • If ((Red_Unit is A Hero) Equal to True) then do (Special Effect - Create a special effect attached to the hand, left of Red_Unit using Abilities\Weapons\FaerieDragonMissile\FaerieDragonMissile.mdl) else do (Do nothing)
      • Set Fx1[2] = (Last created special effect)
      • Sound - Play ShimmeringPortalEntrance <gen> at 100.00% volume, attached to hero1
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Red_Unit is A Hero) Equal to True
        • Then - Actions
          • Animation - Change hero1's animation speed to 20.00% of its original speed
          • Wait 0.70 seconds
          • Animation - Change hero1's size to (105.00%, 105.00%, 108.00%) of its original size
          • Wait 0.30 seconds
          • Animation - Change hero1's size to (113.00%, 113.00%, 117.00%) of its original size
        • Else - Actions
      • Trigger - Turn off (This trigger)
So here it is. The only actions which seems to be working in this version is ...
  • If ((Red_Unit is A Hero) Equal to True) then do (Special Effect - Create a special effect attached to the origin of Red_Unit using Abilities\Spells\Human\Resurrect\ResurrectTarget.mdl) else do (Do nothing)
  • Sound - Play ShimmeringPortalEntrance <gen> at 100.00% volume, attached to hero1
Any thoughts?
 
Last edited:
if the unit is a custom model it might not have right or left hand attachment points.
u leak a special effect. this is also not MUI but i guess thats ok if ur turning it off after one cast.

Also were do u set red unit ? if u have this for each player it can be simplified into one trigger.

Its not a custom model, and the trigger works fine when I use a Keyboard Event. I just tested it with the key triggers, everything glows like its supposed to. I also destroy the effects in another trigger which is turned on by this triggers, so it shouldn't leak.

I'm starting to think the problem is in Object Editor.

OEscreenie_zps3c3d32e8.jpg
If needed I can scroll this screenie up or down. I think I captured the important parts. As I mentioned this is "war stomp" customized.

  • Sets unit Variable
    • Events
      • Player - Player 1 (Red) Selects a unit
    • Conditions
    • Actions
      • Set Red_Unit = (Triggering unit)
 
Last edited by a moderator:
plz do not double post.
make sure the unit is set b4 the ability thing. u should actually set the unit in the ability trigger as it will prevent bugs.
this line leaks.
  • If ((Red_Unit is A Hero) Equal to True) then do (Special Effect - Create a special effect attached to the origin of Red_Unit using Abilities\Spells\Human\Resurrect\ResurrectTarget.mdl) else do (Do nothing)
u never set it to a special effect after its created.
 
plz do not double post.
make sure the unit is set b4 the ability thing. u should actually set the unit in the ability trigger as it will prevent bugs.
this line leaks.
  • If ((Red_Unit is A Hero) Equal to True) then do (Special Effect - Create a special effect attached to the origin of Red_Unit using Abilities\Spells\Human\Resurrect\ResurrectTarget.mdl) else do (Do nothing)
u never set it to a special effect after its created.

Sorry for the double post. I forgot to answer part of your question, next time I'll edit and add to the original post. Sorry about that.

I can destroy the special effect as you said but though that may fix the leak that does not fix the problem. (I will fix the leak anyway) As I mentioned, the trigger is working fine with a Keyboard Selection Event so therefore the problem is with the Unit - Casts an Ability Event or its corresponding condition. This seems so simple, I don't know why I can't get it to work. Could it be the dummy spell in Object Editor?
 
  • Returns to Lock
    • Events
      • Unit - A unit owned by Player 1 (Red) Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Bonus On
    • Actions
      • Set Red_Unit = (Triggering unit)
      • Trigger - Turn on Camera Locks unit <gen>
      • Trigger - Turn on Reset Camera <gen>
      • Trigger - Turn on Reset attributes <gen>
      • Camera - Change camera smoothing factor to 0.00
      • Camera - Set Player 1 (Red)'s camera Distance to target to 800.00 over 0.30 seconds
      • Unit - Set Red_Unit movement speed to ((Current movement speed of Red_Unit) + 200.00)
      • Unit - Add Trigger Hero Stat Bonus (+8 All Stats) to Red_Unit
      • If ((Red_Unit is A Hero) Equal to True) then do (Special Effect - Create a special effect attached to the hand, right of Red_Unit using Abilities\Weapons\FaerieDragonMissile\FaerieDragonMissile.mdl) else do (Do nothing)
      • Set Fx1[1] = (Last created special effect)
      • If ((Red_Unit is A Hero) Equal to True) then do (Special Effect - Create a special effect attached to the hand, left of Red_Unit using Abilities\Weapons\FaerieDragonMissile\FaerieDragonMissile.mdl) else do (Do nothing)
      • Set Fx1[2] = (Last created special effect)
      • If ((Red_Unit is A Hero) Equal to True) then do (Special Effect - Create a special effect attached to the origin of Red_Unit using Abilities\Spells\Human\Resurrect\ResurrectTarget.mdl) else do (Do nothing)
      • Set Fx1[3] = (Last created special effect)
      • Sound - Play ShimmeringPortalEntrance <gen> at 100.00% volume, attached to hero1
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Red_Unit is A Hero) Equal to True
        • Then - Actions
          • Wait 1.00 seconds
          • Animation - Change hero1's animation speed to 20.00% of its original speed
          • Wait 1.00 seconds
          • Animation - Change hero1's size to (113.00%, 113.00%, 117.00%) of its original size
        • Else - Actions
      • Trigger - Turn off (This trigger)
Is this what you meant? So this didn't work but it was interesting. It seemed to activate both triggers at once, leaving me right back where I started, which makes no sense. Mostly because the "bonus off" trigger is initially off and only gets turned on once the "bonus on" trigger happens.

EDIT:
Ok, so this was the problem. 1st I had the trigger wrong. Once I got the right trigger from you. Both triggers were going off at once because of the cooldown time in OE. I added the "turn trigger on" action to after the "wait" and batta bing! magic! Here is the working version, if anyone reads this and wants to know.
  • Returns to Lock
    • Events
      • Unit - A unit owned by Player 1 (Red) Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Bonus On
    • Actions
      • Set Red_Unit = (Triggering unit)
      • Camera - Change camera smoothing factor to 0.00
      • Unit - Set Red_Unit movement speed to ((Current movement speed of Red_Unit) + 200.00)
      • Unit - Add Trigger Hero Stat Bonus (+8 All Stats) to Red_Unit
      • If ((Red_Unit is A Hero) Equal to True) then do (Special Effect - Create a special effect attached to the hand, right of Red_Unit using Abilities\Weapons\FaerieDragonMissile\FaerieDragonMissile.mdl) else do (Do nothing)
      • Set Fx1[1] = (Last created special effect)
      • If ((Red_Unit is A Hero) Equal to True) then do (Special Effect - Create a special effect attached to the hand, left of Red_Unit using Abilities\Weapons\FaerieDragonMissile\FaerieDragonMissile.mdl) else do (Do nothing)
      • Set Fx1[2] = (Last created special effect)
      • If ((Red_Unit is A Hero) Equal to True) then do (Special Effect - Create a special effect attached to the origin of Red_Unit using Abilities\Spells\Human\Resurrect\ResurrectTarget.mdl) else do (Do nothing)
      • Set Fx1[3] = (Last created special effect)
      • Sound - Play ShimmeringPortalEntrance <gen> at 100.00% volume, attached to hero1
      • Trigger - Turn on Camera Locks unit <gen>
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Red_Unit is A Hero) Equal to True
        • Then - Actions
          • Wait 1.00 seconds
          • Animation - Change hero1's animation speed to 20.00% of its original speed
          • Wait 1.00 seconds
          • Animation - Change hero1's size to (113.00%, 113.00%, 117.00%) of its original size
          • Trigger - Turn on Reset attributes <gen>
          • Trigger - Turn on Reset Camera <gen>
        • Else - Actions
      • Trigger - Turn off (This trigger)
You get this alot, I know because I read the forums, but thank you so much. You help people for no reason other than to be nice and thats truly remarkable. You inspire me to help others in return. [solved]
 
Last edited:
Status
Not open for further replies.
Top