PDA

View Full Version : Add a new saber - some problems


Garik Loran
06-08-2002, 12:10 PM
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,
http://home.t-online.de/home/0236859584/SWJK2/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
http://msprites.iongames.org/darkhold/saber.jpg
but it looks this way
http://home.t-online.de/home/0236859584/SWJK2/snap001.jpg
http://home.t-online.de/home/0236859584/SWJK2/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
http://home.t-online.de/home/0236859584/SWJK2/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.

Subject452
06-08-2002, 03:11 PM
can u post the things u have done?

delquar
06-08-2002, 10:24 PM
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

NightKlaw
06-09-2002, 02:45 AM
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.

delquar
06-09-2002, 06:41 AM
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-

Garik Loran
06-09-2002, 09:06 AM
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 (http://www.uwg-oer-erkenschwick.de/SWJK2/addsaber.zip)
Search the files for "purple" and in all the found places I added the same lines just for "white".

Subject452
06-09-2002, 11:17 AM
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.

Garik Loran
06-09-2002, 11:57 AM
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.

Subject452
06-09-2002, 12:10 PM
Try placing the qhandle_t for the shader at the end of the struct and not in middle, see if that helps.

Garik Loran
06-09-2002, 12:51 PM
Doesn't help, problem stays the same. BTW, what is the difference between the line in the middle or at the end?

Subject452
06-09-2002, 02:34 PM
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.

ASk
06-09-2002, 04:23 PM
well
dont change ANYTHING in q_shared.h
else you will get a very unstable game (tried myself :P)

Garik Loran
06-09-2002, 06:54 PM
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?

Tchouky
06-09-2002, 07:27 PM
that s a shader problem ....
i don't wich but i had this problem when my shaders were not corect ....

Garik Loran
06-09-2002, 08:33 PM
What did you do to solve this and where do i have to look?

Subject452
06-09-2002, 08:37 PM
well
dont change ANYTHING in q_shared.h
else you will get a very unstable game (tried myself :P)

U can change **** in q_shared.h but not in q_shared.c, atleast it was like that in q3.

Tchouky
06-09-2002, 08:52 PM
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 !

NightKlaw
06-10-2002, 03:20 AM
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.

ASk
06-10-2002, 03:28 AM
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

Subject452
06-10-2002, 07:32 AM
Well, at least not the playerstate_t struct..makes the game highly unstable

Prediction errors ^-^

Garik Loran
06-10-2002, 08:46 AM
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. http://spidermantc.fragoff.net/forum/images/smilies/headbanger.gif
So all the other things were ok, what means now I can add saber colors.
I'll write a short description later.

Royal
06-13-2002, 04:47 AM
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

Garik Loran
06-13-2002, 10:56 AM
I'm working on it. It's not so easy, but I think it's possible.

Royal
06-14-2002, 03:29 AM
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

Garik Loran
06-15-2002, 11:37 AM
Thx, but I've already fixed that.

Master Burner
06-17-2002, 06:41 AM
gaaaah can't get it to work :-\ looked in all the code folders and set my color in as all the other :( do i need to compile the code files?? and if how do i do it?


newbie needs help :'(

Garik Loran
06-17-2002, 08:52 AM
Read the readme from the JK2tools_v2, it contains all the information you need to know about compiling the code. You HAVE to compile it.

Master Burner
06-18-2002, 06:42 AM
must be blind or something but i couldn't find the readme you where talking about... if it was in the tools packed which you linked for in the modelling section that is...

Garik Loran
06-18-2002, 07:44 AM
When you've installed the tools there is a file
JK II Jedi Outcast\GameData\code\MakeAMod_readme.txt, that's the one you need.

Master Burner
06-18-2002, 08:18 AM
aaah Okay :) thx will look it through tomorrow(its kinda late and i'm tired) :) then hopefully I can get it to work ;)

TIE
06-18-2002, 12:35 PM
Quick question (as I'm in a hurry)
I've added a new colour on top of white (so...what's that, an 8th colour I think?) but I can't select it in the menu...I don't remember changing anything regarding the number of saber colours or anything, so that could be a problem, I just did as you said and searched for "purple," and added my colour below your white in each instance.

Anyway, everything else works fine, I used color1 7 to make sure of that, but would you (Garik, or anyone else who knows, I guess) mind posting a tiny little walkthrough on making the saber colour selectable in the menu(s)?

I'd appreciate it very much....!

Thanks,
-TIE

TIE
06-18-2002, 04:22 PM
Nevermind...I figured it out.

Thanks for pausing a moment to think about my problem before you read this, though. :)

