• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Problems with trigger and random sound play!

Status
Not open for further replies.
Level 12
Joined
May 7, 2008
Messages
330
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.
 
Level 3
Joined
Jul 6, 2008
Messages
42
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.
 
Level 5
Joined
Jan 25, 2006
Messages
103
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.
 
Level 5
Joined
Jan 25, 2006
Messages
103
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!
 
Level 2
Joined
Jul 24, 2007
Messages
199
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:
JASS:
    call VolumeGroupReset()
//    call SetMapMusic("Sound\\Music\\mp3Music\\HumanX1.mp3", true, 0)
The trigger where the music changes:
JASS:
    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.
 
Status
Not open for further replies.
Top