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

Wait on power on

broken avatar :(
Created 11 years ago
by HitmanVere
0 Members and 1 Guest are viewing this topic.
4,151 views
broken avatar :(
×
broken avatar :(
Location: fi
Date Registered: 25 June 2013
Last active: 2 years ago
Posts
3,997
Respect
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.
Mapper Has released one or more maps to the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
Im trying to use custom power on sound, but there is delay on it, is there way to delete it? I noticed its controlled by:
Code Snippet
Plaintext
pa_power_on()
{
level waittill ("pl1");

playsound( 0, "pa_buzz", self.origin );
wait(1.2);
self pa_play_dialog( "pa_power_on" );
}

Is pl1 controlled by engine? Cant find anything. Should I just comment that out and make new script with flag electricity_on?
This topic contains a post which is marked as the Best Answer. Click here to view it.
broken avatar :(
×
broken avatar :(
Location: usUnion, Kentucky
Date Registered: 9 September 2013
Last active: 3 years ago
Posts
310
Respect
Forum Rank
Perk Hacker
Primary Group
Box Mappers Elite
My Groups
More
My Contact & Social Links
More
×
lilrifa's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Box Mappers Elite
Box Mappers Elite
lilrifa's Contact & Social Linkslilrifaskypeuser724lilrifa
I would suggest commenting that out and rewriting it.
broken avatar :(
×
broken avatar :(
Location: usUnited States
Date Registered: 7 March 2014
Last active: 3 months ago
Posts
1,190
Respect
Forum Rank
Zombie Colossus
Primary Group
UGX Site Moderator
My Groups
More
My Contact & Social Links
More
×
MZslayer11's Groups
UGX Site Moderator Has the ability to issue warnings to users, edit and remove posts from the forum and to move topics to other boards. Upholds the rules of the forum. Moderates Chat Rooms.
MZslayer11's Contact & Social LinksMZslayer11Service_Code_30#2655
Couldn't you just change
Code Snippet
Plaintext
level waittill ("pl1");
To
Code Snippet
Plaintext
level waittill ("electricity_on");
Or even
Code Snippet
Plaintext
level waittill ("jugg_on");
Then just change "pa_buzz" to your sound.
broken avatar :(
×
broken avatar :(
Location: fi
Date Registered: 25 June 2013
Last active: 2 years ago
Posts
3,997
Respect
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.
Mapper Has released one or more maps to the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
And I just noticed that I could just remove the wait line :facepalm2: How come none of us noticed that?
broken avatar :(
×
broken avatar :(
Location: usUnited States
Date Registered: 7 March 2014
Last active: 3 months ago
Posts
1,190
Respect
Forum Rank
Zombie Colossus
Primary Group
UGX Site Moderator
My Groups
More
My Contact & Social Links
More
×
MZslayer11's Groups
UGX Site Moderator Has the ability to issue warnings to users, edit and remove posts from the forum and to move topics to other boards. Upholds the rules of the forum. Moderates Chat Rooms.
MZslayer11's Contact & Social LinksMZslayer11Service_Code_30#2655
And I just noticed that I could just remove the wait line :facepalm2: How come none of us noticed that?

But isnt the wait line is after the sound plays?  Pretty sure  the 'pa _ power _ on' is for player dialogue.
broken avatar :(
×
broken avatar :(
☭ Soviet Commander ☭
Location: us
Date Registered: 13 August 2012
Last active: 10 years ago
Posts
2,789
Respect
Forum Rank
King of the Zombies
Primary Group
Community Daedra
My Groups
More
My Contact & Social Links
More
Signature
Let's keep this thread on topic from here on in. -DBZ

+1 to off-topic reply -DBZ

lmao. Too funny.

Goliath Script Placer: http://ugx-mods.com/forum/index.php/topic,11234.msg125257/topicseen.html#new

"...Christ, people. Learn C, instead of just stringing random characters
together until it compiles (with warnings)..."

-Linus Torvalds
×
daedra descent's Groups
Community Daedra
Community Daedra
daedra descent's Contact & Social LinksBlueSoviet
Pl1 has to do with lamp models that switch when the power it turned on.

Code Snippet
Plaintext
//  Replace the light models when the lights turn on and off
light_model_swap( name, model )
{
// while (1)
// {
level waittill( "pl1" ); // Power lights on

players = getlocalplayers();
for ( p=0; p<players.size; p++ )
{
lamps = GetEntArray( p, name, "targetname" );
for ( i=0; i<lamps.size; i++ )
{
lamps[i] SetModel( model );
}
}
}

From dlc3_code.csc in clientscripts. If you have a lot of lamp models it *can* create a delay in the script.
Marked as best answer by HitmanVere 11 years ago
broken avatar :(
×
broken avatar :(
Location: fi
Date Registered: 25 June 2013
Last active: 2 years ago
Posts
3,997
Respect
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.
Mapper Has released one or more maps to the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
Oh yeah, guys, sorry. I was half asleep and I posted wrong piece of code. This is the one:
Code Snippet
Plaintext
power_audio_2d()
{
wait(2);
playsound( 0, "power_down_2d", (0,0,0) );
level waittill ("pl1");
playsound( 0, "power_up_2d", (0,0,0) );
}

Double Post Merge: June 12, 2015, 01:38:06 pm
Couldn't you just change
Code Snippet
Plaintext
level waittill ("pl1");
To
Code Snippet
Plaintext
level waittill ("electricity_on");
Or even
Code Snippet
Plaintext
level waittill ("jugg_on");
Then just change "pa_buzz" to your sound.

Neither of those work, I might need to make new small script for this

Double Post Merge: June 12, 2015, 02:10:24 pm
Theres still delay, but now there is less, I guess its best we can do, lol.

For anyone wondering:
Comment this out in mapname_amb:
Code Snippet
Plaintext
thread power_audio_2d();

In mapname.gsc:
Code Snippet
Plaintext
power_sound()
{
ent = GetEnt("ent","targetname"); // Playing it through script_origin I have been using, change how you want
wait 2;
flag_wait ("electricity_on");
ent playsound("power_up_2d");
}

There are better ways, but this is most simple I can think of :P
Last Edit: June 12, 2015, 03:34:02 pm by HitmanVere
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 27 January 2015
Last active: 10 years ago
Posts
337
Respect
Forum Rank
Perk Hacker
Primary Group
Member
Signature
×
liamsa669's Groups
liamsa669's Contact & Social Links
Oh yeah, guys, sorry. I was half asleep and I posted wrong piece of code. This is the one:
Code Snippet
Plaintext
power_audio_2d()
{
wait(2);
playsound( 0, "power_down_2d", (0,0,0) );
level waittill ("pl1");
playsound( 0, "power_up_2d", (0,0,0) );
}
playsound doesnt need an origin. http://www.zeroy.com/script/sound/playsound.htm
also the "electricity_on" is a flag, not a notification. so use:
Code Snippet
Plaintext
flag_wait( "electricity_on" );
the playsound u seem to be using seems to be the csc version due to having the player's index being the first parameter
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 14 September 2013
Last active: 6 years ago
Posts
1,895
Respect
Forum Rank
Zombie Destroyer
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
BE ORIGINAL
Signature
×
MakeCents's Groups
Mapper Has released one or more maps to the UGX-Mods 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
Couldn't you just add in your dlc3_code to power_electric_switch() function to play your sound? That is right before the electricity flag is set anyway... and where it plays the sound for the switch.

Also, any chance that any of the delay is in your sound?


Code Snippet
Plaintext
ent = GetEnt("ent","targetname");  // Playing it through struct I have been using, change how you want

FYI to alleviate any confusion for newer people that reads this, if you are using GetEnt you are not using a struct, you are using a origin. (You could prob use a struct but then use GetStruct and playsoundatposition instead...?)
Last Edit: June 12, 2015, 03:28:12 pm by MakeCents
broken avatar :(
×
broken avatar :(
Location: fi
Date Registered: 25 June 2013
Last active: 2 years ago
Posts
3,997
Respect
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.
Mapper Has released one or more maps to the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
Couldn't you just add in your dlc3_code to power_electric_switch() function to play your sound? That is right before the electricity flag is set anyway... and where it plays the sound for the switch.

Also, any chance that any of the delay is in your sound?


FYI to alleviate any confusion for newer people that reads this, if you are using GetEnt you are not using a struct, you are using a origin. (You could prob use a struct but then use GetStruct and playsoundatposition instead...?)

Oh yeah, you are right about struct part, I usually use origins on stuff. Will update the comment.
And the delay is almost unnoticable now, so I will leave how it is
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 27 January 2015
Last active: 10 years ago
Posts
337
Respect
Forum Rank
Perk Hacker
Primary Group
Member
×
liamsa669's Groups
liamsa669's Contact & Social Links
i see how it is: he adjusts his script after i fixed it for him and gets the solved post :(
broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 6 years ago
Posts
6,875
Respect
Forum Rank
Immortal
Primary Group
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.
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 LinksHarryBo000[email protected]HarryBo21
i see how it is: he adjusts his script after i fixed it for him and gets the solved post :(
(Image removed from quote.)
Your post was awaiting mod approval, he couldnt see them

 
Loading ...