-TIE

Royal
06-18-2002, 04:48 PM
I just added about 12 sabers to the code and am about to get a compiler so my simple and dumb question is how do i compile it ?

-Royal

Garik Loran
06-18-2002, 05:55 PM
@ Royal
Read the MakeAMod_readme.txt, it descripes the way of compiling.
@ TIE
Becuase you have figured it out you know that there is a variable that has to be changed and the ui.shader has to be edited.

I will post more on this if another one has this problem as well.

Master Burner
06-18-2002, 09:41 PM
baaah i give up :( can't i send you my files then you can compile it??

can't get it to work :(

AstroMat1
06-19-2002, 04:29 AM
Hey Garik, where can I find the JK2tools_v2? Is that the same as the SDK?

Thanks for the help. I hope to start adding saber colors soon.

Master Burner
06-19-2002, 06:19 AM
yeah its the same as the SDK...
when you install the tools you install the SDK too...

Aegis Runestone
06-19-2002, 07:57 AM
Just how DO you add these sabers?

Harukaze
06-19-2002, 12:09 PM
Forgive me for sounding the newbie, but this is just MP correct? Color1, as I recall, was an MP command. Is there any way to get this into SP? I would like to introduce a plethora of new sabercolors into SP [ice blue, obviously, as well as Corran's silver and a few others seen in the EU].

If anyone can help with that, I'd greatly appreciate it!
~ Michael

Royal
06-19-2002, 03:15 PM
Garik can i send you my source code ? I'm downloading the compiler right now but it is going slow as hell. Do you think you might be able to compile it for me ? it includes all my sabers plus it uses the one u made.


-Royal

Master Burner
06-19-2002, 07:23 PM
Originally posted by Harukaze
Forgive me for sounding the newbie, but this is just MP correct? Color1, as I recall, was an MP command. Is there any way to get this into SP? I would like to introduce a plethora of new sabercolors into SP [ice blue, obviously, as well as Corran's silver and a few others seen in the EU].

If anyone can help with that, I'd greatly appreciate it!
~ Michael


i think you have to name the image files as the blue saber.. then it should replace it... well if you can do it with the model then why shouldn't you could do it with the saber color?!

Garik Loran
06-19-2002, 09:32 PM
Originally posted by Master Burner

i think you have to name the image files as the blue saber.. then it should replace it... well if you can do it with the model then why shouldn't you could do it with the saber color?!
The problem is that you can only replace the sprite. No adding new ones in SP. And when you replace an old saber the trail color is still the original, because that's hardcoded.

Master Burner
06-20-2002, 04:53 AM
btw Garik could it get you to compile my saber color??? can't get it to work proberly myself :( :(

Arkule
06-20-2002, 05:06 AM
I'd just like to say that i managed to get a new lightsaber color to completely work in mp. It is even selectable in the menu thingy with the other ones. So, if any of you are still having problems with your coding of it, or strange looking errors, i might be able to help.

Master Burner
06-20-2002, 05:09 AM
well if you would look at "my" source code... then i would be happy and if you could get it to work i would be even more happy :D

right now you can download it here (http://www.daktanion.dk/downloads/greenblue.zip)

i think it is the compiling stuff that is something wrong with.. but i could easily be wrong....

Arkule
06-20-2002, 06:15 AM
In that zip file, you only have some of the source code. Very very little of it. You need the whole workspace. You don't compile files individually, you do it a project at a time.

Besides that, after a quick glance throguh what you did supply, it looks like it would probably work if when in game you brought down the console and typed color1 6.

you're greenblue_line.jpg and greenblue_glow2.jpg i think should be .tga files (at least thats how i have them and they work fine). You can't just change the file type, because that gives an error when you try to start the game. You have to save them as the .tga file from inside photoshop.

There are probably other things wrong with it right now, but i didn't look too closely.

Master Burner
06-20-2002, 06:25 AM
okay try to change them into tga files and then place them in my SDK and recompile it...

Arkule
06-20-2002, 06:30 AM
First , i don't have your sdk to put it in, just a couple source and header files.
Second, do you have any programming experience? If not it might be better just to find something thats already made which you could use. jediknightii.net has many many files, something probably does close to what you want.

Master Burner
06-20-2002, 06:41 AM
nope didn't work :-\
and I did put it in the entire SDK togethor before i compiled... no luck :(

could i get you to compile it for me?? and get it to work? since it seems its my ******* compiler thats the problem...




EDIT:
erh ops forgot the "I" in that sentence before...
but anyway I have some JAVA programming knowledge but not much... and the SDK don't you have that one from the JK2Tools2.exe file?? thats where i got mine from....

Arkule
06-20-2002, 08:08 AM
What compiler do you have? I would recomend Microsoft Visual C++ 6.0, because everything else sucks. If you that, open the jk2mp-sdk.dsw file, and compile all three projects, switch between projects from the projects.set active project menu. compile by going to build.rebuild all once compiled you need to go to the source folders and run game.bat, cgame.bat and ui.bat (for the different projects). Those will make .qvm files in the code/base/vm directory. Then you must make a .pk3 file, and put the vm directorty (with the 3 .qvm files) into a folder in the gamedata folder. then when you start the game, goto setup and then mods, and it should display the name of the folder with the .pk3 file in it (unless you screwed up).

Komodo
06-25-2002, 08:17 AM
Originally posted by Arkule
I'd just like to say that i managed to get a new lightsaber color to completely work in mp. It is even selectable in the menu thingy with the other ones. So, if any of you are still having problems with your coding of it, or strange looking errors, i might be able to help.

I've managed to get a new saber working (compiled the source and whatnot), its selectable by typing in color1 7. Only problem is it won't showup on the Player menu. I think that its because I need to change the NUM_SABER_COLORS variable but haven't been able to find it in any of the files... If you have any idea as to whats wrong I'd be very grateful.

Arkule
06-25-2002, 11:25 PM
The problem on why it won't show up in the player menu has to do with the way raven coded the saber cycling code part. They make it only cylce through a certain number then start over. The code segment is in ai_main.c i think. There are two loops, one that counts up to five, the other counts down from five. replace the five in both of these with NUM_SABER_COLORS - 1. That will make it so that whenever you add a new saber, it will automatically be selectable (as long as you specify a graphic for it, i think thats also in ai_main, its the same place where all the other saber graphics and force stars are loaded).

Komodo
06-26-2002, 04:03 AM
Hmm, are you sure the code segment is in ai_main.c, because I wasn't able to find it in there (and it seemed to only be about bots with nothing related to sabers). Do you mean ui_main.c?

Arkule
06-26-2002, 06:08 AM
i meant ui_main. sorry about that. Its the one in the UI project.

Komodo
06-29-2002, 04:23 AM
I managed to get it working properly. Thanks for all your help Arkule.

genthar
07-01-2002, 03:41 AM
Is there a downloadable mod on the way from you folks, with new saber colours. Teal, Pink, Brown etc.?

Master Burner
07-02-2002, 10:14 AM
Originally posted by Arkule
What compiler do you have? I would recomend Microsoft Visual C++ 6.0, because everything else sucks. If you that, open the jk2mp-sdk.dsw file, and compile all three projects, switch between projects from the projects.set active project menu. compile by going to build.rebuild all once compiled you need to go to the source folders and run game.bat, cgame.bat and ui.bat (for the different projects). Those will make .qvm files in the code/base/vm directory. Then you must make a .pk3 file, and put the vm directorty (with the 3 .qvm files) into a folder in the gamedata folder. then when you start the game, goto setup and then mods, and it should display the name of the folder with the .pk3 file in it (unless you screwed up).


baaah :(
i have the same :-\
i got the folder to show up in the Setup/Mod but what then?? there dosn't happend ANYTHING at all when i'm trying to load the mod....

>-[The]-< *AsC*
07-08-2002, 05:12 PM
Hey for make a cool name in the mod menu, create a txt file called DESCRIPTION. Take it in the base folder of ur mod .

Exemple you want to call ur mod Ultimate Mod Made by Me you need to write ^3Ultimate mod made by me .