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

Play looping sound at trigger location

broken avatar :(
Created 8 years ago
by fusorf
0 Members and 1 Guest are viewing this topic.
3,540 views
broken avatar :(
×
broken avatar :(
Location: fr
Date Registered: 25 July 2015
Last active: 2 years ago
Posts
121
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
Personal Quote
//This is a comment
Signature
×
fusorf's Groups
fusorf's Contact & Social LinksfusorffusorfFireFusorf
I'm scripting an easter egg song system for my map. It's all working except for the sound the triggers makes before being activated (the buzzing sound), and the sound that plays when you press F.

here's the code.

Code Snippet
Plaintext
[...]
triggers[i] thread detect_song_activation();
[...]

--------------

detect_song_activation()
{
self playsound("ee_song_loop");       //    <<<<<----------- here
while(1)
{
self waittill("trigger", player);
self trigger_off();
self StopLoopSound();

self playsound ("ee_song_activate");       //    <<<<<----------- here

level.trig_mus_count++;

if(level.trig_mus_count == 3)
{
thread play_ee_song();
player waittill("song_done");

self delete();
break;
}
wait 0.1;
}
}

What did I do wrong ? ^^ i'll add that the sounds are working if I play it on the players with a player playsound / for loop.
Last Edit: July 25, 2016, 07:49:41 pm by fusorf
broken avatar :(
×
broken avatar :(
Location: fi
Date Registered: 25 June 2013
Last active: 9 months ago
Posts
3,997
Respect
1,024Add +1
Forum Rank
Eviscerator
Primary Group
UGX V.I.P.
My Groups
More
My Contact & Social Links
More
×
HitmanVere's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
UGX V.I.P.
UGX V.I.P.
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
Should be playLoopSound, not playSound
broken avatar :(
×
broken avatar :(
Location: fr
Date Registered: 25 July 2015
Last active: 2 years ago
Posts
121
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
Personal Quote
//This is a comment
×
fusorf's Groups
fusorf's Contact & Social LinksfusorffusorfFireFusorf
Awesome, it works for the loop sound :D Still I have to figure out why I can't hear the activation sound  ???
broken avatar :(
×
broken avatar :(
Location: fr
Date Registered: 25 July 2015
Last active: 2 years ago
Posts
121
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
Personal Quote
//This is a comment
×
fusorf's Groups
fusorf's Contact & Social LinksfusorffusorfFireFusorf
Sound may be quiet in game. Try turning up the gain in audacity. If that isnt it, it isnt defined properly in the csv. Glad to see you working on the EE +1

Thank you very much  :)

I think the audio file is fine because it works if I play it on all the players. But it doesn't if I play it on the trigger.
broken avatar :(
×
broken avatar :(
Location: fr
Date Registered: 25 July 2015
Last active: 2 years ago
Posts
121
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
Personal Quote
//This is a comment
×
fusorf's Groups
fusorf's Contact & Social LinksfusorffusorfFireFusorf
Code Snippet
Plaintext
[...]
triggers[i] thread detect_song_activation();
[...]

--------------

detect_song_activation()
{
self playsound("ee_song_loop");       //    <<<<<----------- here
while(1)
{
self waittill("trigger", player);
self trigger_off();
self StopLoopSound();

playsoundatposition ("ee_song_activate", self.origin);       //    <<<<<----------- here

level.trig_mus_count++;

if(level.trig_mus_count == 3)
{
thread play_ee_song();
player waittill("song_done");

self delete();
break;
}
wait 0.1;
}
}

nope, still nothing :/
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 14 September 2013
Last active: 4 years ago
Posts
1,895
Respect
Forum Rank
Zombie Destroyer
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
BE ORIGINAL
Signature
×
MakeCents's Groups
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
Did you try adding a print before self delete(); and make sure it is waiting and not deleting the trigger, killing the sound?

Edit, doesn't trigger_off just move the trigger 10000 units down, like hide? Thus playing the sound, but 10000 units below where you think?
Last Edit: July 25, 2016, 08:35:41 pm by MakeCents
broken avatar :(
×
broken avatar :(
Location: fr
Date Registered: 25 July 2015
Last active: 2 years ago
Posts
121
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
Personal Quote
//This is a comment
×
fusorf's Groups
fusorf's Contact & Social LinksfusorffusorfFireFusorf
Did you try adding a print before self delete(); and make sure it is waiting and not deleting the trigger, killing the sound?

Edit, doesn't trigger_off just move the trigger 10000 units down, like hide? Thus playing the sound, but 10000 units below where you think?

I commented out the trigger_off(); and still no sound.
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 14 September 2013
Last active: 4 years ago
Posts
1,895
Respect
Forum Rank
Zombie Destroyer
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
BE ORIGINAL
×
MakeCents's Groups
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
I commented out the trigger_off(); and still no sound.

And the print statement?

trigger_off and disable_trigger, both move the trigger -10000 units.

Code Snippet
Plaintext
trigger_off( name, type )
{
if ( isdefined ( name ) && isdefined( type ) )
{
ents = getentarray( name, type );
array_thread( ents, ::trigger_off_proc );
}
else
self trigger_off_proc();
}
 
trigger_off_proc()
{
if ( !isDefined( self.realOrigin ) )
self.realOrigin = self.origin;

if ( self.origin == self.realorigin )
self.origin += ( 0, 0, -10000 );
self.trigger_off = true;
}

Code Snippet
Plaintext
disable_trigger()
{
if( !IsDefined( self.disabled ) || !self.disabled )
{
self.disabled = true;
self.origin = self.origin -( 0, 0, 10000 );
}
}
Last Edit: July 25, 2016, 08:38:23 pm by MakeCents
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 14 September 2013
Last active: 4 years ago
Posts
1,895
Respect
Forum Rank
Zombie Destroyer
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
BE ORIGINAL
×
MakeCents's Groups
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
Yes it does move it down, just checked utility.gsc . That has got to be the problem make it look like this:
Code Snippet
Plaintext
[...]
triggers[i] thread detect_song_activation();
[...]

--------------

detect_song_activation()
{
self playsound("ee_song_loop");       //    <<<<<----------- here
while(1)
{
self waittill("trigger", player);
self StopLoopSound();

self playsound ("ee_song_activate");       //    <<<<<----------- here
self trigger_off(); // You should probably just delete the trigger here. Why just turn off?

level.trig_mus_count++;

if(level.trig_mus_count == 3)
{
thread play_ee_song();
player waittill("song_done");

self delete();
break;
}
wait 0.1;
}
}

I think if you delete the ent or move it the sound continues with it, or deletes it. I would try removing all offs or deletes and adding a hard way after the sound playing.



Last Edit: July 25, 2016, 08:52:37 pm by MakeCents
broken avatar :(
×
broken avatar :(
Location: fr
Date Registered: 25 July 2015
Last active: 2 years ago
Posts
121
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
Personal Quote
//This is a comment
×
fusorf's Groups
fusorf's Contact & Social LinksfusorffusorfFireFusorf
I removed the self trigger_off(); for testing purpose, and tried both "playsoundatposition" and "playsound". Sadly none on them works.
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 14 September 2013
Last active: 4 years ago
Posts
1,895
Respect
Forum Rank
Zombie Destroyer
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
BE ORIGINAL
×
MakeCents's Groups
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
I removed the self trigger_off(); for testing purpose, and tried both "playsoundatposition" and "playsound". Sadly none on them works.

Did you also remove the delete?

I've relooked at your script and now I'm a little confused to what is and isn't working as intended, why your using a while loop, or any of the trigger_off stuff? Can we start over with what you are trying to accomplish maybe?

It seems to me that all you would need to do is:

Code Snippet
Plaintext
detect_song_activation()
{
self playsound("ee_song_loop");       //    <<<<<----------- here
self waittill("trigger", player);
//self StopLoopSound();

self playsound ("ee_song_activate");       //    <<<<<----------- here

level.trig_mus_count++;

if(level.trig_mus_count == 3)
{
thread play_ee_song();//is this meant to be thread on level or self?
//player waittill("song_done");


}
wait(3);//testing timer
self delete();
}
Last Edit: July 25, 2016, 09:01:16 pm by MakeCents
broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 4 years ago
Posts
6,877
Respect
1,004Add +1
Forum Rank
Immortal
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Signature
If you want scripts / features made for you, then contact me by PM or email / skype etc
it will cost you tho so if you have no intention of reciprocating don't even waste my time ;)
×
Harry Bo21's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Harry Bo21's Contact & Social Links[email protected]HarryBo21HarryBo000
Don't play sounds on triggers

It causes a random model to appear

Had this issue myself and took me forever to find out that was the cause

Playsoundatpposition

Or spawn a script origin or something "at" the trigger and use that

I had a random pair of zombie legs appearing in front of my pap for weeks coz of this
broken avatar :(
×
broken avatar :(
Location: fr
Date Registered: 25 July 2015
Last active: 2 years ago
Posts
121
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
Personal Quote
//This is a comment
×
fusorf's Groups
fusorf's Contact & Social LinksfusorffusorfFireFusorf
Don't play sounds on triggers

It causes a random model to appear

Had this issue myself and took me forever to find out that was the cause

Playsoundatpposition

Or spawn a script origin or something "at" the trigger and use that

I had a random pair of zombie legs appearing in front of my pap for weeks coz of this

Lol I can't even imagine how hard this was for you to figure out xD Thanks for the tip, i'll retry tomorrow now :)

Double Post Merge: July 26, 2016, 07:22:25 pm
ok thanks guys, the sound works perfectly now!

One more thing : how could I kill the music in case of game over ?
Last Edit: July 26, 2016, 07:22:25 pm by fusorf

 
Loading ...