Page 1 of 1
Move torch w/holder in "Z" axis w/ GMT?
Posted: Thu Apr 18, 2013 10:49 pm
by Paul
Trying to reposition a torch to correspond with it's torch holder in +/- z axis. I can move the torch holder up, or down, but for the life of me I can't figure out once I have the holder in postion at -3 or +3 in "z" to add a lit torch that matches the holders location. How does the interaction with the torch holder and the "add torch" script work? Is this possible or should I just use another light source? Thx!
-Paul
Re: Move torch w/holder in "Z" axis w/ GMT?
Posted: Thu Apr 18, 2013 11:06 pm
by Komag
I hacked it by using a fake light and a burned out torch, IIRC (I'm starting to forget the details). You can see the setup in the tomb section of Master Quest in the source files (although that section is pretty complex, might be hard to tell what's going on)
Re: Move torch w/holder in "Z" axis w/ GMT?
Posted: Thu Apr 18, 2013 11:54 pm
by Damonya
I do like that :
Code: Select all
defineObject{
name = "torch_holder_up",
class = "TorchHolder",
model = "mod_assets/models/torch_holder_up.fbx",
anchorPos = vec(0.05, 4.53, -0.25),
anchorRotation = vec(0, -20, -90),
placement = "wall",
editorIcon = 84,
}
In GMT, take the torch holder model's and translate 3 in Z axe.
Code: Select all
defineObject{
name = "torch_light_up",
class = "LightSource",
lightPosition = vec(0, 4.8, 1.1),
lightRange = 10,
lightColor = vec(1, 0.5, 0.25),
brightness = 11,
castShadow = true,
particleSystem = "torch",
placement = "floor",
editorIcon = 88,
}
Place your torch_holder_up without adding torch.
and in a script :
Code: Select all
local mytorch = spawn("torch", l, x, y, f)
mytorch:setFuel(0)
torch_holder_up_1:addItem(mytorch)
Re: Move torch w/holder in "Z" axis w/ GMT?
Posted: Fri Apr 19, 2013 5:00 am
by Diarmuid
Damonya wrote:
lightPosition = vec(0, 4.8, 1.1),
[/code]
In my tests I found that positioning at 1.85 above ground is a bit more precise. So I would suggest (0, 4.85, 1.1).
I wonder, is the light position rotating if you rotate the light source object?
Re: Move torch w/holder in "Z" axis w/ GMT?
Posted: Fri Apr 19, 2013 10:13 am
by Damonya
Diarmuid wrote:
I wonder, is the light position rotating if you rotate the light source object?
Yes.
In my tests I found that positioning at 1.85 above ground is a bit more precise. So I would suggest (0, 4.85, 1.1).]
The difference is really unnoticeable
Otherwise I think Komag adds a "radiant light" around the torch_holder_up, in his mod, but it's not compulsory.
And with this method, this is also effective to turn off a torch (simply disable-enable the torch_light). With a real item torch this is more complex.