[ShockRifle] - Change default sound

Discussions about UT99
User avatar
esnesi
Godlike
Posts: 1018
Joined: Mon Aug 31, 2015 12:58 pm
Personal rank: Dialed in.

[ShockRifle] - Change default sound

Post by esnesi »

Hello All!

My goal is to change the default sound of the enhanced shock rifle (instagib gun).
Why ? Because its too loud and alot of people i know and play with have this exact same issue.
(keep busy tweaking teamspeak sound volumes to hear eachother decently and so on)

What sound do i want to replace it with?
Well i would to replace it with the sound of the BT i4Games_9b rifle.
Its the same gun, and has a lower and better sound.

Fiddled around with Stuffswapper, but i seem to only replace weapons and adjust firing posibilities.

Any tips on how i can achieve this goal ?
Unfortunatly i dont have any uscript knowledge to recompile the gun with a lower volume.. with the right knowledge this seems a little thing to me.
Last edited by esnesi on Fri Apr 20, 2018 6:19 pm, edited 1 time in total.
User avatar
papercoffee
Godlike
Posts: 10443
Joined: Wed Jul 15, 2009 11:36 am
Personal rank: coffee addicted !!!
Location: Cologne, the city with the big cathedral.
Contact:

Re: [ShockRifle] - Change default sound

Post by papercoffee »

iSenSe wrote: Unfortunatly i dont have any uscript knowledge to recompile the gun with a lower volume.. with the right knowledge this seems a little thing to me.
This would be my first guess ...subclass the weapon.
User avatar
Feralidragon
Godlike
Posts: 5489
Joined: Wed Feb 27, 2008 6:24 pm
Personal rank: Work In Progress
Location: Liandri

Re: [ShockRifle] - Change default sound

Post by Feralidragon »

Well, I am not sure if there's something from which you can already do it, but it's not a complicated thing to build.

You would need to do either:
1 - Create a subclass from that weapon, as papercoffee mentioned, and just change its FireSound property to have the sound you want.
And then create a mutator to replace the weapon by your own subclassed one.

2 - Or, create a mutator which for every one of those weapons spawned, assign the new sound to the FireSound property.
Very similar to the above, except that this way you don't need to subclass into a new weapon.

3 - Or, since your issue is the volume, rather than the sound it self, another alternative would be to create a mutator which adjusted the players SoundDampening to something lower, given that it is being used to set the volume of that sound in the first place.
This may affect other player driven sounds though, such as steps, sounds from other weapons and others. Whether or not this is a problem for you, it's up to you, but considering this is for instagib from what I gather, this would the the only weapon in the game and the step sounds are rather meaningless for gameplay.


Either way you choose, you always have to create a mutator.
As for how to create a mutator, if you never did it before, this could be a good start for you, and follow this: viewtopic.php?f=57&t=4482
It teaches how to create a very simple mutator, and after that you should be acquainted enough to at least know how to compile code and create a basic mutator, so then to make it do something like this would be just another step, which maybe we could help you with along the way if you wish.
User avatar
esnesi
Godlike
Posts: 1018
Joined: Mon Aug 31, 2015 12:58 pm
Personal rank: Dialed in.

Re: [ShockRifle] - Change default sound

Post by esnesi »

Thanks for your time, explanation and link.
I need a 'rainy sunday' for this i see, and the time to create and achieve this mutator.

SoundDampening - dont like your read about that variable though :tongue: , footstep-volume and other effects should stay the same, important for insta.

FireSound - Am i able to replace it with the default lowered sound ? Or is there a other variable/property available for lowering a weapons firing volume?
(Creating a new sound and replacing it with a custom one takes more time and knowledge if i understand correctly)
User avatar
Feralidragon
Godlike
Posts: 5489
Joined: Wed Feb 27, 2008 6:24 pm
Personal rank: Work In Progress
Location: Liandri

Re: [ShockRifle] - Change default sound

