mine pillar crystals different colours

Are you looking for fun Custom Dungeons that you could play or do you want to share your mod with others? Then this forum is for you!
Post Reply
2498billb
Posts: 40
Joined: Thu Dec 30, 2021 6:06 pm

mine pillar crystals different colours

Post by 2498billb »

Hi guys, can anyone help me, I 'm trying to have a 'mine_pillar_crystal' showing the crystals on it with a different colour
eg. red / green crystals as in the MOD guardians in the gem mine, I can't fathom out how to do this any help would be great. thx in advance.
User avatar
ratman
Posts: 158
Joined: Fri Jan 10, 2020 1:13 am

Re: mine pillar crystals different colours

Post by ratman »

Paste these into objects.lua:

Code: Select all

	defineObject{
		name = "mine_pillar_crystal_red",
		baseObject = "base_floor_decoration",
		components = {
			{
				class = "Model",
				model = "assets/models/env/mine_pillar_crystal.fbx",
				staticShadow = true,
				materialOverrides = {healing_crystal = "crystal_shard_recharge"}
			},
			{
				class = "Occluder",
				model = "assets/models/env/mine_pillar_01_occluder.fbx",
			},
		},
		minimalSaveState = true,
	}

	defineObject{
		name = "mine_pillar_crystal_green",
		baseObject = "base_floor_decoration",
		components = {
			{
				class = "Model",
				model = "assets/models/env/mine_pillar_crystal.fbx",
				staticShadow = true,
				materialOverrides = {healing_crystal = "crystal_shard_protection"}
			},
			{
				class = "Occluder",
				model = "assets/models/env/mine_pillar_01_occluder.fbx",
			},
		},
		minimalSaveState = true,
	}
*These ones won't have the light or particles of the normal one
User avatar
Adrageron
Posts: 203
Joined: Thu Nov 08, 2012 1:22 pm

Re: mine pillar crystals different colours

Post by Adrageron »

Hey! Here the ones from Guardians:

Code: Select all

defineParticleSystem{
	name = "mine_crystal_green",
	emitters = {
		-- glow
		{
			emitterShape = "MeshShape",
			emissionRate = 5,
			emissionTime = 0,
			maxParticles = 100,
			boxMin = {-0.1, -0.1,-0.1},
			boxMax = { 0.1, 0.1, 0.1},
			sprayAngle = {0,30},
			velocity = {0,0},
			texture = "assets/textures/particles/glow.tga",
			lifetime = {2, 2},
			colorAnimation = false,
			color0 = {0.15, 0.98, 0.41},
			opacity = 0.15,
			fadeIn = 1,
			fadeOut = 1,
			size = {2, 2},
			gravity = {0,0,0},
			airResistance = 1,
			rotationSpeed = 0,
			blendMode = "Additive",
			depthBias = 0.2,
		},

		-- glow
		{
			emitterShape = "MeshShape",
			emissionRate = 10,
			emissionTime = 0,
			maxParticles = 100,
			boxMin = {-0.1, -0.1,-0.1},
			boxMax = { 0.1, 0.1, 0.1},
			sprayAngle = {0,30},
			velocity = {0,0},
			texture = "assets/textures/particles/glow.tga",
			lifetime = {2, 2},
			colorAnimation = false,
			color0 = {0.25, 0.78, 0.41},
			opacity = 0.35,
			fadeIn = 1,
			fadeOut = 1,
			size = {0.6, 0.6},
			gravity = {0,0,0},
			airResistance = 1,
			rotationSpeed = 0,
			blendMode = "Additive",
			depthBias = 0.2,
		},

		{
			emitterShape = "MeshShape",
			emissionRate = 20,
			emissionTime = 0,
			maxParticles = 100,
			boxMin = {-1.5,-0.5,-0.15},
			boxMax = { 1.5, 2.5, 0.0},
			sprayAngle = {0,360},
			--velocity = {0.05, 0.25},
			velocity = {0, 0},
			objectSpace = true,
			texture = "assets/textures/particles/teleporter.tga",
			lifetime = {0.5,1},
			color0 = {0.5, 1.5, 1},
			opacity = 1,
			fadeIn = 0.3,
			fadeOut = 0.3,
			size = {0.2, 1},
			gravity = {0,0,0},
			airResistance = 0.1,
			rotationSpeed = 1.5,
			blendMode = "Additive",
			depthBias = 0.2,
		},
	}
}


do
	local lightColor = vec(0.3, 1.4, 0.7)
	local lightBrightness = 5
	local lightRange = 2.5
	local lightScale = 1

	defineObject{
		name = "mine_pillar_crystal_green",
		baseObject = "base_floor_decoration",
		components = {
			{
				class = "Model",
				model = "assets/models/env/mine_pillar_crystal.fbx",
				staticShadow = true,
				materialOverrides = { healing_crystal = "crystal_shard_protection" },
			},			
			{
				class = "Light",
				name = "crystal_light_01",
				offset = vec(0.509, 0.93, 0.89) * lightScale,
				range = lightRange,
				color = lightColor,
				brightness = lightBrightness,
				fillLight = true,
				--debugDraw = true,
			},		
			{
				class = "Light",
				name = "crystal_light_02",
				offset = vec(1, 0.79, -0.2) * lightScale,
				range = lightRange,
				color = lightColor,
				brightness = lightBrightness,
				fillLight = true,
				--debugDraw = true,
			},	
			{
				class = "Light",
				name = "crystal_light_03",
				offset = vec(0.5, 1.15, -0.64) * lightScale,
				range = lightRange,
				color = lightColor,
				brightness = lightBrightness,
				fillLight = true,
				--debugDraw = true,
			},		
			{
				class = "Light",
				name = "crystal_light_04",
				offset = vec(0.096, 0.9, -0.85) * lightScale,
				range = lightRange,
				color = lightColor,
				brightness = lightBrightness,
				fillLight = true,
				--debugDraw = true,
			},		
			{
				class = "Light",
				name = "crystal_light_05",
				offset = vec(-0.668, 1.59, 0.38) * lightScale,
				range = lightRange,
				color = lightColor,
				brightness = lightBrightness,
				fillLight = true,
				--debugDraw = true,
			},		
			{
				class = "Light",
				name = "crystal_light_06",
				offset = vec(0.33, 1.46, 0.43) * lightScale,
				range = lightRange,
				color = lightColor,
				brightness = lightBrightness,
				fillLight = true,
				--debugDraw = true,
			},		
			{
				class = "Light",
				name = "crystal_light_07",
				offset = vec(-0.8, 0.8, -0.26) * lightScale,
				range = lightRange,
				color = lightColor,
				brightness = lightBrightness,
				fillLight = true,
				--debugDraw = true,
			},		
			{
				class = "Particle",
				particleSystem = "mine_crystal_green",
				emitterMesh = "assets/models/env/mine_pillar_crystal_emitter.fbx",
				--offset = vec(0.62, 1.41, -0.64),
			},
			{
				class = "Occluder",
				model = "assets/models/env/mine_pillar_01_occluder.fbx",
			},			
		},
		minimalSaveState = true,
	}
end

defineParticleSystem{
	name = "mine_crystal_red",
	emitters = {
		-- glow
		{
			emitterShape = "MeshShape",
			emissionRate = 5,
			emissionTime = 0,
			maxParticles = 100,
			boxMin = {-0.1, -0.1,-0.1},
			boxMax = { 0.1, 0.1, 0.1},
			sprayAngle = {0,30},
			velocity = {0,0},
			texture = "assets/textures/particles/glow.tga",
			lifetime = {2, 2},
			colorAnimation = false,
			color0 = {0.98, 0.41, 0.41},
			opacity = 0.15,
			fadeIn = 1,
			fadeOut = 1,
			size = {2, 2},
			gravity = {0,0,0},
			airResistance = 1,
			rotationSpeed = 0,
			blendMode = "Additive",
			depthBias = 0.2,
		},

		-- glow
		{
			emitterShape = "MeshShape",
			emissionRate = 10,
			emissionTime = 0,
			maxParticles = 100,
			boxMin = {-0.1, -0.1,-0.1},
			boxMax = { 0.1, 0.1, 0.1},
			sprayAngle = {0,30},
			velocity = {0,0},
			texture = "assets/textures/particles/glow.tga",
			lifetime = {2, 2},
			colorAnimation = false,
			color0 = {0.78, 0.41, 0.41},
			opacity = 0.35,
			fadeIn = 1,
			fadeOut = 1,
			size = {0.6, 0.6},
			gravity = {0,0,0},
			airResistance = 1,
			rotationSpeed = 0,
			blendMode = "Additive",
			depthBias = 0.2,
		},

		{
			emitterShape = "MeshShape",
			emissionRate = 20,
			emissionTime = 0,
			maxParticles = 100,
			boxMin = {-1.5,-0.5,-0.15},
			boxMax = { 1.5, 2.5, 0.0},
			sprayAngle = {0,360},
			--velocity = {0.05, 0.25},
			velocity = {0, 0},
			objectSpace = true,
			texture = "assets/textures/particles/teleporter.tga",
			lifetime = {0.5,1},
			color0 = {1.5, 0.5, 1},
			opacity = 1,
			fadeIn = 0.3,
			fadeOut = 0.3,
			size = {0.2, 1},
			gravity = {0,0,0},
			airResistance = 0.1,
			rotationSpeed = 1.5,
			blendMode = "Additive",
			depthBias = 0.2,
		},
	}
}

