[DONE] Grimrock Model Tookit

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
wagtunes
Posts: 316
Joined: Sun Feb 04, 2018 11:04 pm

Re: [DONE] Grimrock Model Tookit

Post by wagtunes »

Okay, I'm going to make this as simple as I can.

Is there a Youtube video that shows...

1. How to create a MODEL file
2. How to assign a texture to it
3. How to script it in order to load it into the game

I am pulling my hair out trying to learn this. I had cloned a blue gem, brought the clear dds file into photoshop, colored it yellow, creating a new dds file, brought up the blue gem model in Grimrock Model toolkit, assign the new texture to it (or at least so I thought), saved it as a new MODEL file, and then cloned the blue gem script and made the necessary changes in order to pull the right MODEL and texture. No luck. The gem is still blue in the game.

Yes, obviously I'm doing something wrong but have no idea what.

Any direction that anybody could give me (a video would be best if it exists) would be greatly appreciated.

** ADDITIONALLY ** It appears Grimrock Model Toolkit cannot actually create models from scratch but only load existing models and modify them. What program do I need to create models from scratch? Will Blender work? I currently have Blender 2.92 and Photoshop for creating DDS files at my disposal. What else will I need?

Thanks
User avatar
Isaac
Posts: 3172
Joined: Fri Mar 02, 2012 10:02 pm

Re: [DONE] Grimrock Model Tookit

Post by Isaac »

The Toolkit can import the native game models, and/or import models from various formats.
It can be used to override the material(s) of the model. For LoG1 it can assign (and do limited editing) of animations too.

*For LoG2, only model & material editing; no animation support.

For designing new content, Blender is the way to go. Thanks to Bitcopy, we have a Blender Plugin that can import/export models and animations for both games...and thanks to minmay, we can now use a fairly recent Blender version to do it. 8-) 8-) 8-)

____________________

If you are only recoloring [for LoG1], then you can use the GMT to change the model material. Create the blue_gem material, then assign the New Material Name to be blue_gem; then save.

Image

Note in the Model Node settings, that Node 2:eye is selected, and that the model is shown red. This is not because of the red color you would change; red is the color that GMT uses indicate what part [which node] of the model is selected, and will be affected.

*Also [optional]: If you define/set your current LoG project folder in GMT's settings, it should read all of the defined materials in that project.

Image
wagtunes
Posts: 316
Joined: Sun Feb 04, 2018 11:04 pm

Re: [DONE] Grimrock Model Tookit

Post by wagtunes »

Isaac wrote: Fri Apr 30, 2021 3:36 pm The Toolkit can import the native game models, and/or import models from various formats.
It can be used to override the material(s) of the model. For LoG1 it can assign (and do limited editing) of animations too.

*For LoG2, only model & material editing; no animation support.

For designing new content, Blender is the way to go. Thanks to Bitcopy, we have a Blender Plugin that can import/export models and animations for both games...and thanks to minmay, we can now use a fairly recent Blender version to do it. 8-) 8-) 8-)

____________________

If you are only recoloring [for LoG1], then you can use the GMT to change the model material. Create the blue_gem material, then assign the New Material Name to be blue_gem; then save.

Image

Note in the Model Node settings, that Node 2:eye is selected, and that the model is shown red. This is not because of the red color you would change; red is the color that GMT uses indicate what part [which node] of the model is selected, and will be affected.

*Also [optional]: If you define/set your current LoG project folder in GMT's settings, it should read all of the defined materials in that project.

Image
Thanks Isaac. We're getting closer. When I walk into the room, the gem, on the floor, does in fact look yellow. However, when I pick it up to put it into my backpack, it looks blue and also stays blue in inventory. Is there something else I have to modify as well?
User avatar
Isaac
Posts: 3172
Joined: Fri Mar 02, 2012 10:02 pm

Re: [DONE] Grimrock Model Tookit

Post by Isaac »

Ah... The model, and its material texture are distinct from the inventory icon; the icon is a 2d image.

John Wordsworth also has an icon utility that makes this task easy:
http://www.grimrock.net/forum/viewtopic.php?t=5400

In the object definition, you can define a custom icon-atlas, and define which icon to use.
Last edited by Isaac on Fri Apr 30, 2021 4:44 pm, edited 1 time in total.
wagtunes
Posts: 316
Joined: Sun Feb 04, 2018 11:04 pm

Re: [DONE] Grimrock Model Tookit

Post by wagtunes »

Isaac, I figured out what the problem is. I just don't know how to fix it.

It's this line in the script file

gfxIndex = 118

That's the image of the blue gem. My problem is, I don't know what the index number is for a gem that didn't exist previously. Do I have to create one? If so...

1. How? Can I clone it from the blue image (assuming I can find it) or do I have to create it from scratch?

2. Where does this index graphic get stored so that the script finds it?

I've messed around with changing the index to several values and they all correspond to some item in the base game. If you can tell me where these index files are stored, I might be able to figure out, if nothing else, what the next available index is, not that I'd know how to go about creating it.

Sorry for all the questions but this part of the game is all new to me and I am almost totally lost.
wagtunes
Posts: 316
Joined: Sun Feb 04, 2018 11:04 pm

Re: [DONE] Grimrock Model Tookit

Post by wagtunes »

Isaac wrote: Fri Apr 30, 2021 4:42 pm Ah... The model, and its material texture are distinct from the inventory icon; the icon is a 2d image.

John Wordsworth also has an icon utility that makes this task easy:
http://www.grimrock.net/forum/viewtopic.php?t=5400

In the object definition, you can define a custom icon-atlas, and define which icon to use.
Isaac, the download page for the utility is gone.

