Page 1 of 2

How do I create a new attack sound?

Posted: Mon Sep 17, 2012 5:19 am
by Xaxus
Okay.
So for my cudgel, I want to play a .wav every time I attack. This includes hitting creatures, hitting walls, and missing.

In sounds.lua I have:

Code: Select all

defineSound{
	name = "smoke",
	filename = "C:Users/lallen/Documents/Almost Human/Legend of Grimrock/Dungeons/Nugcastle/mod_assets/sounds/smoke_brief.wav",
	volume = ".42"
	loop = "false"
}
and in items.lua I have:

Code: Select all

cloneObject{
	name = "dank_cudgel",
	baseObject = "cudgel",
	uiName = "Dank Cudgel",
	attackPower = 7,
	coolDownTime = 1,
	strength = 2,
	accuracy = 5,
	attackSound = "smoke",
	damageType = "physical",
	description = "This blunt weapon radiates with dank energy.",
}
HOWEVER, every time I try to attack with the cudgel inside the preview (I can load my custom dungeon file in the editor without issue), it crashes Grimrock instantly. I am not even prompted with a "Grimrock.exe has stopped working".
I am not certain if it's due to flawed coding or a bug in the beta.
Any assistance, please?
(P.S. - I would also like to make the cudgel a slight green hue, if possible. I am complete unsure of where to start, so any tips or advice would be greatly appreciated.)

Re: How do I create a new attack sound?

Posted: Mon Sep 17, 2012 5:33 am
by Bek
Re: green hue: Assuming the cudgel is the default model, you will have to edit its diffuse map. I'm guessing this will be possible when AH release their asset pack. Depending on the effect you want you could make its specular highlights a green colour by chaning the spec map.

also dank energy? Did you mean dark?

Re: How do I create a new attack sound?

Posted: Mon Sep 17, 2012 5:53 am
by Xaxus
Bek wrote:Re: green hue: Assuming the cudgel is the default model, you will have to edit its diffuse map. I'm guessing this will be possible when AH release their asset pack. Depending on the effect you want you could make its specular highlights a green colour by chaning the spec map.

also dank energy? Did you mean dark?
Thanks for the help with the hue. I did some tampering with hues in Warcraft 3, will they be similar to change?
Also: No, I did mean dank, but thanks anyways.

Re: How do I create a new attack sound?

Posted: Mon Sep 17, 2012 6:24 am
by Bek
Yeah, if it's just the colour of the item you want to change. Should be a fairly simple change.

Re: How do I create a new attack sound?

Posted: Mon Sep 17, 2012 5:06 pm
by Xaxus
A gentle bump so I can get my question answered.

Re: How do I create a new attack sound?

Posted: Mon Sep 17, 2012 5:15 pm
by Grimwold
Xaxus wrote:Okay.
So for my cudgel, I want to play a .wav every time I attack. This includes hitting creatures, hitting walls, and missing.

In sounds.lua I have:

Code: Select all

defineSound{
	name = "smoke",
	filename = "C:Users/lallen/Documents/Almost Human/Legend of Grimrock/Dungeons/Nugcastle/mod_assets/sounds/smoke_brief.wav",
	volume = ".42"
	loop = "false"
}
Is your code exactly as above? If so, there's a typo at the start of the filename.. should be C:/Users

also.. I think I've read that it is a relative path.. so just "mod_assets/sounds/smoke_brief.wav" anyway.

Re: How do I create a new attack sound?

Posted: Mon Sep 17, 2012 5:18 pm
by Montis
you can aktually skip all the filename stuff until "mod_assets". also there are some other entries wrong, e.g. the volume shouldn't be a string and you're missing commas.

try it with this:

Code: Select all

defineSound{
   name = "smoke",
   filename = "mod_assets/sounds/smoke_brief.wav",
   volume = .42,
   loop = "false",
}

Re: How do I create a new attack sound?

Posted: Mon Sep 17, 2012 9:42 pm
by Xaxus
Even using the following still crashes the game, same way and all.

Code: Select all

defineSound{
   name = "smoke",
   filename = "mod_assets/sounds/smoke_brief.wav",
   volume = .42,
   loop = "false",
}
I am certain smoke_brief is a .wav file.
Changing it to .wave prompts with with the editor unable to find the file.
Additonally, I've changed volume to a solid number (1) and removed loop = "false", but the crash still occurs.

Re: How do I create a new attack sound?

Posted: Mon Sep 17, 2012 10:42 pm
by Montis
Oops, the loop property should not be a string either, so remove the quotation marks there.
SpoilerShow

Code: Select all

defineSound{
   name = "smoke",
   filename = "mod_assets/sounds/smoke_brief.wav",
   volume = .42,
   loop = false,
}
if that still doesn't work, try to define the sound distances as well
SpoilerShow

Code: Select all

[code]defineSound{
   name = "smoke",
   filename = "mod_assets/sounds/smoke_brief.wav",
   volume = .42,
   loop = false,
   minDistance = 30,
   maxDistance = 32,
}
and if that STILL doesn't work, you probably need to use another sound file :P

Re: How do I create a new attack sound?

Posted: Mon Sep 17, 2012 10:52 pm
by Shroom
Well i just went through all sorts of hoops to get mine to work. I used audacity to make sure it was exported as a 16 bit 44khz file - the only difference on my sound.lua is i have a 0 in front of the decimal point - ie 0.42