Shadowgate 2014 "Inspired" (Resource Pack)

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
User avatar
THOM
Posts: 1128
Joined: Wed Nov 20, 2013 11:35 pm
Location: Germany - Cologne
Contact:

Re: Shadowgate 2014 "Inspired" (Resource Pack)

Post by THOM » 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.
THOM formaly known as tschrage
_______________________________________________
My MOD (LoG1): Castle Ringfort Thread
My MOD (LoG2): Journey To Justice Thread | Download

User avatar
Isaac
Posts: 2947
Joined: Fri Mar 02, 2012 10:02 pm

Re: Shadowgate 2014 "Inspired" (Resource Pack)

Post by Isaac » Fri Jun 14, 2019 5:32 pm

**And even then... you could pick from a stored precalculated table of non-repeating random values—that are picked randomly.

User avatar
vanblam
Posts: 243
Joined: Sun Nov 09, 2014 12:15 am

Re: Shadowgate 2014 "Inspired" (Resource Pack)

Post by vanblam » Sun Jun 16, 2019 5:45 pm

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?

User avatar
THOM
Posts: 1128
Joined: Wed Nov 20, 2013 11:35 pm
Location: Germany - Cologne
Contact:

Re: Shadowgate 2014 "Inspired" (Resource Pack)

Post by THOM » 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.
THOM formaly known as tschrage
_______________________________________________
My MOD (LoG1): Castle Ringfort Thread
My MOD (LoG2): Journey To Justice Thread | Download

User avatar
vanblam
Posts: 243
Joined: Sun Nov 09, 2014 12:15 am

Re: Shadowgate 2014 "Inspired" (Resource Pack)

Post by vanblam » Sun Jun 16, 2019 11:10 pm

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

User avatar
vanblam
Posts: 243
Joined: Sun Nov 09, 2014 12:15 am

Re: Shadowgate 2014 "Inspired" (Resource Pack)

Post by vanblam » Mon Jun 17, 2019 12:23 am

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 :)

User avatar
THOM
Posts: 1128
Joined: Wed Nov 20, 2013 11:35 pm
Location: Germany - Cologne
Contact:

Re: Shadowgate 2014 "Inspired" (Resource Pack)

Post by THOM » 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"?
THOM formaly known as tschrage
_______________________________________________
My MOD (LoG1): Castle Ringfort Thread
My MOD (LoG2): Journey To Justice Thread | Download

User avatar
vanblam
Posts: 243
Joined: Sun Nov 09, 2014 12:15 am

Re: Shadowgate 2014 "Inspired" (Resource Pack)

Post by vanblam » Mon Jun 17, 2019 2:05 am

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

kelly1111
Posts: 318
Joined: Sun Jan 20, 2013 6:28 pm

Re: Shadowgate 2014 "Inspired" (Resource Pack)

Post by kelly1111 » Mon Jun 17, 2019 1:09 pm

Looking great...
I WANT ME A LAVA BATH NOW

User avatar
THOM
Posts: 1128
Joined: Wed Nov 20, 2013 11:35 pm
Location: Germany - Cologne
Contact:

Re: Shadowgate 2014 "Inspired" (Resource Pack)

Post by THOM » Mon Jun 17, 2019 2:29 pm

kelly1111 wrote:
Mon Jun 17, 2019 1:09 pm
I WANT ME A LAVA BATH NOW
Huh? Should be a deadly Event... :shock:
THOM formaly known as tschrage
_______________________________________________
My MOD (LoG1): Castle Ringfort Thread
My MOD (LoG2): Journey To Justice Thread | Download

Post Reply