[ShockRifle] - Change default sound

Discussions about UT99

[ShockRifle] - Change default sound

Postby iSenSe » Mon Apr 16, 2018 6:59 pm

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 iSenSe on Fri Apr 20, 2018 6:19 pm, edited 1 time in total.
User avatar
iSenSe
Experienced
 
Posts: 133
Joined: Mon Aug 31, 2015 12:58 pm

Re: [ShockRifle] - Change default sound

Postby papercoffee » Mon Apr 16, 2018 11:56 pm

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
papercoffee
Site Staff
 
Posts: 8926
Joined: Wed Jul 15, 2009 11:36 am
Location: Cologne, the city with the big cathedral.
Personal rank: coffee addicted !!!

Re: [ShockRifle] - Change default sound

Postby Feralidragon » Tue Apr 17, 2018 12:32 pm

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
Feralidragon
Godlike
 
Posts: 5003
Joined: Wed Feb 27, 2008 6:24 pm
Location: Liandri
Personal rank: Work In Progress

Re: [ShockRifle] - Change default sound

Postby iSenSe » Wed Apr 18, 2018 6:34 pm

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
iSenSe
Experienced
 
Posts: 133
Joined: Mon Aug 31, 2015 12:58 pm

Re: [ShockRifle] - Change default sound

Postby Feralidragon » Wed Apr 18, 2018 11:05 pm

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
Feralidragon
Godlike
 
Posts: 5003
Joined: Wed Feb 27, 2008 6:24 pm
Location: Liandri
Personal rank: Work In Progress

Re: [ShockRifle] - Change default sound

Postby iSenSe » Fri Apr 20, 2018 12:46 pm

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 iSenSe on Fri Apr 20, 2018 3:19 pm, edited 1 time in total.
User avatar
iSenSe
Experienced
 
Posts: 133
Joined: Mon Aug 31, 2015 12:58 pm

Re: [ShockRifle] - Change default sound

Postby PrinceOfFunky » Fri Apr 20, 2018 12:59 pm

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.
Image
User avatar
PrinceOfFunky
Inhuman
 
Posts: 949
Joined: Mon Aug 31, 2015 10:31 pm

Re: [ShockRifle] - Change default sound

Postby iSenSe » Fri Apr 20, 2018 2:41 pm

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
iSenSe
Experienced
 
Posts: 133
Joined: Mon Aug 31, 2015 12:58 pm

Re: [ShockRifle] - Change default sound

Postby PrinceOfFunky » Fri Apr 20, 2018 3:27 pm

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.
Image
User avatar
PrinceOfFunky
Inhuman
 
Posts: 949
Joined: Mon Aug 31, 2015 10:31 pm

Re: [ShockRifle] - Change default sound

Postby iSenSe » Fri Apr 20, 2018 3:46 pm

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
iSenSe
Experienced
 
Posts: 133
Joined: Mon Aug 31, 2015 12:58 pm

Re: [ShockRifle] - Change default sound

Postby PrinceOfFunky » Fri Apr 20, 2018 3:55 pm

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.
Image
User avatar
PrinceOfFunky
Inhuman
 
Posts: 949
Joined: Mon Aug 31, 2015 10:31 pm

Re: [ShockRifle] - Change default sound

Postby iSenSe » Fri Apr 20, 2018 6:13 pm

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
iSenSe
Experienced
 
Posts: 133
Joined: Mon Aug 31, 2015 12:58 pm

Re: [ShockRifle] - Change default sound

Postby PrinceOfFunky » Fri Apr 20, 2018 6:35 pm

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)
Image
User avatar
PrinceOfFunky
Inhuman
 
Posts: 949
Joined: Mon Aug 31, 2015 10:31 pm

Re: [ShockRifle] - Change default sound

Postby iSenSe » Fri Apr 20, 2018 7:03 pm

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
iSenSe
Experienced
 
Posts: 133
Joined: Mon Aug 31, 2015 12:58 pm

Re: [ShockRifle] - Change default sound

Postby PrinceOfFunky » Fri Apr 20, 2018 7:27 pm

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.
Image
User avatar
PrinceOfFunky
Inhuman
 
Posts: 949
Joined: Mon Aug 31, 2015 10:31 pm

Next

Return to General Discussions

Who is online

Users browsing this forum: Dr. Walter, PrinceOfFunky and 3 guests