Author |
Message |
pileup
Joined: Sun Jul 11, 2010 12:10 am Posts: 25
|
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.
|
Wed Nov 24, 2010 9:00 pm |
|
|
Roast Veg
Data Realms Elite
Joined: Tue May 25, 2010 8:27 pm Posts: 4521 Location: Constant motion
|
Re: impact sounds?
This is perfectly possible with Lua, but only for the grenade. Not the gun.
|
Wed Nov 24, 2010 9:15 pm |
|
|
pileup
Joined: Sun Jul 11, 2010 12:10 am Posts: 25
|
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 |
|
|
Roast Veg
Data Realms Elite
Joined: Tue May 25, 2010 8:27 pm Posts: 4521 Location: Constant motion
|
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 |
|
|
pileup
Joined: Sun Jul 11, 2010 12:10 am Posts: 25
|
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 |
|
|
Roast Veg
Data Realms Elite
Joined: Tue May 25, 2010 8:27 pm Posts: 4521 Location: Constant motion
|
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 |
|
|
pileup
Joined: Sun Jul 11, 2010 12:10 am Posts: 25
|
Re: impact sounds?
Thanks for that code! and thanks for giving me suggestions!
|
Wed Nov 24, 2010 10:12 pm |
|
|
Roast Veg
Data Realms Elite
Joined: Tue May 25, 2010 8:27 pm Posts: 4521 Location: Constant motion
|
Re: impact sounds?
Yea I'm just hoping it works.
|
Wed Nov 24, 2010 10:17 pm |
|
|
pileup
Joined: Sun Jul 11, 2010 12:10 am Posts: 25
|
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 |
|
|
Grif
REAL AMERICAN HERO
Joined: Sat Jan 27, 2007 10:25 pm Posts: 5655
|
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 |
|
|
Roast Veg
Data Realms Elite
Joined: Tue May 25, 2010 8:27 pm Posts: 4521 Location: Constant motion
|
Re: impact sounds?
Damn, didn't realise that. Do as Grif says, he knows more than I.
|
Thu Nov 25, 2010 12:47 am |
|
|
pileup
Joined: Sun Jul 11, 2010 12:10 am Posts: 25
|
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 |
|
|
Roast Veg
Data Realms Elite
Joined: Tue May 25, 2010 8:27 pm Posts: 4521 Location: Constant motion
|
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 |
|
|
Coops
Joined: Wed Feb 17, 2010 12:07 am Posts: 1545 Location: That small peaceful place called Hell.
|
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 |
|
|
Commodore111
Joined: Sun Oct 11, 2009 7:47 pm Posts: 132
|
Re: impact sounds?
You could check the velocity and emit the sound when the velocity drops rapidly.
|
Sat Nov 27, 2010 6:44 am |
|
|
|