Page 1 of 6
Modding For Dummies
Posted: Wed Oct 17, 2012 2:39 am
by Brodie301
So I've been reading through all the threads, read a lot of the modding home page, watched all of Komag's vids, even managed to make 1 script work by using a couple of suggestions but took about an hour to piece together for very simple script.
All of the resources available by the Devs and community are great, thanks to all.
I know Neikun and others have been trying to compile into the forefront of threads and become more available & the wiki is coming along great.
My problem is I've never modded and am kinda getting overwhelmed. Meaning I don't know where to put this file or insert this script or do i put this here then i get to use it in the actual editor or if I put this here will it crash whole thing.
An example being The Alcove Guys are killing it, completely awesome, but to a complete newb how do I use it and so on and so on.
So how can a newb like me get these answers without tying up too much community time or is anyone planning a Grimrock Modding 101.
Re: Modding For Dummies
Posted: Wed Oct 17, 2012 2:54 am
by Neikun
I am actually very new to all of this myself, so I am always happy to answer questions. So feel free to message me over the forums or send me an email at
weaktooshow@hotmail.com
When deciding which .lua file you should paste a copied script, just think, is it an object? item, monster, material(texture), sound, recipe yadda yadda.
Keep in mind that you can create an entirely new .lua file by saving a .txt file as .lua and add it to the init.lua file with the string:
import "mod_assets/scripts/<new .lua file name>.lua"
As for actual files you best bet to find where they belong is to look at the scripts and see what they reference.
I'll use Molt as an example.
In the materials.lua you will see the lines
- diffuseMap = "mod_assets/molt/textures/monsters/molt_dif.tga",
specularMap = "mod_assets/molt/textures/monsters/molt_spec.tga",
normalMap = "mod_assets/molt/textures/monsters/molt_normal.tga",
these underlined portions refer for folders that must exist within the mod_assets folder in order to be referenced.
Likewise, when we look at the monsters.lua and see the line:
- model = "mod_assets/molt/models/monsters/molt_slime.fbx",
The underlined folders must exist within the mod_assets folder.
Re: Modding For Dummies
Posted: Wed Oct 17, 2012 2:59 am
by Grimwold
I think there are plans to create some sort of documentation for the wiki -
http://grimwiki.net/wiki/Main_Page
But I'm not sure how soon that will happen.
In terms of where to put things, the people writing mods will usually (if briefly) explain where things go... but in general things will either be:-
1) in one of the subfolders of the data directory for your custom dungeon
- these are found in one of the subfolder of your "Documents" folder in Windows.
e.g. Documents > Almost Human > Legend of Grimrock > Dungeons > YOUR DUNGEON NAME
* scripts tend to go in one of the lua files in the scripts subfolder
* models/textures etc. tend to go in the relevant subfolders
2) in a script entity within your custom dungeon, created in the dungeon editor.
Any scripts I've made I will try to indicate which file, folder or entity to put things in.
e.g. in this post:
viewtopic.php?f=14&t=3683&p=38375#p38272
I mention 3 different lua files -
init.lua;
monsters.lua;
items.lua as well as a
script entity called
party_script in the editor.
With the alcove guys... a lot of the things they created should go in
objects.lua and this will create assets in the editor that you can place in your dungeon.
I hope that helps. Once you get a feel for where certain types of things go, it becomes much easier to understand the postings here.
EDIT - ninja'd by Neikun
Re: Modding For Dummies
Posted: Wed Oct 17, 2012 3:04 am
by Neikun
Grimwold wrote:
With the alcove guys... a lot of the things they created should go in objects.lua and this will create assets in the editor that you can place in your dungeon.
EDIT - ninja'd by Neikun
Personal preference note, if you find that you are copying a lot of custom objects, you may want to create a .lua file just for them and add the file to the import string in the init.lua.
This will help you keep track of the files a little better.
Re: Modding For Dummies
Posted: Wed Oct 17, 2012 3:15 am
by Grimwold
Neikun wrote:
Personal preference note, if you find that you are copying a lot of custom objects, you may want to create a .lua file just for them and add the file to the import string in the init.lua.
This will help you keep track of the files a little better.
Agreed... and this is what I've been doing for some mods. But as a beginner I found it helpful to segregate things into their separate files..
Re: Modding For Dummies
Posted: Wed Oct 17, 2012 3:28 am
by Brodie301
So if I'm understanding this right for the first post in Alcove thread, usable Catacomb.
I copy that script that has all the Anchor x,y,z Pos x,y,z Vec x,y,z to the main object.lua file I can then see that in the All tab of the editor and use it to put an item in from the editor as well?
Re: Modding For Dummies
Posted: Wed Oct 17, 2012 3:31 am
by Neikun
Brodie301 wrote:So if I'm understanding this right for the first post in Alcove thread, usable Catacomb.
I copy that script that has all the Anchor x,y,z Pos x,y,z Vec x,y,z to the main object.lua file I can then see that in the All tab of the editor and use it to put an item in from the editor as well?
Yes, copy the script from defineObject{
to the closing bracket, }
Copy it to objects.lua
It will then be in your asset browser. (as a prop) It will behave just the same as placing any other prop.
Re: Modding For Dummies
Posted: Wed Oct 17, 2012 3:41 am
by Brodie301
That was the point I was trying to get to in OP.
But I don't see } in that post ends at ,
Re: Modding For Dummies
Posted: Wed Oct 17, 2012 3:43 am
by Grimwold
The great thing about grimrock forums is the "code" tags that come with a "select all" link. click the select all and then hit ctrl+c to copy all the code that is needed...
so from the alcove thread:
Code: Select all
defineObject{
name = "dungeon_catacomb_alcove",
class = "Alcove",
anchorPos = vec(0, 0.75, 0.2),
targetPos = vec(0,1.3,0),
targetSize = vec(0.6, 0.5, 0.6),
model = "assets/models/env/dungeon_catacomb_empty.fbx",
placement = "wall",
replacesWall = true,
editorIcon = 92,
}
Re: Modding For Dummies
Posted: Wed Oct 17, 2012 3:46 am
by Neikun
Brodie301 wrote:That was the point I was trying to get to in OP.
But I don't see } in that post ends at ,
Try pressing select all, then copying. I think you'll find that you'll be surprised that the close bracket is indeed there.
I'm a little odd, I give the close bracket a line of it's own.
defineObject{
name = "dungeon_catacomb_alcove",
class = "Alcove",
anchorPos = vec(0, 0.75, 0.2),
targetPos = vec(0,1.3,0),
targetSize = vec(0.6, 0.5, 0.6),
model = "assets/models/env/dungeon_catacomb_empty.fbx",
placement = "wall",
replacesWall = true,
editorIcon = 92,
}
EDIT: This time it is I who gets ninja'd haha