Using sustained sounds for a weapon.

Started by Bog, August 01, 2014, 05:14:55 PM

Previous topic - Next topic

Bog

In the in-game sound effects there are two basic categories, sustained sounds and oneshots.

Weapons normally use oneshots, but I'd like to get the new saw-blade weapon that I made to have a saw sound.

I'd be fine with it making the sound for a second when firing, but it'd be really cool if I could make it keep playing the sound as long as it's flying.

I went and put Recipe_MakeWoodPlanks_Electric into the <firesound> of the weapon's .hml file but it causes a bug report that says something along the lines of "tried playing a sustained sound as a oneshot".

Does anybody know how to let me use a sustained sound on a weapon using .hml files? (or .dll if that's the only way)
Divergence of Civilization Lead Developer (in this case that's the fancy way of saying "Only Developer")

Project Armoury Developer (New huge 2.13 Release now live!)

Somz

#1
Quote from: Bog on August 01, 2014, 05:14:55 PM
In the in-game sound effects there are two basic categories, sustained sounds and oneshots.

Weapons normally use oneshots, but I'd like to get the new saw-blade weapon that I made to have a saw sound.

I'd be fine with it making the sound for a second when firing, but it'd be really cool if I could make it keep playing the sound as long as it's flying.

I went and put Recipe_MakeWoodPlanks_Electric into the <firesound> of the weapon's .hml file but it causes a bug report that says something along the lines of "tried playing a sustained sound as a oneshot".

Does anybody know how to let me use a sustained sound on a weapon using .hml files? (or .dll if that's the only way)

Let us try to help each other out. ◕‿↼
I've been trying to mod pretty much everything lately, every XML of mine is a mess but in any case, I've run into an interesting line (though I think you have seen it aswell...)
<soundAmbient>MortarRound_Ambient</soundAmbient> (mortal's xml, core) is the constant sound of the bomb flying.
It is a sustained sound if I'm not mistaken, ends at the moment of the impact. Right? (ಠ_ಠ)
It's supposed to be an audio file somewhere buried in the game I guess, using this as a blueprint you could create the weapon and replace the sound with the one you're trying to use, probably. You have the audio file of the sawblade flying, right?


Alright, your turn, any idea how could I get flamethrower sound, how could I apply it to a fast-firing gun?
(。◕‿‿◕。)
I see no alternative but to use big flame textures rapidly appearing one after another (done), but simply using the "shoot" sound would cut it and repeat from the start each time the gun fires, right?
To beer or not to beer.
That is a laughable question.

Bog

Quote from: Cyst on August 01, 2014, 06:03:19 PM
Let us try to help each other out. ◕‿↼
I've been trying to mod pretty much everything lately, every XML of mine is a mess but in any case, I've run into an interesting line (though I think you have seen it aswell...)
<soundAmbient>MortarRound_Ambient</soundAmbient> (mortal's xml, core) is the constant sound of the bomb flying.
Nope I did not see that. I haven't done any mortar work yet. (though it's on my uber-long to-do list) Thanks for pointing it out, it's helped me a lot.

Quote from: Cyst on August 01, 2014, 06:03:19 PM
It is a sustained sound if I'm not mistaken, ends at the moment of the impact. Right? (ಠ_ಠ)
It's supposed to be an audio file somewhere buried in the game I guess, using this as a blueprint you could create the weapon and replace the sound with the one you're trying to use, probably.
Well I just went ahead and put <soundAmbient>Recipe_MakeWoodPlanks_Electric</soundAmbient> under the projectile for my weapon in the same place it was in the mortar's file.

The sound file is from in the game. I think it's there for construction or something. Or maybe a concept that was removed or hasn't been implemented yet.

It worked well but the sound was hideous, as it's someone actually sawing something in game rather then a saw running freely without contact.

Then I went and tried to figure out some good sounds for your flamethrower, and well I tested Recipe_CremateCorpse for the sound and it actually sounded enough like a spinning saw blade slicing though the air that I used that instead.

The Recipe_CremateCorpse sound doesn't have a maximum for how many can stack, so if every bullet had the same sound running in fully automatic fire then the sound might stack enough on that your flamethrower might sound very "aggressive" and cool. Except not at all cool obviously. Very very hot. ;D

If you look under core/defs/sounddefs there's a lot of files which have the available sounds in them.

As I said earlier, they come in 2 categories. There's sustainers and onehshots

Another one that I tested for your flamethrower is called FireBurning, but for whatever reason it didn't make any sound. I speculated that the sound might have a very long start-up time, so you don't hear it before the bullet strikes.



PS: As a side note I noticed that we can give our guns an ambient thunder sound now. I imagine that'll sound amazing if I can come up with a good gun to put it on. 8)
Divergence of Civilization Lead Developer (in this case that's the fancy way of saying "Only Developer")

Project Armoury Developer (New huge 2.13 Release now live!)

Somz

Quote from: Bog on August 01, 2014, 07:27:47 PM

The Recipe_CremateCorpse sound doesn't have a maximum for how many can stack, so if every bullet had the same sound running in fully automatic fire then the sound might stack enough on that your flamethrower might sound very "aggressive" and cool. Except not at all cool obviously. Very very hot. ;D

If you look under core/defs/sounddefs there's a lot of files which have the available sounds in them.


Oh that sounds cool, I mean hot enough, I'm going to try it now. ^^

Quote from: Bog on August 01, 2014, 07:27:47 PM

PS: As a side note I noticed that we can give our guns an ambient thunder sound now. I imagine that'll sound amazing if I can come up with a good gun to put it on. 8)


I am trying to make a something-like-that weapon, the next on the to-do list a giant lazor instantly hitting stuff, though when I tried to make a nice, long "bullet" texture it was sized down in-game for whatever reasons, so I just proceeded with the more-important BBQ weapon. ^^

Thank you!
To beer or not to beer.
That is a laughable question.

Shinzy

Quote from: Cyst on August 02, 2014, 03:27:59 AM
though when I tried to make a nice, long "bullet" texture it was sized down in-game for whatever reasons

Usually when the textures get skewed or sized down
it's caused by the dimensions of the image being uneven or too big

sounds like that might be the issue there

Try to resize your bullet texture to have the edges as close to the actual bullet
as possible

I haven't played around with weapons yet so I don't know if bullets work different somehow, but I doubt they would =P

mrofa

Bullet texture is set to 64x64 size and it wont change unless you do that in dll.
All i do is clutter all around.

Somz

Quote from: mrofa on August 02, 2014, 06:37:43 AM
Bullet texture is set to 64x64 size and it wont change unless you do that in dll.

Damn. So much for my super mega deathstructor 9001 ultra lazor annihilator... It'd have been beautiful...
To beer or not to beer.
That is a laughable question.

Bog

#7
Quote from: Cyst on August 02, 2014, 07:43:17 AM
Quote from: mrofa on August 02, 2014, 06:37:43 AM
Bullet texture is set to 64x64 size and it wont change unless you do that in dll.

So much for my super mega deathstructor 9001 ultra lazor annihilator... It'd have been beautiful...

Yeah, it'd be nice is somebody came up with a good beam weapon mod and let everybody use it's coding for new guns.

When working on project armoury I can think of a lot of weapons that would use it, but so far I have the shelve them for the time being.

Edit: By the way, does anybody know how to make fire-explosions not make a sound? I made a Falarica (Basically a javelin wrapped in tow, soaked in fuel, lit then thrown) but I'd like it to just start a fire where it hits, not make the loud sound that Molotov cocktails have. (I can already make it spawn a fuel pool where it hits even when just a normal bullet thanks to some previous work by mrofa)

Divergence of Civilization Lead Developer (in this case that's the fancy way of saying "Only Developer")

Project Armoury Developer (New huge 2.13 Release now live!)

ZestyLemons

Quote from: Bog on August 02, 2014, 01:28:41 PM
Quote from: Cyst on August 02, 2014, 07:43:17 AM
Quote from: mrofa on August 02, 2014, 06:37:43 AM
Bullet texture is set to 64x64 size and it wont change unless you do that in dll.

So much for my super mega deathstructor 9001 ultra lazor annihilator... It'd have been beautiful...

Yeah, it'd be nice is somebody came up with a good beam weapon mod and let everybody use it's coding for new guns.

When working on project armoury I can think of a lot of weapons that would use it, but so far I have the shelve them for the time being.

Edit: By the way, does anybody know how to make fire-explosions not make a sound? I made a Falarica (Basically a javelin wrapped in tow, soaked in fuel, lit then thrown) but I'd like it to just start a fire where it hits, not make the loud sound that Molotov cocktails have. (I can already make it spawn a fuel pool where it hits even when just a normal bullet thanks to some previous work by mrofa)

Take a look at the T9 incendiary rifle. Has a chance to spawn fire, minus the boom.
Help out with the wiki!

Steam: http://steamcommunity.com/id/Divaya/
Wiki: http://rimworldwiki.com/wiki/User:Zesty

Feel free to contact me about wiki questions or wiki admin stuff.

Bog

Quote from: ZestyLemons on August 04, 2014, 06:17:32 AM
Take a look at the T9 incendiary rifle. Has a chance to spawn fire, minus the boom.
Thanks, I'll look into that.
Divergence of Civilization Lead Developer (in this case that's the fancy way of saying "Only Developer")

Project Armoury Developer (New huge 2.13 Release now live!)

Rikiki

Laser weapon is under work by Mining & Co.! Wear your glasses now! 8)

[attachment deleted by admin: too old]

skullywag

My flamethrower in my more weapons mod uses the fire ambient as a one shot, VERY simple to do. Just as an example of doing this.
Skullywag modded to death.
I'd never met an iterator I liked....until Zhentar saved me.
Why Unity5, WHY do you forsake me?