marauder2k9 Posted October 9, 2015 Share Posted October 9, 2015 I have been trying to code a shotgun mic in script:- What it does is when u zoom in through the scope u can hear the sounds being played at the area u point the crosshair, I'm sure we've all seen something like this done in games before. Closest one i could think of is Codename Outbreak or i think metal gear solid v has the same sort of thing too Quote Link to comment Share on other sites More sharing options...
rlranft Posted October 9, 2015 Share Posted October 9, 2015 I've never really fiddled with listeners before, but I'd say you would create a new 3D listener and switch to it during the "zoom" - maybe use a ray-cast to get your distance, but if you're not actually aiming at something it might give you no coordinates since there will be no collision. I don't know if listeners are exposed in this fashion to script either - just thinking out loud. Quote Link to comment Share on other sites More sharing options...
marauder2k9 Posted October 9, 2015 Author Share Posted October 9, 2015 hmmm where would i start with something like that? can torque have multiple listeners? I could probably add to the idea of the ray cast and get some sort of way of calling back what object is being listened to Quote Link to comment Share on other sites More sharing options...
rlranft Posted October 11, 2015 Share Posted October 11, 2015 Not sure about that, either - It has to support at least one per client, I'm guessing you'd create the new one and switch the client to use it then switch back to the player's listener. Or perhaps you could just move the player's listener to the new location. Quote Link to comment Share on other sites More sharing options...
marauder2k9 Posted October 11, 2015 Author Share Posted October 11, 2015 hmm now moving the players listener sounds intriguing. I havent looked at the code yet but im guessing a simple bool might be able to control stuff like that, is the players listener position exposed to script already? Quote Link to comment Share on other sites More sharing options...
rlranft Posted October 12, 2015 Share Posted October 12, 2015 1) I don't think it's exposed to script.2) A simple bool would control stuff like what? I'm certain the listener's position is a full 3D transform - position and rotation - so I am not sure where you're going with that. I'm also pretty sure that the listener is assigned to a node in the player model by default. Quote Link to comment Share on other sites More sharing options...
marauder2k9 Posted October 13, 2015 Author Share Posted October 13, 2015 a simple bool would control whether the 3d listener is placed at the players position or the raycasts position is what i mean Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.