Post by Feralidragon »

All the 3 solutions actually take around the same amount of time and knowledge, in absolute terms.
They only differ a bit between themselves, relatively speaking.

You can replace the FireSound by your own sound if you wish, even if this sound is just the existing one exported and edited to have a lower base volume.
It's just that, in order to do so, you will always need to create a mutator at least, then there are a few ways to do that sound switch.

Another way that I didn't mention, is to override the ShockRifle functions which actually play this sound, so that you can set which volume to use for it.
This is "more complicated", especially if you intend to extend a custom shockrifle, such as a ZP or NewNet one, which may have their code obfuscated in the first place, so it may be quite impossible to do this switch without messing something else up, but it gives full control of the volume itself without having to edit the sound itself.

Either way, I am not sure if you have any programming experience at all in any language, so I am not sure how foreign does making something like this by yourself looks like at the moment.
If your programming experience is exactly zero, I may be able to reserve a bit of time for this and create a package for you (all I would need would be the sound you want to play and know exactly which class you want to affect).
If not, I strongly advise you to learn to do a mutator like this yourself, for your own benefit, since UScript and the overall game is quite simple and straightforward, and you will have a lot more power on your hands if you decide to learn this stuff. :)
User avatar
esnesi
Godlike
Posts: 1018
Joined: Mon Aug 31, 2015 12:58 pm
Personal rank: Dialed in.

Re: [ShockRifle] - Change default sound

Post by esnesi »

Feralidragon wrote: Either way, I am not sure if you have any programming experience at all in any language, so I am not sure how foreign does making something like this by yourself looks like at the moment.
If your programming experience is exactly zero, I may be able to reserve a bit of time for this and create a package for you (all I would need would be the sound you want to play and know exactly which class you want to affect).
If not, I strongly advise you to learn to do a mutator like this yourself, for your own benefit, since UScript and the overall game is quite simple and straightforward, and you will have a lot more power on your hands if you decide to learn this stuff. :)
I work in IT support, but have no coding knowledge unfortunatly, exactly zero indeed.
Definitely need to look at this myself one day because of all the possibilities i could have for our server.
Need to pump up my interest for it!

If you like to to this, offcourse very welcome! ;)
And i thank you for your time to get me up to speed!

The class i want to effect is i guess the supershockrifle from UNN1.
If possible replace firesound with the one from:
http://unrealtournament.99.free.fr/utfi ... stagib.zip
(lowering the default in volume needs testing, and is personal i assume, this sound will do perfect!)

I now use UltimateNewNet (build1) and its rifles.
http://forum.ultimateut.tk/viewtopic.ph ... 38e25f2a01

Will it be compatible for future UNN updates if offcourse the question.
Last edited by esnesi on Fri Apr 20, 2018 3:19 pm, edited 1 time in total.
User avatar
PrinceOfFunky
Godlike
Posts: 1200
Joined: Mon Aug 31, 2015 10:31 pm

Re: [ShockRifle] - Change default sound

Post by PrinceOfFunky »

