• 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] Fast clicking causing computer (not game) to freeze

Status
Not open for further replies.
Okay. In my campaign, there is a part where the main character has to practice the piano. How it works is that you click (select) the piano key, and then it plays its attack anim (being pressed), and the sound plays. This all works fine, but if you click the same key twice in rapid succession (less then 1/4 of a second in between), then it causes the game to freeze. (If the key is pressed within about 1/2 of a second in between clicks, then it works fine) The music keeps playing, but the map freezes, and sometimes I can manage to Alt+Tab out and then Ctrl+Alt+Del WC3, but other times even that is not possible.

  • Piano Play
    • Events
      • Player - Player 1 (Red) Selects a unit
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Triggering unit)) Equal to Piano Key (Backwards L)
          • (Unit-type of (Triggering unit)) Equal to Piano Key (L)
          • (Unit-type of (Triggering unit)) Equal to Piano Key (Rectangle)
          • (Unit-type of (Triggering unit)) Equal to Piano Key (T)
    • Actions
      • Trigger - Turn off (This trigger)
      • Set AA_PianoKey = (Triggering unit)
      • Selection - Clear selection
      • Selection - Select Yellow Dragon (piano) 0140 <gen> for Player 1 (Red)
      • Animation - Play (Triggering unit)'s attack animation
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Triggering unit) Equal to Piano Key (L) 0105 <gen>
        • Then - Actions
          • Sound - Play Low C <gen>
        • Else - Actions
      • Etc...
      • Trigger - Turn on (This trigger)
Could the problem be because I am not destroying the sound? Or does that not have anything to do with it?
 
Bump!

I really need this, and now I have discovered that it's when you press any combination of buttons. I have added the "Sound - Destroy sound" thingy, but that seems to do nothing.

EDIT: I have also discovered that no matter how slow you click the keys, the game crashes after a set number of clicks! (I think it's somewhere around 40ish)

Why does it do this?!

EDIT2: Now it only plays a few sounds, then doesn't play any sounds, then crashes! WHY IS THIS HAPPENING TO ME???!!1
 
Last edited:
Destroy the sound before playing it? And what do you mean about in the sound editor? The sounds themselves work, it's just that pressing a couple of them causes the game to go berserk.

EDIT: Here's my trigger at the moment.
  • Piano Play
    • Events
      • Player - Player 1 (Red) Selects a unit
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Triggering unit)) Equal to Piano Key (Backwards L)
          • (Unit-type of (Triggering unit)) Equal to Piano Key (L)
          • (Unit-type of (Triggering unit)) Equal to Piano Key (Rectangle)
          • (Unit-type of (Triggering unit)) Equal to Piano Key (T)
    • Actions
      • Set AA_PianoKey = (Triggering unit)
      • Selection - Select Yellow Dragon (piano) 0140 <gen> for Player 1 (Red)
      • Animation - Play (Triggering unit)'s attack animation
      • Game - Display to (All players) the text: (String((Execution count of (This trigger))))
      • Sound - Destroy (Last played sound)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Triggering unit) Equal to Piano Key (L) 0105 <gen>
        • Then - Actions
          • Sound - Play LowC <gen>
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Triggering unit) Equal to Piano Key (Rectangle) 0109 <gen>
        • Then - Actions
          • Sound - Play LowCsharp <gen>
        • Else - Actions
      • -------- List truncated --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Triggering unit) Equal to Piano Key (Backwards L) 0136 <gen>
        • Then - Actions
          • Sound - Play HighB <gen>
        • Else - Actions
 
Level 4
Joined
Jun 1, 2007
Messages
92
Using this trigger alone might just cause the freezing of your computer.
  • Selection
    • Events
      • Player - Player 1 (Red) Selects a unit
    • Conditions
    • Actions
      • Selection - Select <Some Unit> for Player 1 (Red)
      • Unit - Create 1 Footman for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
Because the event is if Red selects a unit, the action will be executed. However in the actions, there is "Selection - Select <Some Unit> for Player 1 (Red)", which will cause the trigger to re-execute over and over again because the action causes the event to take place.

Kind of the same thing as this trigger, besides this one will freeze you right away when a unit dies.
  • Melee Initialization
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Unit - Create 1 Footman for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
      • Unit - Kill (Last created unit)
 
No, because I have the conditions. I'm making it select a dragon, but the conditions make it so the trigger only runs if a piano key is selected.

Maybe I'll just use the "Trigger - Add Events to trigger" thingy to add the piano keys up there, and see if that works.
EDIT: Nope, no difference.
 
Last edited:
Status
Not open for further replies.
Top