Page 1 of 1

Replicating Monster Conds (eg poisoned)

Posted: Fri Nov 25, 2016 3:09 pm
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

Re: Replicating Monster Conds (eg poisoned)

Posted: Fri Nov 25, 2016 7:39 pm
by minmay
PoisonedMonsterComponent does not change the material. It just uses ModelComponent:setEmissiveColor().

Re: Replicating Monster Conds (eg poisoned)

Posted: Sat Nov 26, 2016 1:27 pm
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