Replicating Monster Conds (eg poisoned)

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
User avatar
akroma222
Posts: 1029
Joined: Thu Oct 04, 2012 10:08 am

Replicating Monster Conds (eg poisoned)

Post by akroma222 »

Hi All,
As the title suggests - I am trying to create some custom monster conditions.
I am unsure though, how to add the visual effects and still keep the original monster material underneath
For example - PoisonedMonster
SpoilerShow
Image
It seems that the Poisoned material that is added is fading in and out over time
(probably controlled from Material onUpdate = function(self, time) I am guessing - not sure exactly how)

I am trying to make a monster condition - Corrosion
I have the material definition here:
SpoilerShow

Code: Select all

defineMaterial{
	name = "corrosion_monster",
	diffuseMap = "mod_assets/textures/effects/acid_puddle_dif.tga",
	displacementMap = "mod_assets/textures/effects/physicality_disp.tga",	
	doubleSided = true,
	lighting = true,
	alphaTest = false,
	blendMode = "Additive",
	textureAddressMode = "Wrap",	
	glossiness = 60,
	depthBias = 0,
	shader = "crystal",		
	shadeTex = "assets/textures/env/healing_crystal_shadetex.tga",
	crystalIntensity = 2,
	onUpdate = function(self, time)
		self:setTexcoordScaleOffset(1, 1, 0,-time*0.1)	
	end,
}
using the console .... findEntity("crab_2").model:setMaterial("corrosion_monster")
poor crab_2 ends up looking like this:
SpoilerShow
Image
Any help/suggestions appreciated! :?
Akroma
minmay
Posts: 2790
Joined: Mon Sep 23, 2013 2:24 am

Re: Replicating Monster Conds (eg poisoned)

Post by minmay »

PoisonedMonsterComponent does not change the material. It just uses ModelComponent:setEmissiveColor().
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.
User avatar
akroma222
Posts: 1029
Joined: Thu Oct 04, 2012 10:08 am

Re: Replicating Monster Conds (eg poisoned)

Post by akroma222 »

Ah-huh!
I hadnt considered it until Zimber suggested setEmmissive straight after I posted the question
Thanks for confirming, minmay...
SpoilerShow
Image
EDIT: will post up code for various monster Condition effects soon
Post Reply