Move torch w/holder in "Z" axis w/ GMT?

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Post Reply
Paul
Posts: 15
Joined: Wed Apr 03, 2013 1:44 am
Location: Detroit, MI

Move torch w/holder in "Z" axis w/ GMT?

Post 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
Last edited by Paul on Thu Apr 18, 2013 11:16 pm, edited 1 time in total.
User avatar
Komag
Posts: 3659
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: Move torch w/holder in "Z" axis w/ GMT?

Post 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)
Finished Dungeons - complete mods to play
User avatar
Damonya
Posts: 134
Joined: Thu Feb 28, 2013 1:16 pm
Location: France
Contact:

Re: Move torch w/holder in "Z" axis w/ GMT?

Post 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)
Orwak - MOD - Beta version 1.0
User avatar
Diarmuid
Posts: 807
Joined: Thu Nov 22, 2012 6:59 am
Location: Montreal, Canada
Contact:

Re: Move torch w/holder in "Z" axis w/ GMT?

Post 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?
User avatar
Damonya
Posts: 134
Joined: Thu Feb 28, 2013 1:16 pm
Location: France
Contact:

Re: Move torch w/holder in "Z" axis w/ GMT?

Post 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.
Orwak - MOD - Beta version 1.0
Post Reply