[HELP] how to enable/disable particles

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Post Reply
User avatar
hecktickxx
Posts: 20
Joined: Mon Apr 21, 2014 7:36 pm

[HELP] how to enable/disable particles

Post by hecktickxx »

Heyo again, just got stuck with scripting as I want to make a blocked hallway with steam and therefore you will need to turn it off from a far away valve, is it possible to make the particle asset disabled through commands?
Thanks for your time =]
User avatar
Leki
Posts: 550
Joined: Wed Sep 12, 2012 3:49 pm

Re: [HELP] how to enable/disable particles

Post by Leki »

Define object emiting particles e.g.:

Code: Select all

defineObject{
	name = "my_valve_emi",
	class = "LightSource",
	lightPosition = vec(1, 1, 1),
	lightRange = 0.01,
	lightColor = vec(0, 0, 0),
	brightness = 0,
	castShadow = false,
	particleSystem = "my_steam",
	placement = "wall",
	editorIcon = 88,
}
define your steam particle (add parameters you want - this is just example":

Code: Select all

defineParticleSystem{
	name = "my_steam",
	emitters = {
		-- smoke
		{
			emissionRate = 5,
			emissionTime = 0,
			maxParticles = 50,
			boxMin = {-0.03, 0.1, -0.03},
			boxMax = { 6, 5,  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 = 1,
			fadeIn = 0.5,
			fadeOut = 0.5,
			size = {3, 5},
			gravity = {0,0,0},
			airResistance = 0.1,
			rotationSpeed = 0.6,
			blendMode = "Translucent",
		}
}
to add steam use spawn(object, level, x, y, facing, [id]), to remove it use object:destroy().

[/color]
I'm the Gate I'm the Key.
Dawn of Lore
User avatar
hecktickxx
Posts: 20
Joined: Mon Apr 21, 2014 7:36 pm

Re: [HELP] how to enable/disable particles

Post by hecktickxx »

Thanks a bunch I got it working fine >:D and managed to use he "destroy" command to make a invisible blocker as well.
Your the best :)
Post Reply