• 🏆 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] Wait For Condition issue

Status
Not open for further replies.
Level 18
Joined
Aug 23, 2008
Messages
2,319
Behold: My not working trigger:

  • Actions
    • Set ArrowKeyDown = False
    • Set UnknownVoice = ((Center of Unknown voice <gen>) offset by (-500.00, 0.00))
    • Floating Text - Create floating text that reads ???: Who's there? at UnknownVoice with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
    • Set FloatingText = (Last created floating text)
    • Wait until (ArrowKeyDown Equal to True), checking every 0.10 seconds
    • Floating Text - Destroy FloatingText

Behold again: My working ArrowKeyDown triggers:
  • Down Arrow Key ON
    • Events
      • Player - Player 1 (Red) Presses the Down Arrow key
    • Conditions
    • Actions
      • Set ArrowKeyDown = True
  • Down Arrow Key OFF
    • Events
      • Player - Player 1 (Red) Releases the Down Arrow key
    • Conditions
    • Actions
      • Set ArrowKeyDown = False

Finally behold: My question:
Why doesn't the 'Wait until (ArrowKeyDown Equal to True), checking every 0.10 seconds' work? The text appears, but I when I press the Down Arrow Key, nothing happens! The text is still there.
 
Level 10
Joined
Aug 15, 2008
Messages
448
Try using something like this:

  • Actions
    • Set ArrowKeyDown = False
    • Set UnknownVoice = ((Center of Unknown voice <gen>) offset by (-500.00, 0.00))
    • Floating Text - Create floating text that reads ???: Who's there? at UnknownVoice with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
    • Set FloatingText = (Last created floating text)
    • Trigger - turn off (Down Arrow Key ON)
    • Trigger - turn off (Down Arrow Key OFF)
    • Trigger - Turn on (Down Arrow key NEW)
The "Down Arrow Key NEW":
  • Down Arrow Key NEW
    • Events
      • Player - Player 1 (Red) Presses the Down Arrow key
    • Conditions
    • Actions
      • Set ArrowKeyDown = True
      • Floating Text - destroy FloatingText
      • Trigger - Turn on (Down Arrow Key ON)
      • Trigger - Turn on (Down Arrow Key OFF)
      • Trigger - Turn off (this trigger)
NOTE: this trigger should be disabled at the beginning.

That's it. It's way more complicated than the original one, but it may be functional. The better reason I can give you for the malfunctioning trigger is that, when you press the Down Arrow key for a while, it may not be within the 0.10 seconds delay of the trigger... if you don't like this solution, try pressing the Down Arrow key for a longer time, otherwise... I don't know :xxd:.
Good luck anyway :thumbs_up:!
 
Last edited:
Status
Not open for further replies.
Top