Page 1 of 1
Defining new lights?
Posted: Wed Nov 19, 2014 6:40 pm
by gambit37
Does anyone know the object definition for creating new lights? I tried a few different things based on the Scripting Reference but it all crashes the editor when I try to place one. Thanks.
Re: Defining new lights?
Posted: Wed Nov 19, 2014 7:06 pm
by sps999
Here is a light that I have gotten to work. Perhaps you can use it for reference:
Code: Select all
defineObject{
name = "cave_light",
baseObject = "mine_ceiling_pit_light",
components = {
{
class = "Light",
enabled = true,
range = 1500,
color = vec(0.01, 0.01, 0.01),
brightness = 7,
castShadow = false,
},
},
}
If your light definition looks similar to this, but has a different baseObject, then it might be that your definition is missing some things the game needs that are otherwise defined in the baseObject of "mine_ceiling_pit_light" such as a model.
Re: Defining new lights?
Posted: Wed Nov 19, 2014 7:22 pm
by gambit37
Perfect, thankyou
I had a similar definition, but had used dummy_light as my baseobject and had an extra unnecessary class = "LightSource" in there.