Useful particle effects!

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
User avatar
DesperateGames
Posts: 90
Joined: Sun Oct 06, 2013 1:54 pm

Re: Useful particle effects!

Post by DesperateGames »

Gradnuk you should be able to open the materials.lua file with every simple text editor and post the script inside. After adding it to objects.lua and reloading the dungeon in the editor you should be able to reload it.

Actually the defineParticleSystem part does not necessarily need to be in materials.lua, it could as well be in other .lua files that get called before the dungeon is loaded. But you should keep them in one place to find them again ;) .

I copied the structure from the original asset pack:

init.lua -> added the line import "particles.lua"

created a new script: particles.lua -> this just imports a single script for each particle system placed in a seperate folde, for example:

import "mod_assets/particles/laser.lua"
import "mod_assets/particles/smoke.lua"
import "mod_assets/particles/steam.lua"

where laser, smoke ans steam are individual particle systems or particle groups if you will. I hope that is not confusing more than it is helping , but I think that is a nice way of organizing your particles. ;)
User avatar
Eightball
Posts: 48
Joined: Thu Jan 09, 2014 8:21 am

Re: Useful particle effects!

Post by Eightball »

These effects are great. Having trouble thinking out how to reposition a few of my effects (like making a fire column horizontal to shoot out of a statue's mouth or sumthin, but I guess I'll get there if I play with the boxmin-max numbers long enough).

Does anyone have a ready-made effect of something like the Wine Merchant's Basement dragon statues? There's a screenshot I saw of them with smoke rising out of their mouths.

Almost got a few of my effects tweeked and ready. When I finish my my smoke-covered ceilings, flame columns, and fiery doors, I'll be posting them up here for public use. :D
User avatar
DesperateGames
Posts: 90
Joined: Sun Oct 06, 2013 1:54 pm

Re: Useful particle effects!

Post by DesperateGames »

I have some smokey / steamy particle effects in my mod, see the description here:

viewtopic.php?f=14&t=6294

I know it is a long read, but the particle effects that might be interesting for you are:

Level 4:
[Particle Effect] burning wood (18:58)

Level 6:
[Particle Effect] Steaming Food (1:50)
[Particle Effect] Trippy fog and stars (4:22)

Level 7:
[Particle Effect] Steam and sparks (2:18)
[Particle Effect] Poisonous gas (4:50)

Level 8:
[Asset / Particle Effect] Snail Pheromone Smoke Bomb (3:34)

Just switch over to the description thread and check the videos of the corresponding level with the given times, then you should be able to check whether it is worth downloading or not. ;-)
User avatar
Eightball
Posts: 48
Joined: Thu Jan 09, 2014 8:21 am

Re: Useful particle effects!

Post by Eightball »

Thanks! A couple of those effects will certainly come in handy. Especially the small fire on the burning wood effect.

Thought it was time to share this tweek of the fire effect shared earlier in the string. I turned down the emitted particles to fit with AH recommended max of 1000 (plus I didn't want to interfere with frame rates because my level already has many light sources). But I'm still trying to figure out how to get my flame column to appear in the middle of the square rather than at one end. As for fire damage from this effect, check out the insta-death tile post in useful scripts repository (here: viewtopic.php?p=32767#p32767).
SpoilerShow

Code: Select all

defineParticleSystem{
name = "flame_column",
	emitters = {
	-- smoke
	{
	emissionRate = 200,
	emissionTime = 0,
	maxParticles = 500,
	boxMin = {-1.5, 0, -1.5}, 
	boxMax = {1.5, 5, 1.5}, 
	sprayAngle = {0,30},
	velocity = {0.1,0.5},
	texture = "assets/textures/particles/smoke_01.tga",
	lifetime = {1,1.75},
	color0 = {0.15, 0.15, 0.15},
	opacity = 0.6,
	fadeIn = 0.5,
	fadeOut = 0.5,
	size = {1, 1.5},
	gravity = {0,0,0},
	airResistance = 0.1,
	rotationSpeed = 0.6,
	blendMode = "Translucent",
	},

	-- flames
	{
	emissionRate = 600,
	emissionTime = 0,
	maxParticles = 1000,
	boxMin = {-0.5, 0, -0.5}, 
	boxMax = {0.5, 3, 0.5}, 
	sprayAngle = {0,10},
	velocity = {0.2, 1},
	texture = "assets/textures/particles/torch_flame.tga",
	--texture = "mod_assets/textures/torch_flame_blue.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 = {0.15, 1},
	gravity = {0,-0.1,0},
	airResistance = 1.0,
	rotationSpeed = 0.6,
	blendMode = "Additive",
	depthBias = -0.002,
	},
	}
}
This flame column looks great under a ceiling shaft. Notice from my comment line that you can change the flame color if you have a different color texture. (I stole mine from akroma I think, but I don't remember where he/she linked it. It's somewhere on this forum along with a couple other textures like rock_shard)
SpoilerShow

Code: Select all

defineParticleSystem{
   name = "smokey_ceiling",
   emitters = {

    -- smoke
	{
	emissionRate = 200,
	emissionTime = 0,
	maxParticles = 500,
	boxMin = {-3, 2, -1.5},
	boxMax = {0, 3, 1.5},
	sprayAngle = {0,30},
	velocity = {0.1,0.3},
	texture = "assets/textures/particles/smoke_01.tga",
	lifetime = {5,7},
	color0 = {0.15, 0.15, 0.15},
	opacity = 0.6,
	fadeIn = 0.5,
	fadeOut = 0.5,
	size = {1, 1.5},
	gravity = {.3,0,0},
	airResistance = 0.1,
	rotationSpeed = 0.6,
	blendMode = "Translucent",
	},
   }
}
This smoke should be along the ceiling and moving thickly to the east for about two tiles. Looks great coming out of a portcullis.

Oh, one question... How does one "turn off" the smoke or flame emitters so that it gradually dies out rather than just suddenly ceasing to exist? I don't mean setting an emission time for a short term effect, but how can I, for example, by pressing a button, smoothly turn off an otherwise continuous effect.
Post Reply