Jump to content

Home

Add a new saber - some problems


Garik Loran

Recommended Posts

I am trying to add a 7th saber to the game, a white one. I know, there is Tchouky's mod, that lets you choose all colors, but I noticed that the intensity od the saber is also altered with his mod and that some people use it to make the saber nearly invisible by setting RGB to 111.

So I wanted to just add a white saber.

I looked through the code, found the entries and added the necessary entries.

Now 2 problems have occured.

1. I see the new saber in the main menu selection and it looks normal,

snap004.jpg

but the ingame player menu shows some weird colors, the white blade is darkblue and when mouseover it's cyan. The handly should not be effected, but it also changes the color.

It should look like

saber.jpg

but it looks this way

snap001.jpg

snap002.jpg

 

2. The next problem is the blade itself. I really don't know what I have forgotten to change, there are the sprites and shaders, but the blade looks like that

shot0012.jpg

I think the transparency doesn't work, so there must be a setting missing.

Any ideas???

I am writing a tutorial on this, but first I have to know how it works. So please help. Thank you.

Link to comment
Share on other sites

  • Replies 57
  • Created
  • Last Reply

It looks to me like the only problems you're having with your menu graphics are due to a transprarency problem. You might want to check the alpha channel mask on your images, or try eliminating some of the grays, as black usually is interpreted as transparent in most of the game's images.

 

As for your blade problem, it looks like you're missing the colored glow file or shader for it. Look at the (color)_glow2.jpg files in assests0.pk3 in gfx\effects\sabers for the file I'm talking about. Your code probably either hasn't established a shader which is applying that texture to it (doubtful, since the boxes are appearing) or the texture itself is invalid/missing.

Link to comment
Share on other sites

Thanx for your help.

Ok, I checked some things: The tga and jpg sprites ans textures are fine, I renamed them from white_ to blue_ and everything worked. So it must be in the code, some shader or something. Maybe just the white_glow is missing, because the file for the saber is called white_glow2.

But that's just a theory.

If you like to help me you can see what I have changed and added

in this file

Search the files for "purple" and in all the found places I added the same lines just for "white".

Link to comment
Share on other sites

for your new sabercolor 2 work u need to define a line and a glow for the saber, thus u need one shader for the line and one for the glow, u also need a glow and a line pic and they should be placed in effects/sabers, offcourse this all clientside other then q_shared.h.

Link to comment
Share on other sites

Ok, I am coming to the conclusion the code is correct, I can't find any errors. So maybe I just forgot something.

I've added tga instead of jpg sprites, and the black boxes are gone, so it seems the alpha map is missing in the jpg, or the code that says that all black is transparent.

And there is another problem. The saberblade is always on top, it is always shown, even if the playermodel is infront of the blade.

The blade is at the right place, but it doesn't interact with other objects.

Any ideas?

Link to comment
Share on other sites

Originally posted by Garik Loran

What did you do to solve this and where do i have to look?

 

well there was simply a mistake in the shader code in the saber.shader so..

it wasn't a big deal !

 

the problem is that your's seems ok !

Link to comment
Share on other sites

Well, I've just looked at the files you included, and the problem with your shader (the boxes at least) seem to be the fact that in the shader you are calling white_glow2.TGA and white_line.TGA while the actual images you have are white_glow2.JPG and white_line.JPG. Just change the .tga in the shader and it should fix that, gonna go test it out now to be sure, though. Another problem is that your shader folder is named shader, singular, rather than shaders, plural, as it is in the original assests files.

 

After looking at your menu shaders, I'm almost certain that your image problems aren't actually in the image, but in the blendFunc mode you're using in your shader. The one used for the normal sabers works fine for them, because they have no shades of black/grey, but the blend mode they use interperets black as transparent, and greys as semi-transparent. I don't recall right off my head, but if you can find an old thread in the skinning forum about trying to edit one of the sabers to be a black saber, you can find out more about the blend mode you should use for black/grey imagery.

 

EDIT:

 

Well, I did some testing, I didn't actually compile your code, I merely stuck the white shader code (with fixed file extensions, and shaders folder name) in the purple_line and purple_glow shaders, and everything worked just fine. Beyond that, I can't help you much, since I have no way of compiling the code to check it out.

Link to comment
Share on other sites

Originally posted by NightKlaw

Another problem is that your shader folder is named shader, singular, rather than shaders, plural, as it is in the original assests files.

OH MY GOD!!! I am sooooo dumb! THANX SO MUCH. That was the problem. And I would never have found this. headbanger.gif

So all the other things were ok, what means now I can add saber colors.

I'll write a short description later.

Link to comment
Share on other sites

Do you think when your done you could modify the code so you could just add sabers by useing the names like with skins like shadow_default and shadow_royal_default so you could do a blue_line blue_shadow_line then just write a shader file for it.

 

 

-Royal

Link to comment
Share on other sites

Cool hope it works. If you want i have a whole new saber set and shader file I made that you can use to test it when your ready.

 

-Royal

 

*EDIT*

I think i know why you get the boxes around your saber. first open the glow file in photoshop (if your useing that) and make sure your color is 0 for red blue and green only that color is rendered transparent when i first made my saber blades i messed up with it and got the boxes. If you would like to see the sabers i made and maybe add them to your mod email me at soutmezguine@juno.com

 

-Royal

 

*EDIT*

I tried renaming your files to replace the blue saber and they worked. so it must be a coding problem.

-Royal

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.


×
×
  • Create New...