Page 1 of 1
Making the dungeon darker
Posted: Wed Dec 28, 2016 12:54 am
by kelly1111
Is there a way to make the standard light in the dungeon darker ?
Does the party carry a standard lightsource with it, that I have to alter to make it seem more dark?
fiddling with the range in the parry object from the generic.lua doesnt seem to do anything at al ....
Code: Select all
defineObject{
name = "party",
components = {
{
class = "Party",
},
{
class = "Light",
name = "torch",
range = 4,
},
},
editorIcon = 32,
placement = "floor",
}
Any suggestions?
Re: Making the dungeon darker
Posted: Wed Dec 28, 2016 10:16 am
by minmay
There's some hardcoded stuff in the game that controls the torch component. If you want to change it, you are better off disabling it and using your own:
Code: Select all
defineObject{
name = "party",
components = {
{
class = "Party",
},
{
class = "Light",
name = "torch",
enabled = false,
},
{
class = "Light",
color = vec(0.25,1,0.5),
range = 9,
onUpdate = function(self)
-- torch still updates when disabled so you can get its offset, color, brightness, range, etc. and they will be accurate
self:setOffset(self.go.torch:getOffset())
end
},
},
editorIcon = 32,
placement = "floor",
}
Re: Making the dungeon darker
Posted: Wed Dec 28, 2016 10:00 pm
by kelly1111
Thanks minmay,
I used your code and the dungeon does indeed get darker with it. But now when I use the torch in a players hand, the dungeon gets even darker instead of casting light...
any idea why this is happening? Same code you used below here, adjusted the color only
Code: Select all
defineObject{
name = "party",
components = {
{
class = "Party",
},
{
class = "Light",
name = "torch",
enabled = false,
},
{
class = "Light",
color = vec(0.1,0.1,0.1),
range = 8,
onUpdate = function(self)
-- torch still updates when disabled so you can get its offset, color, brightness, range, etc. and they will be accurate
self:setOffset(self.go.torch:getOffset())
end
},
},
editorIcon = 32,
placement = "floor",
}
Re: Making the dungeon darker
Posted: Wed Dec 28, 2016 10:09 pm
by zimberzimber
Color is way too dark.
Re: Making the dungeon darker
Posted: Wed Dec 28, 2016 10:25 pm
by minmay
The code I posted was just a stub, not something suitable to use as-is. At a minimum you'll want to adjust the brightness, color, and range of the new LightComponent to correspond to that of torch so that wielding a TorchItemComponent or casting Light still makes things brighter.
Re: Making the dungeon darker
Posted: Wed Dec 28, 2016 10:26 pm
by kelly1111
Tried with a higher value in colors, but when I equip a torch the dungeon still gets darker instead of brighter...
can someone please try it out in a test dungeon?
I did use minmay exact code in a small test dungeon with the same results... I am unable to use a torch with it. The torch makes the light get darker ...strange
ooo just now see that you answered my question already... will try to adjust range and brightness