Defining new lights?

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
Post Reply
User avatar
gambit37
Posts: 218
Joined: Fri Mar 02, 2012 3:40 pm

Defining new lights?

Post 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.
User avatar
sps999
Posts: 44
Joined: Sun Oct 26, 2014 11:16 pm

Re: Defining new lights?

Post 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.
User avatar
gambit37
Posts: 218
Joined: Fri Mar 02, 2012 3:40 pm

Re: Defining new lights?

Post 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.
Post Reply