Importing LoG1 model having several material

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
Post Reply
philippe.martin
Posts: 9
Joined: Fri May 15, 2015 10:44 am

Importing LoG1 model having several material

Post by philippe.martin »

Good Day,

For instance, I would like to import Goromorg statue model from LoG1. I open it with the Grimrock Model Toolkit, all seems to be ok, textures/material seems to be set correctly. Then I save the model into my dungeon. My custom object.lua script contains :

Code: Select all

defineObject{
	name = "dungeon_goromorg_statue",
	baseObject = "base_wall",
	class = "Decoration",
	components = {
		{
			class = "Model",
			model = "mod_assets/models/env/dungeon_goromorg_statue.fbx",
		},
	},
	replaceWall = true,
	replaceFloor = false,
	placement = "wall",
	editorIcon = 92,
}
The result is not so bad... but there is only the texture of the statue itself rendered, not the rest of the material... Could someone indicate me a thread or a tutorial explaining how to proceed with multiple texturing ? What's wrong in the above script ?
minmay
Posts: 2790
Joined: Mon Sep 23, 2013 2:24 am

Re: Importing LoG1 model having several material

Post by minmay »

Grimrock 2 does not include all Grimrock 1 materials. You need to copy them over yourself. A few are in the asset pack, and you can just copy over the definitions from Grimrock 1, for others you'd have to copy over the images too (and convert the normal maps).
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.
philippe.martin
Posts: 9
Joined: Fri May 15, 2015 10:44 am

Re: Importing LoG1 model having several material

Post by philippe.martin »

minmay wrote:Grimrock 2 does not include all Grimrock 1 materials. You need to copy them over yourself. A few are in the asset pack, and you can just copy over the definitions from Grimrock 1, for others you'd have to copy over the images too (and convert the normal maps).
Thank you for this quick reply.
I understand the original texture are not all included in LoG2 and I am using the LoG asset pack. My question was more on the manner to apply multiple textures on a model (into model.lua script ?). I thought that if I can see them on the "Grimrock Model Toolkit" (also in my dungeon) it will be ok...meaning the textures are included. But apparently not. This means I have certainly to tell in the script above the right 'material(s)' parameter(s) in several class component ? Isn't it ?
minmay
Posts: 2790
Joined: Mon Sep 23, 2013 2:24 am

Re: Importing LoG1 model having several material

Post by minmay »

Textures are not included in the model file. That would be very inefficient due to the fact that multiple models often use the same texture. Instead the model file specifies material names, which must be defined with defineMaterial.
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.
philippe.martin
Posts: 9
Joined: Fri May 15, 2015 10:44 am

Re: Importing LoG1 model having several material

Post by philippe.martin »

Thanks !

Now I undestand my mistake. My Grimrock Model Toolkit was pointing on wrong materials repository. Of course this tool has to point to 'My Dungeon' folder assets. In this folder I have to import all materials I need and 'declare' them into the script 'materials.lua'. From this step I can wear my objects from those declared materials. Then, just adding what is missing in 'My Dungeon' and redeclare it... nothing more to manage in 'objects.lua' script.
Post Reply