Simple lightsaber in the game

Got a simple lightsaber in the game.

got a simple lightsaber in the game

I think this addition will help sell the map and experience more.

The process of replacing a melee weapon in Source was at first not an easy task. But first step is to just try to get through the process with nothing fancy. So I followed this tutorial by Slpinks on Steam. There was a few slow spots here and there even with the step by step guide. I got stuck at the part with texturing. Luckily there was a video link as well, which I found where my mistake was.

My mistake was that there was a material in Blender, which had a different name from my vtf (Source engine material). The true cause of the problem was that I didn’t create the material on the Hawkgirl Mace and I didn’t even know it existed. So I was calling a material that didn’t exist. But I knew that it had something to do with not linking up the texture to the model correctly, and after digging around, I did find the problem and fixed it.

After I took the Hawkgirl Mace through the process, I started to get familiar with the pipeline workflow and decided to try to get a 100% custom (my own) model into the game. Enter the almighty lightsaber!

The hardest part was getting the lightsaber to glow. I wanted to use the “glow effect” built into source, the one you see when you hover your hand over an item in the game, but I couldn’t figure out how to access the shader. Instead I eventually just duplicated the inner white blade and scaled it up. I then added a new material to that called “blade_color”. In the vmt file for “blade_color.vtf”, I made it transparent so that you can see through it to see the inner core white blade.

Code from “blade_color.vmt” :

“$basetexture” “models/weapons/melee/Blade_Color”
“$translucent” 1

This is the basic implementation of the lightsaber. For the final product, I’m going to look into additive blending and using multiple intersecting planes, like how old school trees where done in some game engines. I hear this is how the lightsabers were made in the Jedi Knight II: Jedi Outcast and Academy series.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s