Object: 2 x campfires
Code: Select all
defineObject{
name = "dm_campfire",
class = "Altar",
model = "mod_assets/dmcsb_pack/models/env/dm_campfire.fbx",
anchorPos = vec(-0, 0.10, 0),
anchorRotation = vec(0, 10, 0),
targetPos = vec(-0, 0.11, 0),
targetSize = vec(0.2, 0.2, 0.2),
placement = "floor",
editorIcon = 52,
onInsertItem = function (self, item)
return item.name == "torch" and self:getItemCount() == 0
end,
}
defineObject{
name = "dm_campfire_lit",
class = "Altar",
model = "mod_assets/dmcsb_pack/models/env/dm_campfire_lit.fbx",
anchorPos = vec(-0, 0.10, 0),
anchorRotation = vec(0, 10, 0),
targetPos = vec(-0, 0.11, 0),
targetSize = vec(0.2, 0.2, 0.2),
onInsertItem = function(self, item)
return item.name == "torch" and self:getItemCount() == 0
end,
placement = "floor",
editorIcon = 52,
}Code: Select all
defineObject{
name = "dm_campfire_light",
class = "LightSource",
lightPosition = vec(0, 0.25, 0),
lightRange = 10,
lightColor = vec(1, 0.5, 0.25),
brightness = 14,
castShadow = true,
flicker = true,
particleSystem = "dm_campfire_light",
placement = "floor",
editorIcon = 88,
}
defineObject{
name = "dm_campfire_loclight",
class = "LightSource",
lightPosition = vec(0, 0.4, 0),
lightRange = 1.2,
lightColor = vec(0.6, 0.5, 0.4),
brightness = 18,
castShadow = false,
flicker = true,
particleSystem = false,
placement = "floor",
editorIcon = 88,
}Code: Select all
-- Particle system for log_campfire_light
defineParticleSystem{
name = "dm_campfire_light",
emitters = {
-- smoke
{
emissionRate = 6,
emissionTime = 0,
maxParticles = 50,
boxMin = {-0.03, 0.1, -0.03},
boxMax = { 0.03, 0.1, 0.03},
sprayAngle = {0,40},
velocity = {0.1,0.5},
texture = "assets/textures/particles/smoke_01.tga",
lifetime = {1,1.9},
color0 = {0.15, 0.15, 0.15},
opacity = 1,
fadeIn = 0.5,
fadeOut = 0.5,
size = {0.8, 1.4},
gravity = {0,0,0},
airResistance = 0.1,
rotationSpeed = 0.6,
blendMode = "Translucent",
},
-- flames
{
emissionRate = 40,
emissionTime = 0,
maxParticles = 100,
boxMin = {-0.03, -0.03, 0.03},
boxMax = { 0.03, 0.03, -0.03},
sprayAngle = {0,20},
velocity = {0.2, 1},
texture = "assets/textures/particles/torch_flame.tga",
frameRate = 35,
frameSize = 64,
frameCount = 16,
lifetime = {0.25, 0.85},
colorAnimation = true,
color0 = {2, 2, 2},
color1 = {1.0, 1.0, 1.0},
color2 = {1.0, 0.5, 0.25},
color3 = {1.0, 0.3, 0.1},
opacity = 1,
fadeIn = 0.15,
fadeOut = 0.3,
size = {1.4, 0.020},
gravity = {0,0,0.1},
airResistance = 1.0,
rotationSpeed = 0.8,
blendMode = "Additive",
depthBias = -0.002,
},
-- glow
{
spawnBurst = true,
emissionRate = 1,
emissionTime = 0,
maxParticles = 1,
boxMin = {0,0,-0.1},
boxMax = {0,0,-0.1},
sprayAngle = {0,35},
velocity = {0,0},
texture = "assets/textures/particles/glow.tga",
lifetime = {1000000, 1000000},
colorAnimation = false,
color0 = {0.23, 0.11, 0.08},
opacity = 1,
fadeIn = 0.1,
fadeOut = 0.1,
size = {2, 2},
gravity = {0,0,0},
airResistance = 1,
rotationSpeed = 0,
blendMode = "Additive",
depthBias = -0.002,
}
}
}