Hi, my map is a murder variant map that plays music whenever the killer is near a victim. There's multiple musics to choose from, all with slightly different lengths. I am trying to make it such that the song stops whenever the killer moves out of range. Unfortunately, Sound- Clear the music list doesn't work as described. It apparently does not clear the music in queue, which affects my current implementation. So I was about to put waits and additional variables but it would be pretty messy. Maybe you guys can think of something better than this.
Note: deathtone is referring to a music played when a victim dies, the trigger stops music and plays a creepy music for 15 seconds before setting deathtone back to false.
The "Wait 14.83 seconds" is the length of one of the song. If there are no better methods, I'll have to make an array of song lengths.
Note: deathtone is referring to a music played when a victim dies, the trigger stops music and plays a creepy music for 15 seconds before setting deathtone back to false.
Trigger:
- tensioner
- Events
- Time - Every 0.25 seconds of game time
- Conditions
- deathtone Equal to False
- Actions
- Unit Group - Pick every unit in (Units within 500.00 of (Position of killerunit) matching (((Owner of (Matching unit)) Not equal to Killer) and ((Owner of (Matching unit)) Not equal to Neutral Passive))) and do (Actions)
- Loop - Actions
- If ((Owner of (Picked unit)) Not equal to Killer) then do (Set songonoff = True) else do (Do nothing)
- Loop - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- songonoff Equal to True
- testmusic Equal to False
- Then - Actions
- Set songonoff = False
- Trigger - Run playmusic <gen> (ignoring conditions)
- Set testmusic = True
- Else - Actions
- Sound - Stop music After fading
- Set testmusic = False
- If - Conditions
- Unit Group - Pick every unit in (Units within 500.00 of (Position of killerunit) matching (((Owner of (Matching unit)) Not equal to Killer) and ((Owner of (Matching unit)) Not equal to Neutral Passive))) and do (Actions)
- Events
Trigger:
- playmusic
- Events
- Conditions
- Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- chosensong Equal to 1
- Then - Actions
- Sound - Play htf <gen>
- Else - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- chosensong Equal to 2
- Then - Actions
- Sound - Play unmonde <gen>
- Else - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- chosensong Equal to 3
- Then - Actions
- Sound - Play jiemao <gen>
- Else - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- chosensong Equal to 4
- Then - Actions
- Sound - Play Killer_is_near_you <gen>
- Else - Actions
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- Sound - Clear the music list
- Wait 14.83 seconds
- Set testmusic = False
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
The "Wait 14.83 seconds" is the length of one of the song. If there are no better methods, I'll have to make an array of song lengths.