Can I play music from a struct when I turn on the power?
Game Modding | Call of Duty: Black Ops 3 | Scripting
ModmeBot:
Thread By: Zombier I want to play music from a struct when I turn on the power.
ModmeBot:
Reply By: mathfag add to map.zone
top of script
bottom of script
ModmeBot:
Reply By: Zombier
mathfag add to map.zone xmodel,tag_origin top of script #precache( "model", "tag_origin"); bottom of script function autoexec music() { struct = struct::get("music_struct", "targetname"); struct = Spawn("script_model", struct.origin); struct SetModel("tag_origin"); level waittill("power_on"); struct PlaySound("sound name"); }
Thank you very much! I will try it.
ModmeBot:
Reply By: Zombier There is one more question, how can you let the script script_label loop at Radiant and another sound alias play in this way?
ModmeBot:
Reply By: mathfag
Zombier There is one more question, how can you let the script script_label loop at Radiant and another sound alias play in this way?
What?
ModmeBot:
Reply By: Zombier I think that this is only certain music. I want to play different music with many structs.
ModmeBot:
Reply By: mathfag
Zombier I think that this is only certain music. I want to play different music with many structs.
Now every struct will play a different sound. Your aliases must be identical except at the end you must change the number, starting with 0 so your aliases should be:
(sorry for immaturity) :)
ModmeBot:
Reply By: Zombier Please tell me the struct KVP.
ModmeBot:
Reply By: Harry Bo21
Zombier Please tell me the struct KVP.
its right there in his post....
although note :
this is appalling behavior, redefining a already defined variable WITHIN the loop checking the defined variable - and spawning something through it, also typo in the first line... ("struct.origin") - and further more - not deleting the ent you spawned either, quickest way to cause impossible to find gspawns
ModmeBot:
Reply By: mathfag
Zombier Please tell me the struct KVP.
every structs targetname is
ModmeBot:
Reply By: Zombier I am sorry for it many times. How can I use different sounds?
ModmeBot:
Reply By: mathfag
Zombier I am sorry for it many times. How can I use different sounds?
ModmeBot:
Reply By: Zombier Sound alias I have
Is this a power_sound for song name? Should I do this like this?
ModmeBot:
Reply By: mathfag
Zombier Sound alias I have power_sound0,,,zombie\ambs\perk_siren.wav,,,UIN_MOD,,,,,,,,,0,0,85,85,0,900,1000,,,,,,,,,,,,,,,,3d,,,LOOPING,,,0,0,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, power_sound1,,,zombie\ambs\numbers.wav,,,UIN_MOD,,,,,,,,,0,0,85,85,0,900,1000,,,,,,,,,,,,,,,,3d,,,LOOPING,,,0,0,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, power_sound2,,,zombie\test.wav,,,UIN_MOD,,,,,,,,,0,0,95,100,0,500,700,,,,,,,,,,,,,,,,3d,,,LOOPING,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, Is this a power_sound for song name? Should I do this like this? structPlaySound("power_sound"+i);
I noticed you have LOOPING in the alias. This works for NONLOOPING only but if you want looping you can just change PlaySound() to PlayLoopSound(). Stuff inside stays the same.