Using a different material for default monster?

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Post Reply
Aexrael
Posts: 12
Joined: Thu Sep 13, 2012 11:02 am

Using a different material for default monster?

Post by Aexrael »

Is there a way to overwrite which material an object/item/monster uses

Example

dungeon.lua

Code: Select all

spawn("weak_spider", 1, 10, 9, 3, "weak_spider1")
monster.lua

Code: Select all

cloneObject{
	name = "weak_spider",
	baseObject = "spider",
	health = 1,
}
materials.lua

and then define a different named material for use with the weak_spider? I realize we can overwrite the parameters listed under defineMaterial for the default spider model, but that's not what I want to do, because that affects all spiders.

Code: Select all

defineMaterial{
	name = "weak_spider",
	diffuseMap = "assets/textures/monsters/spider_dif.tga",
	specularMap = "assets/textures/monsters/spider_spec.tga",
	normalMap = "assets/textures/monsters/spider_normal.tga",
	doubleSided = false,
	lighting = true,
	alphaTest = false,
	blendMode = "Opaque",
	textureAddressMode = "Wrap",
	glossiness = 40,
	depthBias = 0,
}
Last edited by Aexrael on Sat Sep 15, 2012 11:50 am, edited 1 time in total.
User avatar
Bek
Posts: 39
Joined: Fri Apr 13, 2012 3:39 am

Re: Using a different material for default monster?

Post by Bek »

A workaround would be to define a new monster that is the spider copied but with a different material.
Aexrael
Posts: 12
Joined: Thu Sep 13, 2012 11:02 am

Re: Using a different material for default monster?

Post by Aexrael »

Could you give an example?
User avatar
antti
Posts: 688
Joined: Thu Feb 23, 2012 1:43 pm
Location: Espoo, Finland
Contact:

Re: Using a different material for default monster?

Post by antti »

The material (or materials) used by monsters and other 3D objects is defined in the 3D model itself so basically the material names cannot be changed without changing the .model files. Unfortunately that is currently practically not possible since we haven't gotten the asset pack ready yet (busy fixing bugs still, which take priority!) and there's no .model exporter/converter yet.

You can, of course, override a material (by defining a material with the same name as the original, like "spider" for example) which will change all objects that refer to the material (in this case, both the spider and the weak spider).

I hope this clarifies the matter a bit.
Steven Seagal of gaming industry
Aexrael
Posts: 12
Joined: Thu Sep 13, 2012 11:02 am

Re: Using a different material for default monster?

Post by Aexrael »

I was afraid that was the case. I wanted to have two different looking spiders so as to indicate that they were of different difficulty/ability. It was an attempt to differentiate the limited selection of monsters available, effectively making more monsters available.

Hopefully the selection will expand down the line.
Post Reply