UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

Music to play when fog rolls in script help

broken avatar :(
Created 11 years ago
by MJPWGaming
0 Members and 1 Guest are viewing this topic.
3,091 views
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 26 March 2014
Last active: 5 years ago
Posts
200
Respect
Forum Rank
Mr. Elemental
Primary Group
Donator ♥
My Groups
More
×
MJPWGaming's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
MJPWGaming's Contact & Social Links
Hi there again. So Ive been trying to get my script to where it plays music when the fog starts coming and also again when it leaves. Here is the script:

Code Snippet
Plaintext
reapers_fog()
{
while(1)
{
SetVolFog( 75.0, 80.0, 380, -40.0, 0.16, 0.204, 0.274, 7 ); //fog comming
SetVolFog( 229.0, 400.0, 115.0, 200.0, 0.16, 0.204, 0.274, 7 ); //fog comming
SetVolFog( 229.0, 200.0, 380.0, 200.0, 0.16, 0.204, 0.274, 7 ); //fog comming
VisionSetNaked(0, "zombie_sumpf_dogs", 7 ); //fog comming
iprintlnbold("^1WARNING: ^7Fog rolling in"); //tells players that the fog is coming, place // at the start if you dont want this to happen

wait 120; //make sure to keep the fog in, change time to your liking

SetVolFog( 404.39, 1543.52, 460.33, -244.014, 0.65, 0.84, 0.79, 6 ); //fog going
VisionSetNaked(0, "zombie_sumpf", 4 ); //fog going
iprintlnbold("^1WARNING: ^7Fog clearing"); //tells players that the fog is going, place // at the start if you dont want this to happen

wait 120; //make sure to keep the fog away, change time to your liking
}
}
broken avatar :(
×
broken avatar :(
[UGX] Documentation Writer & Programmer
Location: usLos Angeles, CA
Date Registered: 23 August 2013
Last active: 3 years ago
Posts
1,322
Respect
Forum Rank
Zombie Colossus
Primary Group
UGX Team Member
My Groups
More
My Contact & Social Links
More
Personal Quote
(ง º ω º )ง u wont sum m8y?
Signature
Do not take life too seriously. You will never get out of it alive.
×
DidUknowiPwn's Groups
UGX Team Member
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
Code Snippet
Plaintext
TheFog()
{
if(level.fog_is_in)
{
SetVolFog(stuff)
VisionSetNaked("vision", time);
SetMusicState("da_alias");
level.fog_is_in = true;
}
else
{
SetVolFog(stuff_out)
VisionSetNaked("vision_out", time);
SetMusicState("da_alias_out");
level.fog_is_in = false;
}
}
SetMusicState requires add_sound from init_sounds() in _zombiemode.gsc
This is for you to manually call it everytime. You could do a while loop as you did.
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 26 March 2014
Last active: 5 years ago
Posts
200
Respect
Forum Rank
Mr. Elemental
Primary Group
Donator ♥
My Groups
More
×
MJPWGaming's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
MJPWGaming's Contact & Social Links
Okay I know you probably made this really simple for me but Im confused :(
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 21 September 2014
Last active: 2 years ago
Posts
191
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Personal Quote
Let's all just light up a blunt, and make stuff.
×
AlecKeaneDUB's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
AlecKeaneDUB's Contact & Social LinksAlecKeaneDUBaleckeanedubAlecKeaneDUB
I commented DUKIP's code to make it easier to understand what you need to do:
Code Snippet
Plaintext
TheFog() //Change this to the name of your original fog function, reapers_fog() i believe it was
{
if(level.fog_is_in) //You must add this variable before this line of code
{
SetVolFog(stuff); //replace "stuff" with the numbers (values) you used in your original fog script here
VisionSetNaked("vision", time); //change "vision" to the vision you used for when the fog rolls in and edit the "time"
SetMusicState("da_alias"); //change "da_alias" to whatever sound you want to be played upon fog rolling in
level.fog_is_in = true;
}
else
{
SetVolFog(stuff_out); //Change "stuff_out" to the fog values you used when it goes away
VisionSetNaked("vision_out", time); //change "vision_out" to the vision you want when fog goes away, and the time
SetMusicState("da_alias_out"); //change "da_alias_out" to the sound you want to play when fog goes away
level.fog_is_in = false;
}
}
Hopefully that might clear up a bit of confusion with the script.

Here is what it might look like with your original values:
Code Snippet
Plaintext
reapers_fog()
{
level.fog_is_in = false; //game will start with fog equal to false

while(1)
{
if(level.fog_is_in = false)
{
wait 120;
iprintlnbold("^1WARNING: ^7Fog rolling in");
SetVolFog( 75.0, 80.0, 380, -40.0, 0.16, 0.204, 0.274, 7 );
SetVolFog( 229.0, 400.0, 115.0, 200.0, 0.16, 0.204, 0.274, 7 );
SetVolFog( 229.0, 200.0, 380.0, 200.0, 0.16, 0.204, 0.274, 7 );
VisionSetNaked("zombie_sumpf_dogs", 7);
SetMusicState("name_of_sound_here");
level.fog_is_in = true;
}
else
{
wait 120;
iprintlnbold("^1WARNING: ^7Fog clearing");
SetVolFog(404.39, 1543.52, 460.33, -244.014, 0.65, 0.84, 0.79, 6)
VisionSetNaked("zombie_sumpf", 4);
SetMusicState("name_of_sound_here");
level.fog_is_in = false;
}
}
}

Once again, i haven't tested this in-game so idk if it will work properly. Also, like DUKIP said, you need to go into _zombiemode.gsc and add an "add_sound" line with the sound(s) you use when the fog comes/goes. Make sure to put them in the init_sounds() function with all the others. Hope this helps

* Edit by harry, there was a missing ; that would have caused a syntax error, just thought id add it in for you ;) *
Last Edit: May 15, 2015, 10:56:34 pm by Harry Bo21
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 26 March 2014
Last active: 5 years ago
Posts
200
Respect
Forum Rank
Mr. Elemental
Primary Group
Donator ♥
My Groups
More
×
MJPWGaming's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
MJPWGaming's Contact & Social Links
You da man AlecKeaneDUB! Keep your amazing self being amazing!

Double Post Merge: May 16, 2015, 07:03:02 pm
Welp wait a sec, Bad Syntax error.
It doesnt understand

Code Snippet
Plaintext
				if(level.fog_is_in = false)

Not sure if something was missing in that spot but thats what was brought up.
Last Edit: May 16, 2015, 07:03:02 pm by MJPWGaming
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 21 September 2014
Last active: 2 years ago
Posts
191
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Personal Quote
Let's all just light up a blunt, and make stuff.
×
AlecKeaneDUB's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
AlecKeaneDUB's Contact & Social LinksAlecKeaneDUBaleckeanedubAlecKeaneDUB
You da man AlecKeaneDUB! Keep your amazing self being amazing!

Double Post Merge: May 16, 2015, 07:03:02 pm
Welp wait a sec, Bad Syntax error.
It doesnt understand

Code Snippet
Plaintext
				if(level.fog_is_in = false)

Not sure if something was missing in that spot but thats what was brought up.
Whoops...that line should be:
Code Snippet
Plaintext
if(level.fog_is_in == false)
:)
Last Edit: May 16, 2015, 07:36:30 pm by AlecKeaneDUB
broken avatar :(
  • DeletedUser
  • Deleted Member
×
broken avatar :(
DeletedUser
This user is deleted :(
Also, like DUKIP said, you need to go into _zombiemode.gsc and add an "add_sound" line with the sound(s) you use when the fog comes/goes. Make sure to put them in the init_sounds() function with all the others. Hope this helps
Doesn't it need to be edited in mapname_amb.csc?
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 26 March 2014
Last active: 5 years ago
Posts
200
Respect
Forum Rank
Mr. Elemental
Primary Group
Donator ♥
My Groups
More
×
MJPWGaming's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
MJPWGaming's Contact & Social Links
The map goes dark and the music still doesnt play :/
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 21 September 2014
Last active: 2 years ago
Posts
191
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Personal Quote
Let's all just light up a blunt, and make stuff.
×
AlecKeaneDUB's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
AlecKeaneDUB's Contact & Social LinksAlecKeaneDUBaleckeanedubAlecKeaneDUB
The map goes dark and the music still doesnt play :/
are you using a custom sound or one from stock WaW?
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 26 March 2014
Last active: 5 years ago
Posts
200
Respect
Forum Rank
Mr. Elemental
Primary Group
Donator ♥
My Groups
More
×
MJPWGaming's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
MJPWGaming's Contact & Social Links
Stock WaW sounds for test

 
Loading ...