I was planning to get some new red light in my dungeon, however... I cannot really get that "FX" to work...
I have tried:
function test11111()
if testp1:isDown() == true
fxtest:setLight(1, 0, 0, 10, 3, 200, true)
else
end
end
with a pressure_plate and a FX
(The script doesn't work)
Help to FX
Re: Help to FX
Probably easier to clone a light source and spawn or toggle it as you desire.
Add something like this to your mod_assets/scripts/objects.lua file
then reload your dungeon in the editor and you'll have a new object called "red_ceiling_light" that you can use like any other object.
Try something like
(tip: you don't need to put the "else" unless you want to do something else when the if statement returns false)
if you want the light to only be on while the plate is held down, you'd need a different approach. The ham-handed way is to have two functions:
make your plate trigger "lighton" when activated and trigger "lightoff" when deactivated...I'm sure there's a more elegant solution but I think this gets the job done at least.
Add something like this to your mod_assets/scripts/objects.lua file
Code: Select all
cloneObject{
name = "red_ceiling_light",
baseObject = "temple_ceiling_lamp",
particleSystem = false,
lightColor = vec(0.75,0,0), -- sets light to red. edit the three numbers to any r,g,b values between 0 and 1 to change the color
}
Try something like
Code: Select all
function redlighton()
if testp1:isDown() == true
then
spawn("red_ceiling_light",level,x,y,facing,"myredlight")
end
end
if you want the light to only be on while the plate is held down, you'd need a different approach. The ham-handed way is to have two functions:
Code: Select all
function lighton()
spawn("red_ceiling_light",level,x,y,facing,"myredlight")
end
function lightoff()
myredlight:destroy()
end
Re: Help to FX
yes definitely use a lightsource and not fx for something like this
Finished Dungeons - complete mods to play