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

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)