Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

[Trigger] Problems with trigger and random sound play!

Discussion in 'Triggers & Scripts' started by Crusher8, Mar 6, 2009.

  1. Crusher8

    Crusher8

    Joined:
    May 7, 2008
    Messages:
    160
    Resources:
    0
    Resources:
    0
    1st Question:

    I have some problem with this trigger ( Description of this trigger - This trigger is used to slow enemy hero when his hitpoints go at 20% .) But the problem is that the slow effect doesn't appear , but the trigger works fine . So I think something is messed up and if someone can check :


    • Initialization Finish Him
      • Events
        • Unit - A unit enters (Playable map area)
      • Conditions
        • ((Entering unit) is A Hero) Equal to True
        • ((Entering unit) is in AddedHeroGroup) Equal to False
      • Actions
        • Unit Group - Add (Entering unit) to AddedHeroGroup
        • Trigger - Add to FINISH HIM <gen> the event (Unit - (Entering unit) Takes damage)
        • Trigger - Add to FINISH HIM undo <gen> the event (Unit - (Entering unit) Takes damage)



    • FINISH HIM
      • Events
        • Unit - A unit Is attacked
      • Conditions
        • And - All (Conditions) are true
          • Conditions
            • ((Triggering unit) is A Hero) Equal to True
            • ((Triggering unit) is in Finished) Equal to False
            • (Percentage life of (Triggering unit)) Less than or equal to 15.00
      • Actions
        • Unit Group - Add (Triggering unit) to Finished
        • Unit - Create 1 DummySlow for (Owner of (Damage source)) at (Position of (Damage source)) facing (Position of (Triggering unit))
        • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
        • Unit - Add Finish Him! to (Last created unit)
        • Unit - Order (Last created unit) to Human Sorceress - Slow (Triggering unit)
        • Game - Display to (All players) the text: ((|c00ff0000Finish|r + PlayerColours[(Player number of (Owner of (Triggering unit)))]) + |c00ff0000!|r )
        • Sound - Play finishim <gen>


    • FINISH HIM undo
      • Events
        • Unit - A unit Is attacked
      • Conditions
        • And - All (Conditions) are true
          • Conditions
            • ((Triggering unit) is A Hero) Equal to True
            • ((Triggering unit) is in Finished) Equal to True
            • (Percentage life of (Triggering unit)) Greater than or equal to 20.00
      • Actions
        • Unit Group - Remove (Triggering unit) from Finished
        • Unit - Remove Finish Him! buff from (Triggering unit)



    Well about the '' First Blood '' Trigger now ; Is this good? I mean the trigger is looking ok and it will trigger ok?

    • First Blood
      • Events
        • Unit - A unit Dies
      • Conditions
        • ((Owner of (Killing unit)) slot status) Equal to Is playing
        • ((Owner of (Killing unit)) controller) Equal to User
        • ((Owner of (Dying unit)) slot status) Equal to Is playing
        • ((Owner of (Dying unit)) controller) Equal to User
        • ((Dying unit) belongs to an enemy of (Owner of (Killing unit))) Equal to True
        • ((Dying unit) is A Hero) Equal to True
        • ((Killing unit) is A Hero) Equal to True
      • Actions
        • Sound - Play firstblood <gen>
        • Player - Add 200 to (Owner of (Killing unit)) Current gold
        • Quest - Display to (All players) the Hint message: ((|cff00ccffFirst Blood|r - + PlayerColours[(Player number of (Owner of (Dying unit)))]) + ( has been killed by + (PlayerColours[(Player number of (Owner of (Killing unit)))] + for an additional |c00f0f000+200|r Gold.)))
        • Trigger - Turn off (This trigger)



    Second Question :

    I tried to set it like this , but I don't think this is working ( Im using variable called ''Music_Random'' , type ''Sound'' and ''Array 1''.


    • Map Initialization
    • Set Music_Random[1] = BloodElfTheme01 <gen>
    • Set Music_Random[2] = BloodElfTheme02 <gen>
    • Set Music_Random[3] = BloodElfTheme03 <gen>


    then after 10 seconds i do this :

    • Actions
    • Sound - Clear the music list
    • Sound - Play Music_Random[(Random integer number between 1 and 4)]


    Also tried without clear the music list.
     
  2. fattyghost

    fattyghost

    Joined:
    Jul 6, 2008
    Messages:
    42
    Resources:
    0
    Resources:
    0
    based on what you said , those trigger should working fine .

    Except this 1 :
    • Sound - Play Music_Random[(Random integer number between 1 and 4)]

    Should be :
    • Sound - Play Music_Random[(Random integer number between 1 and 3)]


    About the slowing , check wheter you
    remove technique required
    Mana Cost
    Cast Range


    of the ability or not.

    And about the first blood trigger .
    • ((Owner of (Killing unit)) slot status) Equal to Is playing
      • ((Owner of (Killing unit)) controller) Equal to User
      • ((Owner of (Dying unit)) slot status) Equal to Is playing
      • ((Owner of (Dying unit)) controller) Equal to User
      • ((Dying unit) belongs to an enemy of (Owner of (Killing unit))) Equal to True
      • ((Dying unit) is A Hero) Equal to True


    This condition :
    • ((Killing unit) is A Hero) Equal to True

    Can be remove from this trigger.It wont trigger if the enermy is killed by summoned unit or dummy units or whatever.

    For further infomatin , you need to upload you map.
     
  3. Crusher8

    Crusher8

    Joined:
    May 7, 2008
    Messages:
    160
    Resources:
    0
    Resources:
    0
    OKAY but what about the sound? IT'S still not working.
     
  4. manstie

    manstie

    Joined:
    Mar 10, 2008
    Messages:
    847
    Resources:
    1
    Maps:
    1
    Resources:
    1
  5. Zmore

    Zmore

    Joined:
    Jan 10, 2009
    Messages:
    29
    Resources:
    0
    Resources:
    0
    Can you please upload your map?
     
  6. Crusher8

    Crusher8

    Joined:
    May 7, 2008
    Messages:
    160
    Resources:
    0
    Resources:
    0
    It didn't help...
     
  7. manstie

    manstie

    Joined:
    Mar 10, 2008
    Messages:
    847
    Resources:
    1
    Maps:
    1
    Resources:
    1
  8. SlickR

    SlickR

    Joined:
    Jan 25, 2006
    Messages:
    112
    Resources:
    5
    Maps:
    5
    Resources:
    5
    use music variable with array 3, if you use 1 that means the other 2 songs are not added to the array, since it only has 1 array and thus if the it randomizes 2 or 3 the music won't play.
    cheers.
    As for the first question, check the ability itself, cast range, targets allowed, mana cost, etc...
    also this i believe is error:
    Unit - Create 1 DummySlow for (Owner of (Damage source)) at (Position of (Damage source)) facing (Position of (Triggering unit))
    I think it should be owner of attacking unit, at position of attacked unit.
    you should also probably add another trigger, ordering the dummy unit to cast a spell.
     
  9. Crusher8

    Crusher8

    Joined:
    May 7, 2008
    Messages:
    160
    Resources:
    0
    Resources:
    0
    Bump , nothing works with music play :(
     
  10. Crusher8

    Crusher8

    Joined:
    May 7, 2008
    Messages:
    160
    Resources:
    0
    Resources:
    0
    Guys , Im having this problem still! Can someone help? (Bump)
     
  11. SlickR

    SlickR

    Joined:
    Jan 25, 2006
    Messages:
    112
    Resources:
    5
    Maps:
    5
    Resources:
    5
    use music variable with array 3
    also i hope you have set up an event to trigger the music or else if would be a stupid noob mistake andSound - Play Music_Random[(Random integer number between 1 and 3)], not 4 as you have!
     
  12. errorz

    errorz

    Joined:
    Jan 24, 2009
    Messages:
    91
    Resources:
    0
    Resources:
    0
    THERE IS A LEAK!(i found 1 XD)
     
  13. ANdROnIQ

    ANdROnIQ

    Joined:
    Jul 24, 2007
    Messages:
    205
    Resources:
    3
    Icons:
    1
    Maps:
    2
    Resources:
    3
    Have the same problem. But I'm jassing.
    On my map, there's one music theme and from some moment it changes to another one. Some times the first one (standard human theme X1 which is played even without triggering) does not play at all - it's silence.
    Init trigger:
    Code (vJASS):
        call VolumeGroupReset()
    //    call SetMapMusic("Sound\\Music\\mp3Music\\HumanX1.mp3", true, 0)
     

    The trigger where the music changes:
    Code (vJASS):
        call VolumeGroupReset()
    //    call ClearMapMusic()
        call SetMapMusic("Sound\\Music\\mp3Music\\PursuitTheme.mp3;Sound\\Music\\mp3Music\\IllidansTheme.mp3;Sound\\Music\\mp3Music\\LichKingTheme.mp3;Sound\\Music\\mp3Music\\UndeadX1.mp3", false, 0)
        call SetMusicPlayPosition(284645)
    //    call EndThematicMusic()
     

    Tried it in all combinations of comment/uncomment. Sometimes the first theme doesn't play (I guess warcraft leaves some sound data from the previous map played cuz it worked differently even while not recompiled), sometimes the second doesn't start at all, sometimes the second waits until the current play of the first comes to end.