Page 118 of 396

Re: Ask a simple question, get a simple answer

Posted: Sun Apr 03, 2016 1:15 pm
by THOM
Ah, great - that works.

And thank you for the hint at the torches. Fixed that.

Re: Ask a simple question, get a simple answer

Posted: Sun May 01, 2016 4:13 am
by Eleven Warrior
Hi all.

I read somewhere here you can replace object sounds with other sound eg: Key Lock. How do I replace the key lock sound with a sound I have?

I tried the below but the Key Lock sound still activates:

Code: Select all

		{
			class = "Sound",
			sound = "silent",
			offset = vec(0, 1.5, 0),
			enabled = true,
		},

Re: Ask a simple question, get a simple answer

Posted: Sun May 01, 2016 6:45 pm
by Illidan
@Eleven Warrior:

Hi,
if you just want to replace a grimrock2 sound by an other grimrock2 sound like the "silent" or instead, for example, the "teleport" sound, then your wanted object lock-class should just look like this:
{
class = "Lock",
sound = "teleport",
},


But you need to import the sounds.lua from the original grimrock 2 asset in your init.lua:
import "mod_assets/scripts/sounds.lua"

All grimrock 2 sounds that are avaiable you find here: http://www.grimrock.net/modding_log1/li ... ed-sounds/

If you created a complete new sound you want to use insted of a grimrock2 sound, your new lock-object should look like this:

defineObject{
name = "my_new_lock",
components = {
{
class = "Model",
model = "assets/models/env/wall_lock.fbx", --(or whatever folder you have for your own lock, if you have created one)
offset = vec(0, 1.375, 0),
staticShadow = true,
},
{
class = "Clickable",
offset = vec(0, 1.375, 0),
size = vec(0.4, 0.4, 0.4),
--debugDraw = true,
},
{
class = "Lock",
sound = "my_new_key_lock_sound",
},
},
placement = "wall",
editorIcon = 20,
}


In addition you have to define a new sound in your sounds.lua (/mod_assets/scripts/sounds.lua), like this:

defineSound{
name = "my_new_key_lock_sound",
filename = "mod_assets/samples/env/my_new_key_lock_sound.wav",
loop = false,
volume = 1,
minDistance = 1,
maxDistance = 10,
}


Also you should have created a folder with your wav-file my_new_key_lock_sound.wav (important: must be a mono-sound file!) in your samples folder in your asset, like this:
/documents/AlmostHuman/Legend of Grimrock2/Dungeons/YourDungeonName/mod_assets/samples/env/

And then, you need to import the sounds.lua in your init.lua:
import "mod_assets/scripts/sounds.lua"

Now it should work correctly. ;)
I hope I have not misunderstood you. :?:

Re: Ask a simple question, get a simple answer

Posted: Mon May 02, 2016 7:15 am
by Eleven Warrior
Thxs Illidan will try this out. I cant believe how easy it was lol Thxs again.

Re: Ask a simple question, get a simple answer

Posted: Tue May 03, 2016 6:05 am
by Illidan
Was a pleasure to help, Eleven Warrior! :P

Re: Ask a simple question, get a simple answer

Posted: Wed May 04, 2016 8:29 am
by Isaac
I think that it also has to be a 44,100 MHz sample rate ~despite that other rates work with Windows.

Re: Ask a simple question, get a simple answer

Posted: Wed May 04, 2016 10:01 am
by minmay
A 44,100 MHz sample rate would be a rather extreme choice. Even cats can only hear frequencies up to about 70 KHz, and thermal noise will nullify any fidelity benefits. Not to mention you'd be using 11 GB of storage for each second of 16-bit mono audio.

Sounds you use in the Grimrock games should always be 16-bit and have the sample rate set to 44,100 Hz. If you know exactly what you are doing, there are some specific cases where other sample rates work, but I do not want to elaborate on them. If you want to use a lower quality sound to save space, instead of saving it at its original sample rate you should change it to 44,100 Hz without resampling and use SoundComponent's pitch feature to play it at its original speed. Yes, the interpolation will be a little different but you are not justified in caring about that, since you already do not care much about quality if you are using a low sample rate.

In Grimrock 1, some especially lazy dungeon makers used non-44,100 Hz sample rates in unsafe contexts, which generally "work" on the Windows version but crash the OSX and Linux versions. I haven't checked to see if this is still true in Grimrock 2. Just always use 44,100 Hz, seriously.

Re: Ask a simple question, get a simple answer

Posted: Wed May 04, 2016 10:41 am
by Eleven Warrior
Yep. I have saved the sample as 16 bit, 44,100 Hz, mono, .wav as it said in the forums ages ago.

Re: Ask a simple question, get a simple answer

Posted: Wed May 04, 2016 5:30 pm
by Isaac
minmay wrote:A 44,100 MHz sample rate would be a rather extreme choice. Even cats can only hear frequencies up to about 70 KHz, and thermal noise will nullify any fidelity benefits. Not to mention you'd be using 11 GB of storage for each second of 16-bit mono audio.
...

Just always use 44,100 Hz, seriously.
Did you just rebuke over an obvious typo, and reiterate its exact message? :roll:

Re: Ask a simple question, get a simple answer

Posted: Wed May 04, 2016 10:54 pm
by Eleven Warrior
Hi all.

In the main game you start in a cage errrr (No shit) lol. How does it work when you hit the cage door with the stick, you see the animation of the cage door open. How is this done, I'm sure it simple. I tried it in my Mod but I don't see the door open at all.