• 🏆 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!
  • ✅ The POLL for Hive's Texturing Contest #33 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!

[vJASS] Trying to use SoundTools

Status
Not open for further replies.
Level 19
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 19
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