View unanswered posts | View active topics It is currently Thu Jan 02, 2025 6:47 pm



Reply to topic  [ 15 posts ] 
 impact sounds? 
Author Message

Joined: Sun Jul 11, 2010 12:10 am
Posts: 25
Reply with quote
Post impact sounds?
Is there any way to add sounds to weapons or items so when they drop they make a noise? As if i dropped i grenade it would make a metal click noise. Possible? or just a dream?
I mean it makes a noise when it comes in contact with the floor. :smile:


Wed Nov 24, 2010 9:00 pm
Profile
Data Realms Elite
Data Realms Elite
User avatar

Joined: Tue May 25, 2010 8:27 pm
Posts: 4521
Location: Constant motion
Reply with quote
Post Re: impact sounds?
This is perfectly possible with Lua, but only for the grenade. Not the gun.


Wed Nov 24, 2010 9:15 pm
Profile

Joined: Sun Jul 11, 2010 12:10 am
Posts: 25
Reply with quote
Post Re: impact sounds?
dammit! I was afraid someone was gonna say that! Well i was thinking about making some of the throwable items from dead rising 2 such as cooking oil and other novelty items, yet i wanted to add it to weapons as well without lua, as lua's my weakpoint! are there any other possible ways to work around this method?


Wed Nov 24, 2010 9:19 pm
Profile
Data Realms Elite
Data Realms Elite
User avatar

Joined: Tue May 25, 2010 8:27 pm
Posts: 4521
Location: Constant motion
Reply with quote
Post Re: impact sounds?
This isn't going to happen the way you want it to without Lua, but using an AEmitter you might be able to work the gun.


Wed Nov 24, 2010 9:26 pm
Profile

Joined: Sun Jul 11, 2010 12:10 am
Posts: 25
Reply with quote
Post Re: impact sounds?
i see what your thinking yet im not fully there. Could you explain in a bit more depth for those with less knowledge?


Wed Nov 24, 2010 9:44 pm
Profile
Data Realms Elite
Data Realms Elite
User avatar

Joined: Tue May 25, 2010 8:27 pm
Posts: 4521
Location: Constant motion
Reply with quote
Post Re: impact sounds?
Hmm...
Code:
function Update(self)
    if self.Pos.Y <= SceneMan:FindAltitude(self.Pos,0,0) then
        AudioMan:PlaySound("Folder.rte/File.wav");
        self:GibThis;
    end
end

That would [hopefully] work on a TDExplosive.

Still thinking about the gun, though.


Wed Nov 24, 2010 9:56 pm
Profile

Joined: Sun Jul 11, 2010 12:10 am
Posts: 25
Reply with quote
Post Re: impact sounds?
Thanks for that code! and thanks for giving me suggestions!


Wed Nov 24, 2010 10:12 pm
Profile
Data Realms Elite
Data Realms Elite
User avatar

Joined: Tue May 25, 2010 8:27 pm
Posts: 4521
Location: Constant motion
Reply with quote
Post Re: impact sounds?
Yea I'm just hoping it works.


Wed Nov 24, 2010 10:17 pm
Profile

Joined: Sun Jul 11, 2010 12:10 am
Posts: 25
Reply with quote
Post Re: impact sounds?
tried the script. Unfortunatley it crashes cc with no error line! Thanks for trying though! :)


Wed Nov 24, 2010 10:36 pm
Profile
REAL AMERICAN HERO
User avatar

Joined: Sat Jan 27, 2007 10:25 pm
Posts: 5655
Reply with quote
Post Re: impact sounds?
playsound doesn't work; you'll have to create an emitter that plays your sound


Thu Nov 25, 2010 12:46 am
Profile
Data Realms Elite
Data Realms Elite
User avatar

Joined: Tue May 25, 2010 8:27 pm
Posts: 4521
Location: Constant motion
Reply with quote
Post Re: impact sounds?
Damn, didn't realise that. Do as Grif says, he knows more than I.


Thu Nov 25, 2010 12:47 am
Profile

Joined: Sun Jul 11, 2010 12:10 am
Posts: 25
Reply with quote
Post Re: impact sounds?
Sorry to ask but how would i go about modifying a aemitter to only play the sound on impact?


Thu Nov 25, 2010 8:21 pm
Profile
Data Realms Elite
Data Realms Elite
User avatar

Joined: Tue May 25, 2010 8:27 pm
Posts: 4521
Location: Constant motion
Reply with quote
Post Re: impact sounds?
Right, here you need a sound particle, and an AEmitter to emit said sound particle, but you only want said sound particle to be emitted upon hitting terrain.

Effectively, it's the script above, but replace the playsound and the gibthis with the command for beginning the emission.


Thu Nov 25, 2010 11:22 pm
Profile
User avatar

Joined: Wed Feb 17, 2010 12:07 am
Posts: 1545
Location: That small peaceful place called Hell.
Reply with quote
Post Re: impact sounds?
Roast that made little to no sense at all..

What you need to do is make your Emitter, Make it emit something that doesnt matter or affect anything seriously (Air Blast for ex.) and give the emitter a play sound for when it emits something. Next is use the Script above to create the Emitter for when it hits the ground and thats basically all you need to do.

To give the Emitter a sound to play for when it emits is put this anywhere in the Emitter's code.

Code:
   EmissionSound = Sound
      AddSample = ContentFile
         Path = "Sound Path"


That should be it, Good luck.


Fri Nov 26, 2010 6:57 am
Profile

Joined: Sun Oct 11, 2009 7:47 pm
Posts: 132
Reply with quote
Post Re: impact sounds?
You could check the velocity and emit the sound when the velocity drops rapidly.


Sat Nov 27, 2010 6:44 am
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 15 posts ] 

Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.043s | 15 Queries | GZIP : Off ]