Page 1 of 1

Trouble with costum particles

Posted: Wed Sep 26, 2012 5:56 pm
by Skuggasveinn
Hi

I'm having trouble with costum particles.

First I clone an existing light source and define my own particle.

Code: Select all

cloneObject{
   name = "temple_ceiling_lamp_red",
   baseObject = "temple_ceiling_lamp",
   particleSystem = "temple_ceiling_lamp_red",
   lightColor = vec(1,0,0), -- RGB value
}
The object shows up in the editor and is creating red light, put my costum temple_ceiling_lamp_red particle is not showing up.

looking at the mod_assets\scripts folder I saw that there is no particles.lua script, so I went ahead and created one.
the mod_assets\scripts\particles.lua script has only the following line.

Code: Select all

import "mod_assets/particles/temple_ceiling_lamp_red.lua"
again there is no particles folder directly under mod_assets like there is under the orginal assets folder, so again I went ahead and created it, and dropped my temple_ceiling_lamp_red.lua script under it.

Code: Select all

defineParticleSystem{
	name = "temple_ceiling_lamp_red",
	emitters = {
		-- glow
		{
			spawnBurst = true,
			emissionRate = 1,
			emissionTime = 0,
			maxParticles = 1,
			boxMin = {0,0,-0.1},
			boxMax = {0,0,-0.1},
			sprayAngle = {0,30},
			velocity = {0,0},
			texture = "mod_assets/textures/particles/red_glow.tga",
			lifetime = {1000000, 1000000},
			color0 = {0.8, 0.11, 0.05},
			opacity = 1,
			fadeIn = 0.1,
			fadeOut = 0.1,
			size = {3, 3},
			gravity = {0,0,0},
			airResistance = 1,
			rotationSpeed = 0,
			blendMode = "Additive",
		}
	}
}
the red_glow.tga is in the correct place under mod_assets (and yes its a DDS file) I even copied the glow.dds and renamed it red_glow.dds to see if I get the orginal blue particle if there was something wrong with my dds export, but no, the particle simply doesn't show up ingame.

Running the preview I get the following error msg:
warning! no such particle system: mod_assets/particles/temple_ceiling_lamp_red

Has anyone had a succsessfull costum particle show up ingame ?, can you see what I'm doing wrong here ?
Giving that there is no particle.lua and no particles folder undir the mod_assets I'm getting the wipe that this is not supported , can anyone confirm that ??

best regards.
Skuggasveinn.

Re: Trouble with costum particles

Posted: Wed Sep 26, 2012 6:09 pm
by petri
You're probably missing an import in init.lua.

Re: Trouble with costum particles

Posted: Wed Sep 26, 2012 8:15 pm
by Skuggasveinn
ahh yes :D
Everything is working now (makes perfect sense that since particles.lua was missing under the mod_assets its ofcourse not being imported be default in the init.lua)

thanks Petri for your continued amazing support for this community..

Re: Trouble with costum particles

Posted: Wed Sep 26, 2012 10:02 pm
by petri
You're welcome. Glad it works!

Re: Trouble with costum particles

Posted: Thu Sep 27, 2012 2:54 am
by SpacialKatana
I've been having fun with particles too....unlike this unlucky SOaB in my dungeon :twisted:

Image