Page 1 of 1

How can I clone Goromorog with custom sounds.

Posted: Wed Oct 03, 2012 7:23 pm
by Obyvvatel
I know that there is tutorial how to create custom assets, but I never had contact with scripting, so i have 2 questions:

1. Is cloning monsters is the same as cloning items?
2. Where can I get list of things which I must type when i'm cloning something. I know that I need baseObject, name and attack power, but I don't know what else.

And as always I need to say that my English is bad :D

Re: How can I clone Goromorog with custom sounds.

Posted: Wed Oct 03, 2012 7:27 pm
by JohnWordsworth
1. Yup - you are able to clone monsters exactly the same way that you clone items. Be wary though, that a few monsters don't play ball well (I think cloning the cube causes a crash and cloning the Ugguardian doesn't produce a fire effect).

2. The asset definition reference (http://www.grimrock.net/modding/asset-d ... reference/) has the information you are looking for. You can override any of the properties listed for a given object type that you clone. So when you clone a monster you can override any of the properties listed under the monster section (model, moveSound, footstepSound, attackSound, etc, etc).

Re: How can I clone Goromorog with custom sounds.

Posted: Wed Oct 03, 2012 7:51 pm
by Obyvvatel
So I can type just the attackSound, dieSound etc. and I don't need to type all of the proporties?

Re: How can I clone Goromorog with custom sounds.

Posted: Wed Oct 03, 2012 7:53 pm
by HaunterV
Obyvvatel wrote:So I can type just the attackSound, dieSound etc. and I don't need to type all of the proporties?

I beleive you only type in what you want to change from the original

Re: How can I clone Goromorog with custom sounds.

Posted: Wed Oct 03, 2012 7:55 pm
by Obyvvatel
Ok, I will test that.

Re: How can I clone Goromorog with custom sounds.

Posted: Wed Oct 03, 2012 8:00 pm
by JohnWordsworth
As long as you are using cloneObject, then you only need to define the properties that you want to change. All other properties are read from the 'baseObject'. In order to add your own sound effect, you will need to (untested, could have spelling mistakes etc)...

1. Save it in wav format to mod_assets/samples/new_goromorg_attack_sound.wav.

2. Add an entry to sounds.lua in your dungeon scripts (I don't know if that is there by default, if not, you will also need to import it in your dungeon's init.lua).
SpoilerShow

Code: Select all

defineSound{
	name = "new_goromorg_attack_sound",
	filename = "assets/samples/new_goromorg_attack_sound.wav",
	loop = false,
	volume = 0.25,
}
3. Clone the Goromorog and set the attackSound = your_sound_name.
SpoilerShow

Code: Select all

cloneObject{
	name = "new_goromorg",
	baseObject = "goromorg",
	attackSound = "new_goromorg_attack_sound",
}

Re: How can I clone Goromorog with custom sounds.

Posted: Wed Oct 03, 2012 8:10 pm
by Obyvvatel
Thanks! One more question. What the "loop" does?

Re: How can I clone Goromorog with custom sounds.

Posted: Wed Oct 03, 2012 8:13 pm
by JohnWordsworth
Loop means that when the sound finishes, it will start again (and play in a loop forever). I don't know how to end a looping sound though (perhaps it ends when the creature dies). I think it would be quite annoying though, so it's only there for special cases I imagine!