do
	local lightColor = vec(1.4, 0.5, 0.7)
	local lightBrightness = 5
	local lightRange = 2.5
	local lightScale = 1
	defineObject{
		name = "mine_pillar_crystal_red",
		baseObject = "base_floor_decoration",
		components = {
			{
				class = "Model",
				model = "assets/models/env/mine_pillar_crystal.fbx",
				staticShadow = true,
				materialOverrides = { healing_crystal = "crystal_shard_recharge" },
			},			
			{
				class = "Light",
				name = "crystal_light_01",
				offset = vec(0.509, 0.93, 0.89) * lightScale,
				range = lightRange,
				color = lightColor,
				brightness = lightBrightness,
				fillLight = true,
				--debugDraw = true,
			},		
			{
				class = "Light",
				name = "crystal_light_02",
				offset = vec(1, 0.79, -0.2) * lightScale,
				range = lightRange,
				color = lightColor,
				brightness = lightBrightness,
				fillLight = true,
				--debugDraw = true,
			},	
			{
				class = "Light",
				name = "crystal_light_03",
				offset = vec(0.5, 1.15, -0.64) * lightScale,
				range = lightRange,
				color = lightColor,
				brightness = lightBrightness,
				fillLight = true,
				--debugDraw = true,
			},		
			{
				class = "Light",
				name = "crystal_light_04",
				offset = vec(0.096, 0.9, -0.85) * lightScale,
				range = lightRange,
				color = lightColor,
				brightness = lightBrightness,
				fillLight = true,
				--debugDraw = true,
			},		
			{
				class = "Light",
				name = "crystal_light_05",
				offset = vec(-0.668, 1.59, 0.38) * lightScale,
				range = lightRange,
				color = lightColor,
				brightness = lightBrightness,
				fillLight = true,
				--debugDraw = true,
			},		
			{
				class = "Light",
				name = "crystal_light_06",
				offset = vec(0.33, 1.46, 0.43) * lightScale,
				range = lightRange,
				color = lightColor,
				brightness = lightBrightness,
				fillLight = true,
				--debugDraw = true,
			},		
			{
				class = "Light",
				name = "crystal_light_07",
				offset = vec(-0.8, 0.8, -0.26) * lightScale,
				range = lightRange,
				color = lightColor,
				brightness = lightBrightness,
				fillLight = true,
				--debugDraw = true,
			},		
			{
				class = "Particle",
				particleSystem = "mine_crystal_red",
				emitterMesh = "assets/models/env/mine_pillar_crystal_emitter.fbx",				
				--offset = vec(0.62, 1.41, -0.64),
			},
			{
				class = "Occluder",
				model = "assets/models/env/mine_pillar_01_occluder.fbx",
			},			
		},
		minimalSaveState = true,
	}
end
2498billb
Posts: 40
Joined: Thu Dec 30, 2021 6:06 pm

Re: mine pillar crystals different colours

Post by 2498billb »

Thanks to ratman and Adrageron for your speedy replies, these will be a boon for me, great work!
Post Reply