Page 1 of 1

[HELP] how to enable/disable particles

Posted: Sat May 31, 2014 3:13 am
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 =]

Re: [HELP] how to enable/disable particles

Posted: Sat May 31, 2014 12:52 pm
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]

Re: [HELP] how to enable/disable particles

Posted: Sat May 31, 2014 4:16 pm
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 :)