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

Function for a sound that i would like looped?

broken avatar :(
Created 9 years ago
by vinnyz500
0 Members and 1 Guest are viewing this topic.
1,956 views
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 1 January 2014
Last active: 3 years ago
Posts
397
Respect
Forum Rank
Perk Hacker
Primary Group
Member
My Contact & Social Links
More
Signature
×
vinnyz500's Groups
vinnyz500's Contact & Social Linkspsn_hackedlobbies4uXxMrPotatoxXvinnyz500
Hey UGX, i grabbed this function from a script someone made me for a 3D sound thing to play a song in a certain area, and it is activated via trigger. I would like to know how to make it work, without having to reactivate the trigger and have the song looping (Basically i have my Peach's castle music and i want there to be a button whether or not to start the music)

Here is the function from the script, if you need more tell me i dont have much scripting knowledge so please if u need more info tell me but i am 50% sure this is all you need:

Code Snippet
Plaintext
sweet_victory_function()
{
while(1)
{
pos = getentarray("victory_pos", "targetname");
player = undefined;
trig = getEnt("sweet_victory_trig", "targetname");
trig UseTriggerRequireLookAt();
trig SetCursorHint( "HINT_NOICON" );
trig setHintString("Press button to start the awesome concert!");
trig waittill ("trigger", player );
if(level.spongysong_flag == 0)
{ level.spongysong_flag = 1;
iprintln("Please enjoy the Sweet Victory song!");
for(h=0;h<pos.size;h++)
{
pos[h] playsound("sweet_victory");
}
wait(228);
level.spongysong_flag = 0;
break;
}
else if(level.spongysong_flag == 1)
{
iprintln("Please wait untill spongy song is done.");
}
wait 0.1;
}
}
broken avatar :(
×
broken avatar :(
Location: nlApeldoorn
Date Registered: 17 December 2013
Last active: 1 year ago
Posts
1,187
Respect
1,404Add +1
Forum Rank
Zombie Colossus
Primary Group
Community Scripter Elite
My Groups
More
My Contact & Social Links
More
Personal Quote
It aint much, if it aint Dutch
Signature
×
BluntStuffy's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
Oil Rig Beta Access
Oil Rig Beta Access
BluntStuffy's Contact & Social LinksBluntstuffy@BluntZombieBluntStuffyStuffyZombie
This should do, remember the soundalias also needs the sound set to looping.

Code Snippet
Plaintext
sweet_victory_function()
{
pos = getentarray("victory_pos", "targetname");
trig = getEnt("sweet_victory_trig", "targetname");
trig UseTriggerRequireLookAt();
trig SetCursorHint( "HINT_NOICON" );
trig setHintString("Press button to start the awesome concert!");
trig waittill ("trigger" );

for(h=0;h<pos.size;h++)
{
pos[h] playloopsound("sweet_victory");
}

         trig delete();
}



You can use this to stop the sound if needed:
Code Snippet
Plaintext
ENTITY stopLoopSound();



BTW: is it a trigger_use, or a trigger multiple?
Last Edit: March 07, 2015, 09:03:06 am by BluntStuffy
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 1 January 2014
Last active: 3 years ago
Posts
397
Respect
Forum Rank
Perk Hacker
Primary Group
Member
My Contact & Social Links
More
×
vinnyz500's Groups
vinnyz500's Contact & Social Linkspsn_hackedlobbies4uXxMrPotatoxXvinnyz500
This should do, remember the soundalias also needs the sound set to looping.

Code Snippet
Plaintext
sweet_victory_function()
{
pos = getentarray("victory_pos", "targetname");
trig = getEnt("sweet_victory_trig", "targetname");
trig UseTriggerRequireLookAt();
trig SetCursorHint( "HINT_NOICON" );
trig setHintString("Press button to start the awesome concert!");
trig waittill ("trigger" );

for(h=0;h<pos.size;h++)
{
pos[h] playloopsound("sweet_victory");
}

         trig delete();
}



You can use this to stop the sound if needed:
Code Snippet
Plaintext
ENTITY stopLoopSound();



BTW: is it a trigger_use, or a trigger multiple?
Thanks, it will be a trigger_use because i want it to be optional to turn on the castle music
broken avatar :(
×
broken avatar :(
Location: nlApeldoorn
Date Registered: 17 December 2013
Last active: 1 year ago
Posts
1,187
Respect
1,404Add +1
Forum Rank
Zombie Colossus
Primary Group
Community Scripter Elite
My Groups
More
My Contact & Social Links
More
Personal Quote
It aint much, if it aint Dutch
×
BluntStuffy's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
Oil Rig Beta Access
Oil Rig Beta Access
BluntStuffy's Contact & Social LinksBluntstuffy@BluntZombieBluntStuffyStuffyZombie
Thanks, it will be a trigger_use because i want it to be optional to turn on the castle music

lol. Yeh i figured later, with the hintstring and all..
This should be good then
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 1 January 2014
Last active: 3 years ago
Posts
397
Respect
Forum Rank
Perk Hacker
Primary Group
Member
My Contact & Social Links
More
×
vinnyz500's Groups
vinnyz500's Contact & Social Linkspsn_hackedlobbies4uXxMrPotatoxXvinnyz500
can't find a tut on how to make a 3D sound looping. Here is my .csv line:

Code Snippet
Plaintext
sweet_victory,castle\sweet_victory.wav,,,1,1,200,400,,,,,music,,,0.8,1800,,curve0,1,1,,3d,streamed,,,,,,,,,,,,,100,200,0.5,0.25,,,,,,90,90,0.25,1,,
what do i change in it? i tried to change the curve to looping but i'm 90% sure that isint correct
broken avatar :(
×
broken avatar :(
Location: nlApeldoorn
Date Registered: 17 December 2013
Last active: 1 year ago
Posts
1,187
Respect
1,404Add +1
Forum Rank
Zombie Colossus
Primary Group
Community Scripter Elite
My Groups
More
My Contact & Social Links
More
Personal Quote
It aint much, if it aint Dutch
×
BluntStuffy's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
Oil Rig Beta Access
Oil Rig Beta Access
BluntStuffy's Contact & Social LinksBluntstuffy@BluntZombieBluntStuffyStuffyZombie
can't find a tut on how to make a 3D sound looping. Here is my .csv line:

Code Snippet
Plaintext
sweet_victory,castle\sweet_victory.wav,,,1,1,200,400,,,,,music,,,0.8,1800,,curve0,1,1,,3d,streamed,,,,,,,,,,,,,100,200,0.5,0.25,,,,,,90,90,0.25,1,,
what do i change in it? i tried to change the curve to looping but i'm 90% sure that isint correct

I really really really dont like soundaliases. Whenever i need something i try looking for an Original sound that's matching my needs and copy that. Otherwise try the ugx-alias editor and look for the setting in there maybe

 
Loading ...