Page 1 of 1
Spawning Fx's
Posted: Mon Dec 08, 2014 6:08 am
by Mysterious
Hi guys in the old day you could a fx in log 1 like this:
Code: Select all
spawn("fx", party.level, party.x, party.y, party.facing, "red1")
red1:translate(0, 1.5, 0)
red1:setParticleSystem("fade_red_fast_2")
What I would like to know is how you do it for log 2? Thxs

Re: Spawning Fx's
Posted: Tue Dec 09, 2014 2:34 pm
by petri
The FX thing was a terrible hack in LoG1. In LoG2 you build your objects from components.
But if you just need a particle system, an easy way would be to spawn a particle_system object and change the particle system it's using.
Something like this should work (haven't tested):
Code: Select all
local obj = spawn("particle_system", <insert coords here>)
obj.particle:setParticleSystem("fade_red_fast_2")
Re: Spawning Fx's
Posted: Wed Dec 10, 2014 9:23 am
by Mysterious
Thxs Petri it works now I have a new weapon

Re: Spawning Fx's
Posted: Thu Dec 11, 2014 1:40 am
by Phitt
Works great, but is there any way to avoid the annoying 'Warning! no such particle system: xxx' console message?
Re: Spawning Fx's
Posted: Thu Dec 11, 2014 1:45 am
by minmay
spawn("particle_system",<coords>).particle:setParticleSystem("torch")