Re: (Object Assets) Empty Catacomb as Alcove and other alcov
Posted: Thu Oct 04, 2012 2:20 pm
Lol the free one is prettier.
Official Legend of Grimrock Forums
http://grimrock.net/forum/
LOL thanks for finding & reporting that, I may have never found it. I lit a lantern with a rock lol. Anyway, It's fixed, here's the new script:flatline wrote:Batty, I've copied your stuff and it works fine except that it seems the script accepts ANY object to light the lanterns. When I fool around in the editor, I can put in a sling and still light one of the lanterns. At first, I thought the script lacked a "else"-parameter telling it to end if anything but a torch was inserted. I can't seem to fix it though. Thoughts?
Great work btw, and I'm quite new to scripting Grimrock so bear with me. I did manage to make some nice looking drainage floors with custom fires glowing far below and filling the room with smoke, so progress is being had.
Code: Select all
defineObject{
name = "wall_lantern_logical",
class = "Alcove",
anchorPos = vec(0, 1.65, 0),
targetPos = vec(0, 1.65, 0),
targetSize = vec(0.2, 0.2, 0.2),
onInsertItem = function(self, item)
if item.name == "torch" or item.name == "everlasting_torch" then
spawn("wall_lantern_fx_"..self.facing, self.level, self.x, self.y, 0)
playSoundAt("wall_lantern_crackling", self.level, self.x, self.y)
self:destroy()
end
end,
placement = "wall",
replacesWall = false,
editorIcon = 84,
}
I've fixed the logical lantern script so it only turns on with a "torch" or "torch_everburning", but the item is not destroyed as the script suggests it should be... will look into that.flatline wrote: Batty, I've copied your stuff and it works fine except that it seems the script accepts ANY object to light the lanterns. When I fool around in the editor, I can put in a sling and still light one of the lanterns. At first, I thought the script lacked a "else"-parameter telling it to end if anything but a torch was inserted. I can't seem to fix it though. Thoughts?.
Code: Select all
defineObject{
name = "wall_lantern_logical",
class = "Alcove",
anchorPos = vec(0, 1.65, 0),
targetPos = vec(0, 1.65, 0),
targetSize = vec(0.2, 0.2, 0.2),
onInsertItem = function(self, item)
hudPrint(item.name)
if item.name == "torch" or item.name == "torch_everburning"
then
spawn("wall_lantern_fx_"..self.facing, self.level, self.x, self.y, 0)
playSoundAt("wall_lantern_crackling", self.level, self.x, self.y)
self:destroy()
end
end,
placement = "wall",
replacesWall = false,
editorIcon = 84,
}
The alcove not the item is destroyed so you can't light the lantern twice, dunno why you'd want to destroy the torch. The lantern has red embers/coals in it presumably with some fuel in them so the flame from the torch lights it and you keep the lit torch.Grimwold wrote:but the item is not destroyed as the script suggests it should be... will look into that.
ah. that was my misunderstanding, sorry. I saw the destroy and thought it meant to destroy the item used for lighting.Batty wrote:The alcove not the item is destroyed so you can't light the lantern twice, dunno why you'd want to destroy the torch. The lantern has red embers/coals in it presumably with some fuel in them so the flame from the torch lights it and you keep the lit torch.Grimwold wrote:but the item is not destroyed as the script suggests it should be... will look into that.
andItem:setFuel(fuel)
Sets the remaining fuel (in seconds) for torches.
in the reference! You can handle lighting the lanterns however you want now and they're fully functioning - no more dead torch problem.Item:getFuel(fuel)
Returns the remaining fuel (in seconds) for torches.
This means we can make a level where the player has to compare the benefits of rushinng ahead to light lanterns before his single lonely torch runs out, or rely on light spells and creeping in darkness. Is there any way to lower the ambient light in the dungeon, besides a constant darkness-spell?Batty wrote:Actually, that also makes game sense to me (that you'd have to use an entire torch to light a lantern) and might make things more strategically interesting for the player but you'd have to separately destroy the torch.
MAJOR EDIT: There is:andItem:setFuel(fuel)
Sets the remaining fuel (in seconds) for torches.in the reference! You can handle lighting the lanterns however you want now and they're fully functioning - no more dead torch problem.Item:getFuel(fuel)
Returns the remaining fuel (in seconds) for torches.
I guess it's time to actually read the entire reference.
I've looked at this a little but couldn't find anything. Beyond adjusting ambient light levels, I'd also like to adjust the effect that the light spell produces but I haven't found a way for that either.flatline wrote:This means we can make a level where the player has to compare the benefits of rushinng ahead to light lanterns before his single lonely torch runs out, or rely on light spells and creeping in darkness. Is there any way to lower the ambient light in the dungeon, besides a constant darkness-spell?
I asked for it already in the editor requests thread but more people should request it then maybe we'll get it.Grimwold wrote:This is great. I must've read past those getFuel and setFuel commands a few times and not noticed.
The sound is a bit of an issue though... we really need a way to stop a looping sound. even if it's by means of silencing anything playing in a particular square.