Author Topic: SetTileMainLightColor  (Read 367 times)

Legacy_Proleric

  • Hero Member
  • *****
  • Posts: 1750
  • Karma: +0/-0
SetTileMainLightColor
« on: August 19, 2015, 07:38:18 pm »


               Strange issue with this function - it works fine until I load a saved game, then the area reverts to the original lighting, even if I RecomputeStaticLighting again.

If I run the function again OnEnter from a saved game, it doesn't work, but it does work a few seconds later, so it's not hard-baked.

Can't find any posts on this (apart from a very old one about a hard-bake bug that seems to have been fixed).

Anyone else have this issue?
               
               

               
            

Legacy_Pstemarie

  • Hero Member
  • *****
  • Posts: 4368
  • Karma: +0/-0
SetTileMainLightColor
« Reply #1 on: August 20, 2015, 02:47:46 am »


               

I couldn't get around this with a module I was working on some time ago. It seems to me that when you save a game, the engine uses the lighting parameters for the tiles that are configured in the toolset and ignores any that are scripted in. I'm not sure if this applies to placeables as well. 



               
               

               
            

Legacy_Proleric

  • Hero Member
  • *****
  • Posts: 1750
  • Karma: +0/-0
SetTileMainLightColor
« Reply #2 on: August 20, 2015, 07:12:27 am »


               Thanks. I've verified the bug (the new lighting information is simply not in the .sav file) and will update the Lexicon.

The solution is to reapply the new lighting without delay in the OnEnter script. I'd made a silly mistake, using GetArea(OBJECT_SELF) instead of OBJECT_SELF to identify the area.
               
               

               
            

Legacy_Proleric

  • Hero Member
  • *****
  • Posts: 1750
  • Karma: +0/-0
SetTileMainLightColor
« Reply #3 on: August 21, 2015, 10:31:10 am »


               

Updated the Lexicon and the entry for SetTileSourceLightColor.


The good news is that other area property changes (fog, music and so on) are stored in a saved game, in a section called AreaProperties in the .git file. Also, the placeable illumination state is stored in the Placeables list.