Page 2 of 2

Re: couple of weird lighting things... maybe bugs.

Posted: Mon Sep 17, 2012 11:14 am
by Starnice
Please, could you give an example of how to change a feature of this lightsource?

Re: couple of weird lighting things... maybe bugs.

Posted: Mon Sep 17, 2012 11:48 am
by Lmaoboat
lowzei wrote:Thanks but i'm not sure if this would work because why can't i just access the LightSource of an existing entity like the already implemented ceiling_lamp then? Shouldn't it have just the same properties?
I think all of that is an inherent part of the object.

Re: couple of weird lighting things... maybe bugs.

Posted: Mon Sep 17, 2012 2:56 pm
by Grimwold
lowzei wrote:Thanks but i'm not sure if this would work because why can't i just access the LightSource of an existing entity like the already implemented ceiling_lamp then? Shouldn't it have just the same properties?
As far as I understand you can't simply modify the base items... they are imported "as is" when the dungeon is exported. I think it has to do with the asset usage terms.

However, based on what I've done with other objects, If you want to change the properties of an existing asset, such as the prison ceiling lamp, you can still use clone but you keep the same name

Code: Select all

cloneObject {
          name = "prison_ceiling_lamp"
          baseObject = "prison_ceiling_lamp"
}
then any attributes you add to this entry will change the base prison ceiling lamp.

Re: couple of weird lighting things... maybe bugs.

Posted: Mon Sep 17, 2012 3:19 pm
by Grimwold
Starnice wrote:Please, could you give an example of how to change a feature of this lightsource?
I'll try, but I don't have access to the editor or my custom dungeon on this PC.

The first thing is you will need to create a custom asset (whether you are adding a new asset or modifying the existing one).
Check out http://www.grimrock.net/modding/creating-custom-assets/ for details on creating custom assets. I'm pretty sure you need to edit the .lua file that handles 'objects' like alcoves, doors etc. etc. (can't remember off the top of my head which it is... I know monsters.lua is obviously for adding custom monster assets!)

Open this file in your favourite text editor (windows notepad will do).

Add something like the following text to modify the existing prison ceiling lamp (I can't currently test if I've written this 100% right.. but it shouldn't be far off!)

Code: Select all

cloneObject{
	name = "prison_ceiling_lamp",
	baseObject = "prison_ceiling_lamp",
	castShadow = False,	
	lightRange = 3,
}
The above will change the range of the light and whether it casts shadows. I'm not sure about 3d vector lighting to change the RGB, but some side reading suggests this might work to change the colour to Orange

Code: Select all

lightColor = {1,0.5,0}
100% red plus 50% Green Plus 0% blue

I will give all this a try myself later when I get chance to use my gaming PC.

Re: couple of weird lighting things... maybe bugs.

Posted: Mon Sep 17, 2012 5:16 pm
by Starnice
lightColor = {1,0.5,0} does not work.

But, thank you for the code above!

Anyone know how to succeed with a 3D Vector"?