Binoc sound


(P4nth3r) #1

Hi everybody,

I ran into a little problem and no matter what I try it won’t work correct.
Here is what it should do.

When you push your binoculars button (normally B) I want it to play a sound.
That’s all. =/

I tried putting the sound into the binocs.weap, but that did nothing.
Then I tried to put it into human_base.script file so when the animation is played it will make the sound, but OR it played nothing (at the raise animation, or it kept repeating the sound 10 times a second on the holding binocs animation. =/

Isn’t there a way that works to do this??
Without changing the source??

Thanks & Greetz Way2Evil a.k.a Panther


(xro) #2

bind b “+zoom; play <sound>”

im not sure if its play but there is a command that plays a sound, only client side afaik


(=SC=Beef) #3

readySound “your/sound/file.wav”
That would play the sound and afaik repeat it over and over till you change weapon

firingSound “your/sound/file.wav”
‘should’ play once when you ‘use’ the binocs ie zoom in


(P4nth3r) #4

Well that noth won’t do guys. =(

I need this server side casue it’s part of my mod.

and the readysound and firingsound both do nothing with binocs. =/

But thanx for trying, any thing else that might work??

Greetz Panther


(Elite) #5

No such thing as serverside media (in this type of situation). Place it in you’re mod pk3, in the weap file, and it will be “serverside”, to the extent I think you mean. All clients will need to have it when you have it on your server in your mod directory and run a pure server.

True serverside would require code changes, because you would have to tell the client when to play the sound, and what sound, and the sound would still have to be loaded/registered on the client.


(P4nth3r) #6

yeah you are right Elite, but I just mean that it is embedded in the mod.
So they have to download that anyway.

I made the same thing work with the knife just be putting: sound sound/knife/mymodsound.wav behind the animation that is played to get yuour knife, and that works fine.
But when I try and do the same with binocs it just doesn’t work. =(

Any more ideas anyone?

Greetz Panther a.k.a. Way2Evil


(Elite) #7

Well, the only problem making the server aware of the file, is that if the server loses the file (physically) or something of the sort, clients won’t get this file anyhow, and won’t be able to play it.

If a pure server is run (and in my opinion, it always should be) the problem is solved anyhow.

I assume you don’t have new cgame/qagame/ui modules compiled? It still doesn’t mean that the mod can’t go in another folder and be it’s own mod. It will look in etmain on the server for the modules when it doesn’t find them in the mod directory, yet you are still playing your mod, and all files associated with it would be needed (does that make any sense?? I’ll clarify better if it don’t). To test this out, you can place junk folders in the wolf install directory (in the same folder as etmain + other mods), load up the mods menu in ET, and you will see it is populated with the junk folders.

=============

Now, the problem you are having, I assume, is that you are not actually using your binocs, lol. Trust me on this one. If you cycle through your weapons, then select the binocs while cycling, your sound will probably work. I imagine you are normally using your binocs with the “b” key, which is just a +zoom command, not a “pull out the binocs then zoom” command. I know it’s a little wierd, but try it and see what happens. To get that to change, coding would be needed in the appropriate function call (probably in CG_Zoom or w/e the function is, I know that’s close, although maybe not exact).

The binocs are a very woerd item in ET. All they do is enable you to zoom, they don’t actually zoom themselves. I don’t know why it is this way, but some of the reasoning would be to 1) Get the zoom in the game as quick as possible to atleast see what’s going on 2) combined with step 1, for the scoped weapons, and 3) to test out the arty function when the models weren’t made. All the development stage, when working in a team, can be a mess, and sometimes pieces of the puzzle aren’t/won’t be ready until a later stage, and testing needs to be done before to make sure things work, then it is just “glued” together, so to speak.


(P4nth3r) #8

Thanx for this wise lesson Elite.
Well as you might now I’m working a bit an the duke mod again and I thought it would be fun to let the binocs make a little on/off sound.
But I guess I have to wait until I found another coder to implant this.

Thanks anyway.

Greetz Panther a.k.a. Way2Evil


(Elite) #9

Btw, did it work with the binocs out when you cycled through the weapons (so you can actually see the binoculars in the hands)??

I had a somewhat similar problem myself, when I turned the arty into limited amounts (like a clip), and it worked only that way (ofcourse until I fixed it only though lol, it’s fine now).

Anyhow, good luck.


(P4nth3r) #10

Well i didn’t try that, cause I disabled that in my mod.
So it would be useless for me anyway.

But the strange thing about the sound not playing when I put it in the “human_base.script” is that it works with the knife but not with binocs, but it still plays the animation to bring the binocs to face etc. in 3rd person.
So it should work, but it doens’t =(

Well I’m gonna start coding for the mod myself again soon, so I problably will be posting loads of help here since I’m so noob in it. ^^

Thnx & Greetz Panther a.k.a. Way2Evil