Make a Light Object

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
Eleven Warrior
Posts: 752
Joined: Thu Apr 18, 2013 2:32 pm
Location: Australia

Make a Light Object

Post by Eleven Warrior »

Hi all.

Ok I just want to make full square Black Dark Light Box. The code below was from LOG 1 and I need to have this object in LOG 2

Code: Select all

defineObject{
	name = "dark_square",
	class = "LightSource",
	lightPosition = vec(0, 1.4, 0),
	lightRange = 2.6,
	lightColor = vec(-1, -1, -1),
	brightness = 100, ---was 200 ---
	castShadow = false,
	placement = "floor",
	editorIcon = 88,
}
I know it's probably easy, but can someone please rewrite this code for me thank you :) I need this for a Wallset.
minmay
Posts: 2790
Joined: Mon Sep 23, 2013 2:24 am

Re: Make a Light Object

Post by minmay »

Note: I strongly disapprove of using this object. Light with negative colours causes terrible rendering behaviour, such as max-value pixels appearing around the edges. In particular the OpenGL and DirectX versions of Legend of Grimrock 1 rendered negative lights completely differently and the OpenGL version made them look even more absolutely terrible than they already do (instead of turning textures black they would wrap around and turn them white). The only use of negative light I have seen so far that I did not hate was Ancylus' "Hall of Inversion" room in ORRR2, because it used them in a very specific (and ingenious) way that avoided the rendering issues.
But I'm providing it anyway since otherwise someone else will probably make an even worse version of it.

Code: Select all

defineObject{
	name = "dark_square",
	components = {
		{
			class = "Light",
			offset = vec(0, 1.4, 0),
			range = 2.6,
			color = vec(-1,-1,-1),
			brightness = 100,
			castShadow = false,
		},
	},
	placement = "floor",
	editorIcon = 88,
}
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
User avatar
Eleven Warrior
Posts: 752
Joined: Thu Apr 18, 2013 2:32 pm
Location: Australia

Re: Make a Light Object

Post by Eleven Warrior »

Yep I agree it does look bad. The object has a purple edge around it not good. I did find it useful in LOG 1 for a hallway where you had to feel the walls for a secret button but, even then it was strange. Ohh well in the garbage can it goes thxs anyway Minmay :)
Post Reply