• 💀 Happy Halloween! 💀 It's time to vote for the best terrain! Check out the entries to Hive's HD Terrain Contest #2 - Vampire Folklore.❗️Poll closes on November 14, 2023. 🔗Click here to cast your vote!
  • 🏆 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!
  • 🏆 HD Level Design Contest #1 is OPEN! Contestants must create a maze with at least one entry point, and at least one exit point. The map should be made in HD mode, and should not be openable in SD. Only custom models from Hive's HD model and texture sections are allowed. The only exceptions are DNC models and omnilights. This is mainly a visual and design oriented contest, not technical. The UI and video walkthrough rules are there to give everyone an equal shot at victory by standardizing how viewers see the terrain. 🔗Click here to enter!

[vJASS] Trying to use SoundTools

Status
Not open for further replies.
Level 18
Joined
Oct 12, 2007
Messages
1,821
Hey there,

I'm trying to use SoundTools but it doesn't seem to produce a sound at all. Am I doing something wrong?

Here's my sample code:
JASS:
library testing initializer init requires SoundTools
globals

    ///Sounds
    private integer Sound_1 = 0
    
endglobals

private function Test takes nothing returns nothing
    local player p = GetTriggerPlayer()
    
    call RunSoundForPlayer(Sound_1, p)
endfunction

private function init takes nothing returns nothing
    local trigger t = CreateTrigger()

    ///Sounds
    set Sound_1 = NewSound("Units\\Human\\BloodElfSpellThief\\SpellbreakerYes5.wav", 1112, false, true) ///Very Clever - Blood Elf
    
    call TriggerRegisterPlayerChatEvent(t, Player(0), "test", true )
    call TriggerAddAction(t, function Test)
endfunction
endlibrary

The system itself can be found here: LINK

PS: Oh and I have the latest versions of Table and TimerUtils
 
Level 18
Joined
Oct 12, 2007
Messages
1,821
maybe you arent Player(0)?

I am. I also added a debug message after 'running' the sound to show me if the sound integer actually gets changed by the initialization, and it does.
So all is functioning correctly except for the actual sound to come out...
 
Status
Not open for further replies.
Top