Page 1 of 2

Torches (Dim)

Posted: Wed Oct 17, 2012 7:32 am
by King Semos
Anyone know how to spawn torches that are dim. I don't want there to be too much light, so I was wondering if it is possible to create new torches that are almost extinguished?

Re: Torches (Dim)

Posted: Wed Oct 17, 2012 8:45 am
by Decayer
local mytorch = spawn("torch", l, x, y, f)
mytorch:setFuel(30)

Re: Torches (Dim)

Posted: Wed Oct 17, 2012 9:31 am
by war_dog
can this be done with torches in the torch holder aswell?

Re: Torches (Dim)

Posted: Wed Oct 17, 2012 10:14 am
by Komag
I haven't heard of a way to have dim torchlight, but maybe a custom object could do it, not sure. You could certainly place dim lighting in the area that is not torches, just low colored fx lights

Re: Torches (Dim)

Posted: Wed Oct 17, 2012 10:49 am
by Decayer
war_dog wrote:can this be done with torches in the torch holder aswell?
If it's an empty torch holder, try:

local mytorch = spawn("torch", l, x, y, f)
mytorch:setFuel(30)
myholder:addItem(mytorch)

if it isn't empty then things get complicated and I don't have an answer right now...

Re: Torches (Dim)

Posted: Wed Oct 17, 2012 10:52 am
by Lollgramoth
The definition of how the torchlight is shown is found in the standart asset packet in the subfolder assets/particles/torch.lua ... maybe overwrite it?

Good luck :)

Re: Torches (Dim)

Posted: Wed Oct 17, 2012 4:41 pm
by King Semos
Decayer wrote:local mytorch = spawn("torch", l, x, y, f)
mytorch:setFuel(30)
Where am I supposed to put this?

Is this lua scripting in the editor, or in the dungeon files?

Re: Torches (Dim)

Posted: Wed Oct 17, 2012 4:53 pm
by Decayer
King Semos wrote:
Decayer wrote:local mytorch = spawn("torch", l, x, y, f)
mytorch:setFuel(30)
Where am I supposed to put this?

Is this lua scripting in the editor, or in the dungeon files?
It's Lua, however you could also do this:

Code: Select all

cloneObject{
name = "torch_dim",
baseObject = "torch",
fuel = 30,
}
to create a torch that only lasts for 30 seconds. Copy + paste that into items.lua and reload the project and you should see torch_dim in the list of items.

Edit: I might be misunderstanding you; this torch only has a shorter duration, it isn't actually dimmer.

Re: Torches (Dim)

Posted: Wed Oct 17, 2012 5:03 pm
by King Semos
Decayer wrote:
King Semos wrote:
Decayer wrote:local mytorch = spawn("torch", l, x, y, f)
mytorch:setFuel(30)
Where am I supposed to put this?

Is this lua scripting in the editor, or in the dungeon files?
It's Lua, however you could also do this:

Code: Select all

cloneObject{
name = "torch_dim",
baseObject = "torch",
fuel = 30,
}
to create a torch that only lasts for 30 seconds. Copy + paste that into items.lua and reload the project and you should see torch_dim in the list of items.

Edit: I might be misunderstanding you; this torch only has a shorter duration, it isn't actually dimmer.
Thanks.

The torch itself is bright yea, it dims about 5 seconds before it extinguishes. I guess the given fuel level doesn't determine if its bright or dim, probably only when it reaches a % of its base fuel level.

Though this is still useful, I think I could use some short duration torches.

Re: Torches (Dim)

Posted: Wed Oct 17, 2012 6:54 pm
by Batty
Standard torch starts @ 1100 seconds.

First dim is ~308 seconds.

Second dim is ~28 seconds.

May be missing a step but I did a fairly thorough testing.

edit: the way to have the torch start as dim is to do what Decayer posted and use setFuel() in a script entity (in editor). If you create a torch low fuel object in the lua file, it works on a % basis as you found out.