Re: Shadowgate 2014 "Inspired" (Resource Pack)
Posted: Fri Jun 14, 2019 8:17 am
Add a timer component to the lava object that fires the particle and set its next timer Intervall to a random number.
Official Legend of Grimrock Forums
http://grimrock.net/forum/
I have 3 particle systems on that object how do I specifically choose the one I want? Ill post my object code below, lol I don't really know how to set this up
Code: Select all
defineObject{
name = "rc_molten_floor_01",
baseObject = "base_floor_decoration",
components = {
{
class = "Model",
model = "mod_assets/vanblam/red_cave/models/env/rc_molten_floor_01.fbx",
staticShadow = true,
offset = vec(0, -0.05, 0),
},
{
class = "Light",
range = 11,
offset = vec(0, 3, 0),
color = vec(1, 0.3, 0.08),
brightness = 8,
castShadow = false,
staticShadows = true,
shadowMapSize = 256,
},
{
class = "Particle",
particleSystem = "gen_lava_smoke01",
emitterMesh = "mod_assets/vanblam/red_cave/models/env/rc_lava_e_mesh.fbx",
},
{
class = "Particle",
name = "sparks",
particleSystem = "gen_lava_sparks01",
emitterMesh = "mod_assets/vanblam/red_cave/models/env/rc_lava_e_mesh_sparks.fbx",
},
{
class = "Particle",
name = "splashes",
particleSystem = "rc_lava_splash",
enabled = false,
},
{
class = "Timer",
timerInterval = 1,
disableSelf = false,
enabled = true,
onActivate = function(self)
self.go.particle.splashes:setEnabled(true)
end,
},
{
class = "Sound",
sound = "gen_lava",
},
{
class = "Occluder",
model = "assets/models/env/dungeon_floor_01_occluder.fbx",
},
},
minimalSaveState = true,
tags = { "red cave", "vanblam" },
}
Code: Select all
{
class = "Timer",
name = "splashestimer",
timerInterval = 5,
onActivate = function(self)
local time = math.random(5,10)
self.go.splashestimer:setTimerInterval(time)
self.go.splashes:restart()
end,
},
Awesome thanks budTHOM wrote: ↑Sun Jun 16, 2019 7:46 pmIn example like this (even I have not tested it).Code: Select all
{ class = "Timer", name = "splashestimer", timerInterval = 5, onActivate = function(self) local time = math.random(5,10) self.go.splashestimer:setTimerInterval(time) self.go.splashes:restart() end, },
You can adress your particle components by its unique name ("splashes" in this case).
The random is now between 5 and 10 seconds but can of course be any other value.
This timer would be activated from the start on and doesn't stop at any time.
You know I was thinking about having a sound for the splashes, glad you said something