Or you can use AdvancedMutator, which no one uses :D, it basically catches some events that are fired during the gameplay, so even sniperrifle spawning events are catched and you could replace the sounds.
Or you can create an external sound file on the client(so that you don't have to convert it) and play it by using the batch from unrealscript everytime the player shoots with the sniperrifle.
"Your stuff is known to be buggy and unfinished/not properly tested"
User avatar
esnesi
Godlike
Posts: 1018
Joined: Mon Aug 31, 2015 12:58 pm
Personal rank: Dialed in.

Re: [ShockRifle] - Change default sound

Post by esnesi »

Was thinking in that direction a bit as well.

When the server gets a action to play the ShockRifle firesound, my client plays the BT one, or a lowered one whatever.
But probably have to modify existing *.u systemfiles which ACE doesnt like.
User avatar
PrinceOfFunky
Godlike
Posts: 1200
Joined: Mon Aug 31, 2015 10:31 pm

Re: [ShockRifle] - Change default sound

Post by PrinceOfFunky »

iSenSe wrote:Was thinking in that direction a bit as well.

When the server gets a action to play the ShockRifle firesound, my client plays the BT one, or a lowered one whatever.
But probably have to modify existing *.u systemfiles which ACE doesnt like.
Well, modify an existing package is never a good choice, especially if that package has already been downloaded by other people, there would be thrown a mismatch error.
I doubt ACE knows about the batch calls from unrealscript yet.
"Your stuff is known to be buggy and unfinished/not properly tested"
User avatar
esnesi
Godlike
Posts: 1018
Joined: Mon Aug 31, 2015 12:58 pm
Personal rank: Dialed in.

Re: [ShockRifle] - Change default sound

Post by esnesi »

PrinceOfFunky wrote:
iSenSe wrote:Was thinking in that direction a bit as well.

When the server gets a action to play the ShockRifle firesound, my client plays the BT one, or a lowered one whatever.
But probably have to modify existing *.u systemfiles which ACE doesnt like.
Well, modify an existing package is never a good choice, especially if that package has already been downloaded by other people, there would be thrown a mismatch error.
I doubt ACE knows about the batch calls from unrealscript yet.
Was thinking in the direction of clientsided.
Like that it only plays the new sound on my client.
User avatar
PrinceOfFunky
Godlike
Posts: 1200
Joined: Mon Aug 31, 2015 10:31 pm

Re: [ShockRifle] - Change default sound

Post by PrinceOfFunky »

iSenSe wrote:
PrinceOfFunky wrote:
iSenSe wrote:Was thinking in that direction a bit as well.

When the server gets a action to play the ShockRifle firesound, my client plays the BT one, or a lowered one whatever.
But probably have to modify existing *.u systemfiles which ACE doesnt like.
Well, modify an existing package is never a good choice, especially if that package has already been downloaded by other people, there would be thrown a mismatch error.
I doubt ACE knows about the batch calls from unrealscript yet.
Was thinking in the direction of clientsided.
Like that it only plays the new sound on my client.
You still would need to replace the sounds with None and catch the weapon shooting event(to then play the external sound file) or make a subclass of it.
"Your stuff is known to be buggy and unfinished/not properly tested"
User avatar
esnesi
Godlike
Posts: 1018
Joined: Mon Aug 31, 2015 12:58 pm
Personal rank: Dialed in.

Re: [ShockRifle] - Change default sound

Post by esnesi »

Assuming the sound is included in the ultimatenewnet*.u file cause NewNet/ZP in general doesnt contain any sound files.
I need to recompile that file with the new sound included.

But to see what that sound/class that i want is called like, i would be able to check this with your AdvancedMutator correct?
I've set it up on our BT server, mutator loads correctly, but iam not getting any logging from it.
What am i doing wrong ?

I want to load this serversided, so custom serverpackages (renamed) will be send to clients.
User avatar
PrinceOfFunky
Godlike
Posts: 1200
Joined: Mon Aug 31, 2015 10:31 pm

Re: [ShockRifle] - Change default sound

Post by PrinceOfFunky »

iSenSe wrote:Assuming the sound is included in the ultimatenewnet*.u file cause NewNet/ZP in general doesnt contain any sound files.
I need to recompile that file with the new sound included.

But to see what that sound/class that i want is called like, i would be able to check this with your AdvancedMutator correct?
I've set it up on our BT server, mutator loads correctly, but iam not getting any logging from it.
What am i doing wrong ?

I want to load this serversided, so custom serverpackages (renamed) will be send to clients.
I don't remember much of my AdvancedMutator, I never made a tutorial D: . What are you trying to do so?
EDIT: Anyway with the AdvancedMutator, its class AdvancedMutatorManager checks for any spawned actor and sends it to the other mutators through the "isRelevant()" function. So you just would need to create a mutator and define the function isRelevant, like so:

Code: Select all

function bool IsRelevant(Actor Other, out byte bSuperRelevant)
{
	local bool bResult;

	bResult = super.IsRelevant(Other, bSuperRelevant);
	if (bResult)
		if (Other.IsA('SniperRifle'))
			//CHANGE THE SOUND HERE

	return bResult;
}
(Didn't try it)
"Your stuff is known to be buggy and unfinished/not properly tested"
User avatar
esnesi
Godlike
Posts: 1018
Joined: Mon Aug 31, 2015 12:58 pm
Personal rank: Dialed in.

Re: [ShockRifle] - Change default sound

Post by esnesi »

PrinceOfFunky wrote: I don't remember much of my AdvancedMutator, I never made a tutorial D: . What are you trying to do so?
EDIT: Anyway with the AdvancedMutator, its class AdvancedMutatorManager checks for any spawned actor and sends it to the other mutators through the "isRelevant()" function. So you just would need to create a mutator and define the function

Code: Select all

function bool IsRelevant(Actor Other, out byte bSuperRelevant)
{
	local bool bResult;

	bResult = super.IsRelevant(Other, bSuperRelevant);
	if (bResult)
		if (Other.IsA('SniperRifle'))
			//CHANGE THE SOUND HERE

	return bResult;
}
(Didn't try it)
Not any coding knowledge here.
What iam trying to do is my first post.

I was assuming AdvancedMutator would log that firesound code somewhere, where i could pick it up, and paste it somewhere ;) (as i dont write code, this seemed handy)
But i guess iam farfetching it.

Thanks for the tips, but this wont get me anywhere with no uscript knowledge.
Also dont have the time to learn about uscript.

Waiting for that rainy sunday to come, so i can check how to achieve my own mutator with the recompiled weapon.
StuffSwapper sounded promising and easy, but has no audio functionality.

Something like that would be way easier offcourse for a admin with no uscript knowledge, imagine scrolling through a dropdown-box of available sounds/classes and press ''COMPILE'' and it spits out the right files :)
User avatar
PrinceOfFunky
Godlike
Posts: 1200
Joined: Mon Aug 31, 2015 10:31 pm

Re: [ShockRifle] - Change default sound

Post by PrinceOfFunky »

iSenSe wrote:
PrinceOfFunky wrote: I don't remember much of my AdvancedMutator, I never made a tutorial D: . What are you trying to do so?
EDIT: Anyway with the AdvancedMutator, its class AdvancedMutatorManager checks for any spawned actor and sends it to the other mutators through the "isRelevant()" function. So you just would need to create a mutator and define the function

Code: Select all

function bool IsRelevant(Actor Other, out byte bSuperRelevant)
{
	local bool bResult;

	bResult = super.IsRelevant(Other, bSuperRelevant);
	if (bResult)
		if (Other.IsA('SniperRifle'))
			//CHANGE THE SOUND HERE

	return bResult;
}
(Didn't try it)
Not any coding knowledge here.
What iam trying to do is my first post.

I was assuming AdvancedMutator would log that firesound code somewhere, where i could pick it up, and paste it somewhere ;) (as i dont write code, this seemed handy)
But i guess iam farfetching it.

Thanks for the tips, but this wont get me anywhere with no uscript knowledge.
Also dont have the time to learn about uscript.

Waiting for that rainy sunday to come, so i can check how to achieve my own mutator with the recompiled weapon.
StuffSwapper sounded promising and easy, but has no audio functionality.

Something like that would be way easier offcourse for a admin with no uscript knowledge, imagine scrolling through a dropdown-box of available sounds/classes and press ''COMPILE'' and it spits out the right files :)
Well you should have asked if someone could make it for you, there's no mutator which logs out the code just to copy and paste it lol.
"Your stuff is known to be buggy and unfinished/not properly tested"
Post Reply