N-DReW25

Adding Lightning to a module [TSL]

Recommended Posts

Hello, as some of you may recall, Malachor V's outdoor modules have a visible Lightning strike effect that accompanies the Skybox.

 

In-case you don't know what I am talking about, here is an image of the lightning which has been reskinned in Sith Holocron's Replacement Texture for Lightning on Malachor V 1.2 mod:

Spoiler

90d045f2401381561b5d2d4b307ad83f-5f49d9c

 

So my question is, if I wanted to add this lightning effect to other modules how might I do it?

From what I can tell, the lightning texture is part of the Malachor textures so I assume that it's done either by the module info files or via the Skybox/Module model mdl files.

Share this post


Link to post
Share on other sites

There are a couple of ways you could do it, but Malachor uses the simplest method - static planes with animated textures:

Malachor_Lightning_01_TH.jpg     Malachor_Lightning_02_TH.jpg

You'd need to edit the skybox model for whatever module you want to add them to, create some planes with their normals facing inwards towards the player, enable some self-illum on the Trimesh modifier, and make them children of the A node (a dummy object that is a direct child of the OdysseyBase that has the same name with an additional "a" appended - this is required for animated objects to work).

Share this post


Link to post
Share on other sites
28 minutes ago, DarthParametric said:

There are a couple of ways you could do it, but Malachor uses the simplest method - static planes with animated textures:

Malachor_Lightning_01_TH.jpg     Malachor_Lightning_02_TH.jpg

You'd need to edit the skybox model for whatever module you want to add them to, create some planes with their normals facing inwards towards the player, enable some self-illum on the Trimesh modifier, and make them children of the A node (a dummy object that is a direct child of the OdysseyBase that has the same name with an additional "a" appended - this is required for animated objects to work).

Very interesting!

I'm guessing that this will need an additional tool besides MDLEdit to access the static planes?

 

My plan is to add the lightning effects to the Telos Surface modules 231TEL and 233TEL. Evidence suggests that at least 231TEL at one point had lightning effects in early game development with Telos lightning being shown in the old TSL E3 Demo footage, a few TSL dev screenshots and the 231TEL loading screen which shows a strip of lightning in the background. I assume Obsidian probably removed the Telos lightning related static planes from the model so it wouldn't be as easy as reactivating long lost planes.

 

Also, what is the name for skybox models? For 231TEL and 233TEL it appears that the following models exist:
 

Spoiler

231tela.mdl

231telb.mdl

231telc.mdl

231teld.mdl

231tele.mdl

231telea.mdl

231telf.mdl

231telsb.mdl

231telwe.mdl

233tele.mdl

233telea.mdl

233telf.mdl

233telg.mdl

233telsb.mdl

 

 

Share this post


Link to post
Share on other sites

TSL usually makes its skyboxes fairly obvious. In this case, "sb" is the identifier, although in other cases they use "sky".

As to tools, you could theoretically do it all in a text editor like Notepad++, but in practice that's not really going to work. You'll need to load up the whole module in either Max/GMax or Blender. You could just reuse the Malachor planes, since they are already UV mapped and ready to go. Then you'd just need to position them. I haven't looked at 233, but 231 already has an A node, 231telSBa, which the forcefield and the bird emitters are under.

Share this post


Link to post
Share on other sites

ChanceLightning in the .are file sets the frequency, but I don't know if the game requires specific meshes for it to take effect.

Share this post


Link to post
Share on other sites

I'd assume that would work the same way rain would, with VFX nodes (which is what I was expecting). Malachor just uses simple planes with a room animation dialling the mesh alpha up and down.

Share this post


Link to post
Share on other sites
49 minutes ago, InSidious said:

ChanceLightning in the .are file sets the frequency, but I don't know if the game requires specific meshes for it to take effect.

I'm pretty sure ChanceLightning simply adds Lightning sound effects to the module, that's how Dxun has thunder despite no visible thunder present in the sky. If I was to disable Lightning in, let's say, 901MAL.are then the result will be visible lightning with no sound effects to accompany the ambiance (Pretty sure the sounds aren't in-sync with the lightning effects).

 

