Garik Loran Posted June 8, 2002 Share Posted June 8, 2002 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, 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 but it looks this way 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 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 More sharing options...
Subject452 Posted June 8, 2002 Share Posted June 8, 2002 can u post the things u have done? Link to comment Share on other sites More sharing options...
delquar Posted June 9, 2002 Share Posted June 9, 2002 i know if i am missing textures in the game, it can show that box default textutre, see if maybe you misstypes the texturename and make sure it can find it Link to comment Share on other sites More sharing options...
NightKlaw Posted June 9, 2002 Share Posted June 9, 2002 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 More sharing options...
delquar Posted June 9, 2002 Share Posted June 9, 2002 hey, if you get it fixed and working, could you send me the source files you changed? i would apreciate it. fullarb@hotmail.com -Winning: the art of not loosing- Link to comment Share on other sites More sharing options...
Garik Loran Posted June 9, 2002 Author Share Posted June 9, 2002 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 More sharing options...
Subject452 Posted June 9, 2002 Share Posted June 9, 2002 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 More sharing options...
Garik Loran Posted June 9, 2002 Author Share Posted June 9, 2002 Yes, and I think I did all this, but it doesn't work properly. If you could take a look at my code and see if you can find any missing lines... That would be nice. Link to comment Share on other sites More sharing options...
Subject452 Posted June 9, 2002 Share Posted June 9, 2002 Try placing the qhandle_t for the shader at the end of the struct and not in middle, see if that helps. Link to comment Share on other sites More sharing options...
Garik Loran Posted June 9, 2002 Author Share Posted June 9, 2002 Doesn't help, problem stays the same. BTW, what is the difference between the line in the middle or at the end? Link to comment Share on other sites More sharing options...
Subject452 Posted June 9, 2002 Share Posted June 9, 2002 When i was coding on the Q3 engine, placing new vars/handles whatever in the middle of a struct gave weird effects, but when u put them on the end of the struct everything worked just fine. Link to comment Share on other sites More sharing options...
ASk Posted June 9, 2002 Share Posted June 9, 2002 well dont change ANYTHING in q_shared.h else you will get a very unstable game (tried myself ) Link to comment Share on other sites More sharing options...
Garik Loran Posted June 9, 2002 Author Share Posted June 9, 2002 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 More sharing options...
Tchouky Posted June 9, 2002 Share Posted June 9, 2002 that s a shader problem .... i don't wich but i had this problem when my shaders were not corect .... Link to comment Share on other sites More sharing options...
Garik Loran Posted June 10, 2002 Author Share Posted June 10, 2002 What did you do to solve this and where do i have to look? Link to comment Share on other sites More sharing options...
Subject452 Posted June 10, 2002 Share Posted June 10, 2002 well dont change ANYTHING in q_shared.h else you will get a very unstable game (tried myself ) U can change **** in q_shared.h but not in q_shared.c, atleast it was like that in q3. Link to comment Share on other sites More sharing options...
Tchouky Posted June 10, 2002 Share Posted June 10, 2002 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 More sharing options...
NightKlaw Posted June 10, 2002 Share Posted June 10, 2002 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 More sharing options...
ASk Posted June 10, 2002 Share Posted June 10, 2002 U can change **** in q_shared.h but not in q_shared.c, atleast it was like that in q3. Well, at least not the playerstate_t struct..makes the game highly unstable Link to comment Share on other sites More sharing options...
Subject452 Posted June 10, 2002 Share Posted June 10, 2002 Well, at least not the playerstate_t struct..makes the game highly unstable Prediction errors ^-^ Link to comment Share on other sites More sharing options...
Garik Loran Posted June 10, 2002 Author Share Posted June 10, 2002 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. 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 More sharing options...
Royal Posted June 13, 2002 Share Posted June 13, 2002 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 More sharing options...
Garik Loran Posted June 13, 2002 Author Share Posted June 13, 2002 I'm working on it. It's not so easy, but I think it's possible. Link to comment Share on other sites More sharing options...
Royal Posted June 14, 2002 Share Posted June 14, 2002 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 More sharing options...
Garik Loran Posted June 15, 2002 Author Share Posted June 15, 2002 Thx, but I've already fixed that. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.