• 🏆 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!

[GUI] Sound Multiplier v0.01 (First Release)

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
This system was made by me and I post it in ChaosRealm.info (ID : RiskYourLife). I want to share this system with you guys so... this is it.

This system allow user to play multiple sound of same type at a time. But i recommend to set MSound_FadeInRate = 1111 and set MSound_FadeOutRate = 1111 if you want play lot of sound in a short period.

The other explanation is inside the test map.

Here the code:

  • Multiple Sound Init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --------
      • -------- This system is using hashtable. So, user can create sound as many as they like ( but it will cause lag if too many) --------
      • -------- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --------
      • Hashtable - Create a hashtable
      • Set MSound_Hashtable = (Last created hashtable)
      • -------- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --------

  • Multiple Sound
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --------
      • -------- Multiple Sound Generator v0.1 GUI Version (first release) by RiskYourLife (ChaosReal.info) aka Reventhous (Hiveworkshop.com) --------
      • -------- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --------
      • -------- I've play lot of spell, but i never see any sound multiplier system in GUI version except vJASS. So i make this system :D --------
      • -------- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --------
      • -------- This system allows user to play multiple sound at a time. --------
      • -------- But this system support wav file only --------
      • -------- You are free to edit, credit goes to me :) --------
      • -------- If you have any suggestion for this system please PM me :)...+REP to who give brilliant idea to me. --------
      • -------- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --------
      • -------- How to use? see ReadMe --------
      • -------- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --------
      • -------- v0.2 plan --------
      • -------- ----add recycler --------
      • -------- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --------
      • -------- pretty short, huh? --------
      • -------- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --------
      • Custom script: call ExecuteFunc("MultipleSoundStart")
      • Custom script: endfunction
      • -------- ================================================================================================== --------
      • Custom script: function MultipleSoundLifeTime takes nothing returns nothing
      • Custom script: local timer z = GetExpiredTimer()
      • Custom script: local sound s = LoadSoundHandle(udg_MSound_Hashtable,GetHandleId(z),1)
      • Custom script: call StopSound(s,LoadBoolean(udg_MSound_Hashtable,GetHandleId(z),2),LoadBoolean(udg_MSound_Hashtable,GetHandleId(z),3))
      • Custom script: call DestroyTimer(z)
      • Custom script: endfunction
      • -------- ================================================================================================== --------
      • Custom script: function MultipleSoundStart takes nothing returns nothing
      • Custom script: local sound s
      • Custom script: local timer z = CreateTimer()
      • Custom script: set s = CreateSound(udg_MSound_FileName,udg_MSound_Looping,udg_MSound_Is3D,udg_MSound_StopWhenOutOfRange,udg_MSound_FadeInRate,udg_MSound_FadeOutRate,udg_MSound_EaxSetting)
      • Custom script: if udg_MSound_RunSound == "" or (udg_MSound_RunSound != "unit" and udg_MSound_RunSound != "location") then
      • Custom script: call PlaySoundBJ(s)
      • Custom script: elseif udg_MSound_RunSound == "unit" then
      • Custom script: call PlaySoundOnUnitBJ(s,udg_MSound_Volume,udg_MSound_Unit)
      • Custom script: elseif udg_MSound_RunSound == "location" then
      • Custom script: call PlaySoundAtPointBJ(s,udg_MSound_Volume,udg_MSound_Location, 0 )
      • Custom script: endif
      • Set MSound_RunSound = <Empty String>
      • Set MSound_Unit = No unit
      • Custom script: call RemoveLocation(udg_MSound_Location)
      • Custom script: call SaveSoundHandle(udg_MSound_Hashtable,GetHandleId(z),1,s)
      • Custom script: call SaveBoolean(udg_MSound_Hashtable,GetHandleId(z),2,udg_MSound_KillWhenDone)
      • Custom script: call SaveBoolean(udg_MSound_Hashtable,GetHandleId(z),3,udg_MSound_FadeOut)
      • Custom script: call TimerStart(z,udg_MSound_LifeTime,false,function MultipleSoundLifeTime)
      • -------- ================================================================================================== --------
Demo How to use :
  • Demo
    • Events
      • Player - Player 1 (Red) types a chat message containing 1 as An exact match
    • Conditions
    • Actions
      • -------- Sound path --------
      • Set MSound_FileName = war3mapImported\mcw.wav
      • -------- The rest is the configuration for the sound --------
      • Set MSound_Looping = False
      • Set MSound_Is3D = False
      • Set MSound_StopWhenOutOfRange = False
      • Set MSound_FadeInRate = 10
      • Set MSound_FadeOutRate = 10
      • Set MSound_EaxSetting = <Empty String>
      • Set MSound_FadeOut = False
      • Set MSound_KillWhenDone = False
      • Set MSound_LifeTime = 2.00
      • Set MSound_Volume = 100.00
      • -------- Sound run option --------
      • Set MSound_RunSound = <Empty String>
      • Set MSound_Unit = Peasant 0001 <gen>
      • Set MSound_Location = (Load 0 of 0 in (Last created hashtable))
      • -------- Run the system --------
      • Trigger - Run Multiple Sound <gen> (ignoring conditions)

If there any bug or leaks, tell me so I cant release new version of this system.

Don't forget to rate :)
Contents

Just another Warcraft III map (Map)

Reviews
20:34, 31st May 2015 BPower: Review in my last comment (no.4).
Level 19
Joined
Mar 18, 2012
Messages
1,716
You leak sound and timer handles.

Why does it run on map init event?

Can't you just use native KillSoundWhenDone, why do I need to run a timer if I don't recycle the sound handle? I don't have too much experience with sounds in GUI, since Im using a sound recycling tool for my sound needs.
 
Top