19 minutes ago, DarthParametric said:

I'd assume that would work the same way rain would, with VFX nodes (which is what I was expecting). Malachor just uses simple planes with a room animation dialling the mesh alpha up and down.

I just downloaded Blender, though I tried to extract Malachor's skybox model files and I cannot find a Malachor model file ending with "sb". I searched through all but one of the model files only to not find the skybox, the last one I didn't search was named "901malb.mdl" and I cannot check it because it won't open in MDLEdit.

 

Instead I get an error message which says the following:

Quote

vector::_M_range_check:__ (which is 16) > = this -> size ()

(which is 1)

 

Share this post


Link to post
Share on other sites
14 minutes ago, N-DReW25 said:

I tried to extract Malachor's skybox model files and I cannot find a Malachor model file ending with "sb"

Yeah that was for the Telos skybox. As you might expect, the Malachor skybox model is the one you didn't check, MalB. Make sure you are using the most recent version of MDLEdit, available here.

Share this post


Link to post
Share on other sites

@DarthParametric I was finally able to get KotorBlender working for blender, I had to use 2.0.0 version instead of the 2.0.1 version as Blender wouldn't allow me to enable 2.0.1 due to some sort of error in the "__init__.py" file. In the program I am able to load up 231telsb.mdl.ascii and 901malb.mdl.ascii with ease, note the textures do not show.

 

901malb.mdl.ascii (With what appears to be the lightning planes in sight)

Spoiler

DP1..thumb.PNG.0af7e5c3345041dfc9acc69afa8b4ae4.PNG

 

231telsb.mdl.ascii (With what I suspect is the bird planes)

Spoiler

DP.thumb.png.0a026d1281d64d53666e4c96dd8bd763.png

Dp2.thumb.png.603c6ff06264518448b6547de493fb9a.png

 

From what you can tell, is this set-up correctly and from here how would I be able to copy the Lightning planes over to 231telsb?

Share this post


Link to post
Share on other sites
14 hours ago, N-DReW25 said:

I was finally able to get KotorBlender working for blender, I had to use 2.0.0 version instead of the 2.0.1 version as Blender wouldn't allow me to enable 2.0.1 due to some sort of error in the "__init__.py" file. In the program I am able to load up 231telsb.mdl.ascii and 901malb.mdl.ascii with ease, note the textures do not show.

I found an issue  with the way  the  2.1.0 version was packed. To fix this just replace the files in the 2.0.0 version with the 2.1.0.

Quote

From what you can tell, is this set-up correctly and from here how would I be able to copy the Lightning planes over to 231telsb?

You can copy-paste from one blender scene to another. Make sure to reapply the parent child relations.

Also, you can increase the view by pressing N then the view tab and decreasing clip start and adding a 0 to end.

Share this post


Link to post
Share on other sites
15 hours ago, N-DReW25 said:

note the textures do not show.

It could just be that you need to pan across to the texture paint window, though they will not show if they were not inside the folder from which you imported the ascii model.

I found the easiest way to do this for my own project where I sometimes need access to any old random model in either game was to create a folder for both games and then fill them up with the .mdl/.mdx/.wok/.lyt & the .tga textures. ( .lyt files incase I want to load an entire level )

In order to obtain every texture in .tga format I had to extract them all in .tpc format using KotOR Tool and then use Xoreos Tools to convert them all at once.

Otherwise you would have to manually locate and re-apply the textures every time.

Share this post


Link to post
Share on other sites
44 minutes ago, Thor110 said:

It could just be that you need to pan across to the texture paint window, though they will not show if they were not inside the folder from which you imported the ascii model.

I found the easiest way to do this for my own project where I sometimes need access to any old random model in either game was to create a folder for both games and then fill them up with the .mdl/.mdx/.wok/.lyt & the .tga textures. ( .lyt files incase I want to load an entire level )

In order to obtain every texture in .tga format I had to extract them all in .tpc format using KotOR Tool and then use Xoreos Tools to convert them all at once.

Otherwise you would have to manually locate and re-apply the textures every time.

Or in blender press Z and select material preview in the wheel.

  • Like 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.