couple of weird lighting things... maybe bugs.

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
User avatar
Starnice
Posts: 13
Joined: Thu Sep 13, 2012 7:08 pm
Contact:

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

Post by Starnice »

Please, could you give an example of how to change a feature of this lightsource?
Lmaoboat
Posts: 359
Joined: Wed Apr 11, 2012 8:55 pm

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

Post 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.
User avatar
Grimwold
Posts: 511
Joined: Thu Sep 13, 2012 11:45 pm
Location: A Dungeon somewhere in the UK

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

Post 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.
User avatar
Grimwold
Posts: 511
Joined: Thu Sep 13, 2012 11:45 pm
Location: A Dungeon somewhere in the UK

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

Post 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.
User avatar
Starnice
Posts: 13
Joined: Thu Sep 13, 2012 7:08 pm
Contact:

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

Post 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"?
Post Reply