https://www.johnwordsworth.com/mod-tool ... s-toolkit/

He must have taken it down.
wagtunes
Posts: 316
Joined: Sun Feb 04, 2018 11:04 pm

Re: [DONE] Grimrock Model Tookit

Post by wagtunes »

Okay Isaac, I found the utility on another page. I have it open. What exactly is it I'm supposed to do? Do I create an icon (75x75) in photoshop and save it as a dds file? If so, where then do I put it so LoG knows where to find it? I assume an index will be given after the icon is created and imported into the GAT.
User avatar
Isaac
Posts: 3172
Joined: Fri Mar 02, 2012 10:02 pm

Re: [DONE] Grimrock Model Tookit

Post by Isaac »

The file you want is in the asset pack @ /assets/textures/gui/items2.dds

You can tint the gem blue, and use this new atlas as-is, or crop it [128x128 from top left of the gem icon], and change the reference number.
Or you can save/export the gem icon as a 75x75 .png file, and import it to the atlas toolkit.

Edit:

Blue_gem atlas: https://www.dropbox.com/s/43fscm8ombqez ... m.dds?dl=1
Image

To use this, you must add a line for the custom atlas:

Code: Select all

gfxAtlas = "mod_assets/textures/gui/gem_atlas.tga",  --and the image must exist /be placed at the path.
_____________________________

But there are red, blue, and green gems defined in the asset pack; available in the editor.

Code: Select all

	defineObject{
		name = "blue_gem",
		class = "Item",
		uiName = "Blue Gem",
		model = "assets/models/items/blue_gem.fbx",
		gfxIndex = 118,
		weight = 0.2,
	}

	defineObject{
		name = "green_gem",
		class = "Item",
		uiName = "Green Gem",
		model = "assets/models/items/green_gem.fbx",
		gfxIndex = 119,
		weight = 0.2,
	}

	defineObject{
		name = "red_gem",
		class = "Item",
		uiName = "Red Gem",
		model = "assets/models/items/red_gem.fbx",
		gfxIndex = 218,
		weight = 0.2,
	}
wagtunes
Posts: 316
Joined: Sun Feb 04, 2018 11:04 pm

Re: [DONE] Grimrock Model Tookit

Post by wagtunes »

Isaac, thank you for all your help. You have no idea how much I appreciate it.

Here is what I've gotten so far.

I pulled the items.dds file from the asset pack into photoshop to see what icons were there. I then starting changing the index going up one at a time and reloading until I eventually discovered that the icon indexes were pulling from this file. Yet, if I go into the entire folder structure of my dungeon, this items.dds file is nowhere.

So my question is this. Is the items.dds file part of the base game and located somewhere else? I did a complete hard drive search and the only place this file shows up is in the asset pack which I do not have in the path of my dungeon anyway.

So, if this icon chart is hard-coded into the game (I have to assume that) how do you add to it so that you can pull additional icons? And then how do you assign index numbers to those additional icons that are greater than 168? (the last icon index for the items.dds file)

Sorry, but this is all so confusing. Logically, what I'm seeing doesn't make any sense unless there is stuff going on behind the scenes that I'm unaware of.

Anyway, I created a new icon bmp file and brought it into the atlas toolkit. It assigned index 0 to it. I saved it as a separate file and then changed the index of my script to 0. It proceeded to pull the icon from the items.dds file for index 0, which appears to be the Sword Of Nex.

So I am totally stumped.

Look, the people who learned how to do all this had to learn it from somewhere. If somebody can point me to where I can learn everything I will need to know in order to create models, textures and associated icons, I will do the necessary legwork and study and learn it. I'm not lazy but for the life of me, I don't have a clue where to begin. What I've managed to accomplish so far, graphically, I've done by brute force and trial and error, which is certainly not the most efficient way to go about this.

Right now, I have a yellow gem, assigned to index 119, which is the green gem. There is no yellow gem in items.dds and I have no idea either how to get a yellow gem icon into items.dds or create a new dds and make the yellow gem icon pull from that file. Your directions above aren't clear to me. I'm still not sure what I'm supposed to do. Again, if I can just learn this from scratch (create my own model, texture and icon and then do the necessary scripting to pull the right data, that will be the most efficient use of my time and I won't have to drive everybody here crazy answering all my questions.
minmay
Posts: 2768
Joined: Mon Sep 23, 2013 2:24 am

Re: [DONE] Grimrock Model Tookit

Post by minmay »

This particular question is covered in the official modding guide in the Asset Definition Reference page:
gfxIndex: index of the item graphics in texture atlas.
gfxAtlas: filename of the texture atlas containing the item icon. The filename must be a valid asset reference ending with “.tga”.
Here is another concrete example:

Code: Select all

defineObject{
	name = "armour_scale_greaves",
	class = "Item",
	uiName = "Scale Greaves",
	model = "assets/models/items/leather_greaves.fbx",
	slot = "Legs",
	armorSkill = "light_armor",
	armorSet = "steel_light",
	gfxAtlas = "mod_assets/textures/items.tga",
	gfxIndex = 20,
	protection = 6,
	weight = 2.0,
}
wagtunes wrote: Fri Apr 30, 2021 6:51 pmSo my question is this. Is the items.dds file part of the base game and located somewhere else? I did a complete hard drive search and the only place this file shows up is in the asset pack which I do not have in the path of my dungeon anyway.
Everything in the asset pack is part of the base game.

You might also find it helpful to look at the source code for some existing dungeons that have released source code, like The Mine of Malan Vael or The Sunset Gate
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Post Reply