• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

Keyboard Events

Status
Not open for further replies.
Level 13
Joined
Mar 24, 2013
Messages
1,105
I'm having a problem with my trigger and I'm not entirely sure why it doesn't work. I believe Owner of OwnerDetector 0013 <gen> Presses the Up Arrow Key is not working. Because I put a Print message to test and it wasn't firing, but I don't know why.

  • Mana Ball
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Mana Ball
    • Actions
      • Set ManaBall_Caster = (Casting unit)
      • Set ManaBall_DetectOwner = (Owner of ManaBall_Caster)
      • Unit - Change ownership of OwnerDetector 0013 <gen> to ManaBall_DetectOwner and Change color
      • Unit - Create 1 Ball for (Owner of ManaBall_Caster) at ((Position of ManaBall_Caster) offset by 100.00 towards 90 degrees) facing Default building facing degrees
      • Unit - Add a 10.00 second Generic expiration timer to (Last created unit)
      • Set ManaBall_Dummy = (Last created unit)
      • Camera - Lock camera orientation for (Owner of ManaBall_Caster) to ManaBall_Dummy, offset by (0.00, 0.00)
      • Wait 0.10 seconds
      • Trigger - Turn on Mana Ball Up <gen>
      • Wait 10.00 seconds
      • Unit - Change ownership of OwnerDetector 0013 <gen> to Neutral Passive and Change color
      • Trigger - Turn off Mana Ball Up <gen>
  • Mana Ball Up
    • Events
      • Player - (Owner of OwnerDetector 0013 <gen>) Presses the Up Arrow key
    • Conditions
    • Actions
      • Unit - Move ManaBall_Dummy instantly to ((Position of ManaBall_Dummy) offset by 12.00 towards 90.00 degrees)
 
I am a bit tired so excuse me if I overlook something obvious. But maybe you are holding the up arrow key while the trigger Mana Ball Up is still turned off, instead of pressing the up arrow key as soon as the trigger Mana Ball Up is turned on (so release it and than press it). Try tapping the up arrow key very fast, as see if that does something.

Also positions leak (move to) and the offset leaks too.
 
He said that the trigger doesn't work at all, as he said he made debug massages and they did not show up.

I can't see the problem, but I'd recommend making debug triggers like -debug massage returning index of player being the owner of OwnerDetector 0013 <gen>, maybe there's the problem.

Debug massages are very helpful, I use the all the time.
 
Events are predefined from the start of the game, i.e. they are defined before any trigger runs. So even if you define OwnerDetector in another trigger, its value in the event will still be null and the second trigger will not work. That is the reason why the game does not let you use your own variables for units in events.

You can either bypass this by referring directly to the player, or use the add event action in the first trigger to create the event after you defined the unit in the second trigger. I'd recommend the former as I don't think there is a way to remove events after you add them.
 
Status
Not open for further replies.
Back
Top