Page 14 of 19

Re: Shadowgate 2014 "Inspired" (Resource Pack)

Posted: Fri Jun 14, 2019 8:17 am
by THOM
Add a timer component to the lava object that fires the particle and set its next timer Intervall to a random number.

Re: Shadowgate 2014 "Inspired" (Resource Pack)

Posted: Fri Jun 14, 2019 5:32 pm
by Isaac
**And even then... you could pick from a stored precalculated table of non-repeating random values—that are picked randomly.

Re: Shadowgate 2014 "Inspired" (Resource Pack)

Posted: Sun Jun 16, 2019 5:45 pm
by vanblam
THOM wrote: 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.
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 :P

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" },
}
- Where would I set the math.random?
- Should the timer be set to onActivate or something else?

Re: Shadowgate 2014 "Inspired" (Resource Pack)

Posted: Sun Jun 16, 2019 7:46 pm
by THOM

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,
    		},
In example like this (even I have not tested it).

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.

Re: Shadowgate 2014 "Inspired" (Resource Pack)

Posted: Sun Jun 16, 2019 11:10 pm
by vanblam
THOM wrote: Sun Jun 16, 2019 7:46 pm

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,
    		},
In example like this (even I have not tested it).

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.
Awesome thanks bud :D

Re: Shadowgate 2014 "Inspired" (Resource Pack)

Posted: Mon Jun 17, 2019 12:23 am
by vanblam
Well thanks to you guys the lava came out really nice. Below is a video of the result.

Video Here!

I will be creating more lava rock style objects for you guys to use if you wish to add extra details :)

Re: Shadowgate 2014 "Inspired" (Resource Pack)

Posted: Mon Jun 17, 2019 1:50 am
by THOM
Yeah - that's quiet cool!

What's about a soundeffect when the lava splashes?

And maybe you want to consider the lava be more untransparent when under "water"?

Re: Shadowgate 2014 "Inspired" (Resource Pack)

Posted: Mon Jun 17, 2019 2:05 am
by vanblam
THOM wrote: Mon Jun 17, 2019 1:50 am Yeah - that's quiet cool!

What's about a soundeffect when the lava splashes?

And maybe you want to consider the lava be more untransparent when under "water"?
You know I was thinking about having a sound for the splashes, glad you said something :)

Yea the water is at 50% so I could see the walls, I forgot to turn it back up :P

EDIT: Added the splash sound, its a nice touch :D

Re: Shadowgate 2014 "Inspired" (Resource Pack)

Posted: Mon Jun 17, 2019 1:09 pm
by kelly1111
Looking great...
I WANT ME A LAVA BATH NOW

Re: Shadowgate 2014 "Inspired" (Resource Pack)

Posted: Mon Jun 17, 2019 2:29 pm
by THOM
kelly1111 wrote: Mon Jun 17, 2019 1:09 pm I WANT ME A LAVA BATH NOW
Huh? Should be a deadly Event... :shock: