How do I create a new attack sound?

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
User avatar
Xaxus
Posts: 24
Joined: Mon Sep 17, 2012 4:54 am

How do I create a new attack sound?

Post 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.)
User avatar
Bek
Posts: 39
Joined: Fri Apr 13, 2012 3:39 am

Re: How do I create a new attack sound?

Post 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?
User avatar
Xaxus
Posts: 24
Joined: Mon Sep 17, 2012 4:54 am

Re: How do I create a new attack sound?

Post 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.
User avatar
Bek
Posts: 39
Joined: Fri Apr 13, 2012 3:39 am

Re: How do I create a new attack sound?

Post by Bek »

Yeah, if it's just the colour of the item you want to change. Should be a fairly simple change.
User avatar
Xaxus
Posts: 24
Joined: Mon Sep 17, 2012 4:54 am

Re: How do I create a new attack sound?

Post by Xaxus »

A gentle bump so I can get my question answered.
User avatar
Grimwold
Posts: 511
Joined: Thu Sep 13, 2012 11:45 pm
Location: A Dungeon somewhere in the UK

Re: How do I create a new attack sound?

Post 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.
User avatar
Montis
Posts: 340
Joined: Sun Apr 15, 2012 1:25 am
Location: Grimrock II 2nd playthrough (hard/oldschool)

Re: How do I create a new attack sound?

Post 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",
}
When destiny calls, the chosen have no choice.

My completed dungeon (LoG1): Hypercube
User avatar
Xaxus
Posts: 24
Joined: Mon Sep 17, 2012 4:54 am

Re: How do I create a new attack sound?

Post 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.
User avatar
Montis
Posts: 340
Joined: Sun Apr 15, 2012 1:25 am
Location: Grimrock II 2nd playthrough (hard/oldschool)

Re: How do I create a new attack sound?

Post 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
When destiny calls, the chosen have no choice.

My completed dungeon (LoG1): Hypercube
User avatar
Shroom
Posts: 98
Joined: Tue Mar 27, 2012 6:37 pm
Location: UK

Re: How do I create a new attack sound?

Post 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
Post Reply