PDA

View Full Version : Adding Dynamic Lights through .txi files?


MechWarrior001
05-27-2010, 01:52 AM
Is it possible to make a effect show dynamic lighting using a *.txi file?

VarsityPuppet
05-27-2010, 10:11 AM
Yes, if you use envmaptexture (and then indicate the name of a texture, usually CM_something) it usually implements a dynamic light effect.

MechWarrior001
05-27-2010, 01:11 PM
Alright, but what controls color? Do I have to specify it manually or link it to the color function of a object?

VarsityPuppet
05-27-2010, 02:03 PM
Well, usually the color of the CM_[name] texture determines the color I guess. This might not be what you're looking for though...

MechWarrior001
05-27-2010, 10:55 PM
Alright, so which *.txi files cover the lightsaber blades? Trying to make lightsabers give off dynamic lights. Also, does the TSL Engine (Odessey, I believe?) support cubemaps? If that's what CM_ maps are.

Rtas Vadum
05-28-2010, 12:06 AM
Alright, so which *.txi files cover the lightsaber blades? Trying to make lightsabers give off dynamic lights. Also, does the TSL Engine (Odessey, I believe?) support cubemaps? If that's what CM_ maps are.

From what I can tell, the game does use txi files, but it seems to have them merged with the texture itself, ergo the .tpc(as you can see the effects a texture uses when viewing it in KOTOR Tool, in the white box in the lower left), in the vanilla game. But for the lighsaber blades, they only use two options by default, which are:

blending additive
decal 1

While the decal 1 simply looks for any black in the blade texture and makes it invisible, I'm not too sure what the Blending Additive does. Though unlike Jedi Academy, I don't think the blades can be made to cast light. Most you can do is make the blade glow. Which just involves adding some lines to the .txi, and editing the texture to have frames(just making a new texture which is doubled, tripled, etc, in one image).

MechWarrior001
05-28-2010, 12:16 AM
Alright, and what code would I have to add to the *.txi file? And how would I add frames to the texture?

Also, If the blaster shots can be set to give off red dynamic lights, would it be possible to use the coding from them to make the lightsaber blades glow?

Rtas Vadum
05-28-2010, 12:59 AM
Alright, and what code would I have to add to the *.txi file? And how would I add frames to the texture?


For the txi:

proceduretype cycle
defaultwidth 256 (width of single frame)
defaultheight 256 (height of single frame)
numx 2
numy 2
fps 24 (how fast the animation goes)
blending additive
decal 1

For the texture:

You'll need photoshop, though Gimp might be usable as well.

The total size of the texture depends on what size your blade texture is. If you want to use the game's default(which is a 128x128), the texture size you want is 512x512. Copy the 128 texture into the 512, four times. Each of them makes up one frame. If you want more frames, you just need to multiply the size of the texture by the number of frames you want (ie. 128x4=512), though its best to stick with even numbers, else the texture won't appear correctly.

As for the animation itself, the way of doing that can vary. But all you really need to do is change how much "glow" there is on the white core. The method I used, is to create four circles(equal in size to the existing ones), and center them over the existing ones. Then I use the "Outer Glow" effect to change the intensity of the glow on each frame. There might be a better method for this, but I can't say I know it.

Edit: You might want to look at this as well: http://knightsoftheoldrepublic.filefront.com/file/Flickering_Lightsaber_Blades;104551