more sound "logics"? +New questions.
- spectre900
- Posts: 124
- Joined: Fri Sep 14, 2012 1:47 am
more sound "logics"? +New questions.
There is this "secret" sound logic that can be linked with buttons or counters to give you that ding when you find a secret, but is there a way to add more sound logics for easier editing? I don't know a thing about scripting but I'm working on a lot of puzzles and it would be nice if there was a way to add a "ding" sound or something like that when completing a puzzle. Something to link with timers or counters just like with the "secret" sound.
Maybe there is a way to create such a thing or one that already exists and can be downloaded/added from somewhere?
Speaking of which, how do you add custom assets to a dungeon? Tried downloading some stuff via Nexus but can't find anything new in the editor.
Maybe there is a way to create such a thing or one that already exists and can be downloaded/added from somewhere?
Speaking of which, how do you add custom assets to a dungeon? Tried downloading some stuff via Nexus but can't find anything new in the editor.
Last edited by spectre900 on Sun Mar 16, 2014 4:58 pm, edited 1 time in total.
Re: more sound "logics"?
Before you can use new items or sounds in the editor, you have to define them for the game.
With starting to create a costum game the editor saves a file and a folder. In the folder you can find this script (in egsample to define a new sound):
mod_assets\scripts\sounds.lua
You have to add there the following lines:
Than you have to make sure, that there is a file called newSoundXYZ.wav in the folder mentioned in your definition.
Now you can use the sound with a script in the editor.
For more informations about all this have a look here:
http://www.grimrock.net/modding/
With starting to create a costum game the editor saves a file and a folder. In the folder you can find this script (in egsample to define a new sound):
mod_assets\scripts\sounds.lua
You have to add there the following lines:
Code: Select all
defineSound{
name = "newSoundXYZ",
filename = "mod_assets/sounds/newSoundXYZ.wav",
loop = false,
volume = 1.2,
minDistance = 1,
maxDistance = 5,
}
Now you can use the sound with a script in the editor.
For more informations about all this have a look here:
http://www.grimrock.net/modding/
- spectre900
- Posts: 124
- Joined: Fri Sep 14, 2012 1:47 am
Re: more sound "logics"?
That is good to know. But that still means I have script it to use it. (which I have no idea how to do, and would require me to learn it all from scratch which is rather time consuming.)tschrage wrote:SpoilerShowBefore you can use new items or sounds in the editor, you have to define them for the game.
With starting to create a costum game the editor saves a file and a folder. In the folder you can find this script (in egsample to define a new sound):
mod_assets\scripts\sounds.lua
You have to add there the following lines:
Than you have to make sure, that there is a file called newSoundXYZ.wav in the folder mentioned in your definition.Code: Select all
defineSound{ name = "newSoundXYZ", filename = "mod_assets/sounds/newSoundXYZ.wav", loop = false, volume = 1.2, minDistance = 1, maxDistance = 5, }
Now you can use the sound with a script in the editor.
For more informations about all this have a look here:
http://www.grimrock.net/modding/
But what I would like is something I can drag from the list and place on the map and then just link a connector to so it will play a sound when activated, just like the "secret found" sound. (I would use that, if it didn't also say "secret found" on the screen, as it is not a secret puzzle, but an essential one to progress. And there are a lot of those.)
- DesperateGames
- Posts: 90
- Joined: Sun Oct 06, 2013 1:54 pm
Re: more sound "logics"?
I think you overestimate the time you need to spend to script this functionality To achieve this, do the following:But what I would like is something I can drag from the list and place on the map and then just link a connector to so it will play a sound when activated, just like the "secret found" sound. (I would use that, if it didn't also say "secret found" on the screen, as it is not a secret puzzle, but an essential one to progress. And there are a lot of those.)
1. Look for "script_entity" in the asset browser in the and place it anywhere in the level.
2. Rename the script entity to "SoundPlayer" or something else that will allow you to identify it easily later on when using the connectors
3. Inside the text box of the script entity, place the following code:
Code: Select all
function playSecret()
playSound("secret")
end
Code: Select all
function playLevelUp()
playSound("level_up")
end
http://www.grimrock.net/modding/list-of ... ed-sounds/
If you want to add your own sound Effects you need to define them as described by tschrage above. If you want to play your sound effect "in 3D" at a certain place in the level (coming from the left of the party, for example) you would need to exchange playSound() to playSoundAt(). The following would play a sound coming from x=14, y=16 on level 2:
Code: Select all
function play3Dsound()
playSoundAt("lightning_bolt_hit", 2, 14, 16)
end
- spectre900
- Posts: 124
- Joined: Fri Sep 14, 2012 1:47 am
Re: more sound "logics"?
Oh. Well that was easier than I thought. ^^;DesperateGames wrote:SpoilerShowI think you overestimate the time you need to spend to script this functionality To achieve this, do the following:
1. Look for "script_entity" in the asset browser in the and place it anywhere in the level.
2. Rename the script entity to "SoundPlayer" or something else that will allow you to identify it easily later on when using the connectors
3. Inside the text box of the script entity, place the following code:
Aaaaand that's about it Now you can create a connector to the "SoundPlayer" script entity using the editor. Then you can select "playSecret" as action, and the "secret" sound will play if the connector is triggered. You can of course add additonal functions like the one above to the "SoundPlayer" script entity, for example:Code: Select all
function playSecret() playSound("secret") end
Now you will have the additional function available as action for the "SoundPlayer" in the connector options. This would allow you to play the "level up" sound whenever required. For a list of all predefined sound effects, look here:Code: Select all
function playLevelUp() playSound("level_up") end
http://www.grimrock.net/modding/list-of ... ed-sounds/
If you want to add your own sound Effects you need to define them as described by tschrage above. If you want to play your sound effect "in 3D" at a certain place in the level (coming from the left of the party, for example) you would need to exchange playSound() to playSoundAt(). The following would play a sound coming from x=14, y=16 on level 2:
Code: Select all
function play3Dsound() playSoundAt("lightning_bolt_hit", 2, 14, 16) end
Don't think I ever found any info on this simple solution in the Modding section or on searches, but it could just have been that I missed it.
many thanks for this info!
Re: more sound "logics"?
You can look in the "Asset Pack" that every modder should download, containing all of the default assets with LoG. This way you have full access to all of the sounds,models, and textures from LoG without making your own. The asset pack is built with the exact folder/file structure you will find in your "mod_assets" folder. (located in "Documents/Almost Human/Legend of Grimrock/dungeons/'your dungeon'/mod_assets"). This means you can go into the "scripts" folder of the asset pack and open "monsters.lua", or even "spells.lua" and see how simple they are written. You can then modify these in your dungeon by "Cloning" or "re-defining" them. For instance, if you think the Ogres in your mod should have half of the hit points of the original, you could copy the Ogre definition from the asset pack, monsters.lua script, paste it into your monsters.lua, and change the Hit Points line(or health, i dont remember off hand) to whatever you like.The first line of all objects is called "defineObject". If you want to Add another type of ogre, rather than replace the original, you would "Clone" it rather than "define" it. So if the first line says "cloneObject", it will add another type entirely, while retaining the original. This works for Items.lua (things you can pick up),- objects.lua (Structures in the world;altars,doors,etc.)- spells.lua (you could change runes or requirements, or even effects.) For sounds, you can see the entire list of sounds at your disposal, and if you want to use any of them, make a script entity in your dungeon and do what DG (DesperateGames new shorthand name ) explained. You can then make or download your own sounds, and convert them them to mono .wav, define it in your sounds.lua, and do the same thing in your dungeon.
Sorry for the long winded explanation, I hope it will help you to wrap your head around how much simpler it all is than you are assuming.
Most of us are not scripters or coders. Perhaps 10-12 guys around here actually KNOW their stuff (I'm not one of them).
The rest of us get by with recognizing a format (function, end) and copy/pasting standard codes; or if you're lucky, a custom script from one of the ninjas around here, while PERHAPS taking a chance on changing a value or two and hoping it doesn't break the entire mod. So really what I'm saying is, GET IN THERE AND GET YER HANDS DIRTY! You'll be glad you did!
hope this helps!!
Sorry for the long winded explanation, I hope it will help you to wrap your head around how much simpler it all is than you are assuming.
Most of us are not scripters or coders. Perhaps 10-12 guys around here actually KNOW their stuff (I'm not one of them).
The rest of us get by with recognizing a format (function, end) and copy/pasting standard codes; or if you're lucky, a custom script from one of the ninjas around here, while PERHAPS taking a chance on changing a value or two and hoping it doesn't break the entire mod. So really what I'm saying is, GET IN THERE AND GET YER HANDS DIRTY! You'll be glad you did!
hope this helps!!
Currently conspiring with many modders on the "Legends of the Northern Realms"project.
"You have been captured by a psychopathic diety who needs a new plaything to torture."
Hotel Hades
"You have been captured by a psychopathic diety who needs a new plaything to torture."
Hotel Hades
- spectre900
- Posts: 124
- Joined: Fri Sep 14, 2012 1:47 am
Re: more sound "logics"? +New questions.
Thank you guys. You have been most helpful. I have been playing around a lot with the .lua files to change or add new items to my dungeon and I'm sort of starting to get how scripts work as well.
I have a some new questions tho.
1) Can I make text pop up on the middle of my screen instead of at the bottom? (kinda like the cube, but without the scrambly effect.)
2) can I copy part of an old map to my new one? got some old puzzles there that might be fun to use in this new one.
I have a some new questions tho.
1) Can I make text pop up on the middle of my screen instead of at the bottom? (kinda like the cube, but without the scrambly effect.)
2) can I copy part of an old map to my new one? got some old puzzles there that might be fun to use in this new one.
- DesperateGames
- Posts: 90
- Joined: Sun Oct 06, 2013 1:54 pm
Re: more sound "logics"? +New questions.
It should be possible, although I don't know how. I never needed it for my own dungeon, but I have seen it in screenshots from other dungeon, for example this one has an entire dialogue system:1) Can I make text pop up on the middle of my screen instead of at the bottom? (kinda like the cube, but without the scrambly effect.)
http://steamcommunity.com/sharedfiles/f ... earchtext=
But I guess there more thans a little scripting involved in this
Go into your dungeon directory, then mod_assets\scripts and have a look at the dungeon.lua file. It can be opened with a text editor and you can see that the dungeon layout is stored in plain text. If you are careful you should be able to copy entire levels over to another dungeon.lua file and then open it with the dungeon editor again. But make backup copies first, I don't know how the dungeon editor will react, if you, for example, have a double entity with the same name after copying.2) can I copy part of an old map to my new one? got some old puzzles there that might be fun to use in this new one.
Re: more sound "logics"? +New questions.
spectre900 wrote:
1) Can I make text pop up on the middle of my screen instead of at the bottom? (kinda like the cube, but without the scrambly effect.)
Here: viewtopic.php?f=14&t=4454
spectre900 wrote: 2) can I copy part of an old map to my new one? got some old puzzles there that might be fun to use in this new one.
Use for example notepad++, copy paste level (each one started with ascii map, so you can identify it very easy) you want into new dungeon.ini file, make sure all custom objects are in the same folders like in original etc, then polish level in editor.
I'm the Gate I'm the Key.
Dawn of Lore
Dawn of Lore
- spectre900
- Posts: 124
- Joined: Fri Sep 14, 2012 1:47 am
Re: more sound "logics"? +New questions.
Thanks again guys. Much appreciated.
I'm almost done with my dungeon now and it's looking good so far I think.
a few final things tho. (hopefully)
1) Can the Cube be made into a non-chatty-boss enemy? I tried to to make a copy of it with a new name but that just caused the game to crash so I removed it again. =/
2) I sorta tried making keys retrievable from locks like in Dungeon Master, using a similar function to the demon_head_eye_socket. However I do not know if you can rotate the item in it so it actually if faced into the lock. I got the general position right and all that, but it's faced to the side as if lying on the ground so it is sorta... glued to the lock, rather than be placed inside it.
I'm almost done with my dungeon now and it's looking good so far I think.
a few final things tho. (hopefully)
1) Can the Cube be made into a non-chatty-boss enemy? I tried to to make a copy of it with a new name but that just caused the game to crash so I removed it again. =/
2) I sorta tried making keys retrievable from locks like in Dungeon Master, using a similar function to the demon_head_eye_socket. However I do not know if you can rotate the item in it so it actually if faced into the lock. I got the general position right and all that, but it's faced to the side as if lying on the ground so it is sorta... glued to the lock, rather than be placed inside it.