Page 1 of 1

Spawning a particle effect in an alcove

Posted: Tue Oct 09, 2012 1:59 am
by Kasarul
Hello!
I am currently trying to play a particle effect within an alcove after placement of an item.
Here is my current code:

end
SpoilerShow
function gemaCheck()
local itemFound = false
for i in alcovegema:containedItems() do
if i.name == "blue_gem" then
itemFound = true
end
end

if itemFound then
spawn("fx", 1, 29, 10, 3, "smoke")
smoke:setParticleSystem("smoke_1")
smoke:translate(2, 1, 0)
blue_gem_2:destroy()
gemdoora:open()
gemdoorc:open()
hudPrint("A second secret door opens nearby...")
playSound("secret")
party:getChampion(1):gainExp(60)
party:getChampion(2):gainExp(60)
party:getChampion(3):gainExp(60)
party:getChampion(4):gainExp(60)
else
gemdoora:close()
end
end
Everything works but the particle will not spawn. Do I have to attach the particle to an item?
Any and all help is appreciated!

Re: Spawning a particle effect in an alcove

Posted: Mon Oct 15, 2012 7:53 pm
by Lark
I've not tried this yet, but I will - this is a cool idea. But shouldn't spawn("fx", 1, 29, 10, 3, "smoke") be smoke = spawn("fx", 1, 29, 10, 3, "smoke") to match the statements following? I really don't know LUA very well and it does some strange things, but the above is how I reference all objects I spawn in scripts. (Also, if you'll use "Code" tags when you post, your indents will be preserved.)

Good Luck! -Lark