PDA

View Full Version : MBII saber blades


Master_Luke
05-31-2006, 07:27 AM
Hi All,

This has been posted before,but razorace has refused due to time restrains.I have found the MBII sabers in BaseJA clientx86.dll compiled for testing,all needed shaders and the code in text.It's described where and what to change.I've tried myself ,but i've downloaded the wrong OJP code and i messed it up.I ask you to include the sabers in OJP.Here's AJL's direct link to the Code if you are interested:http://alienjl.homestead.com/files/SFX_Sabers.zip

And by the way,AJL has released the code for developing purposes and you don's need permission.

ZerooftheFour
05-31-2006, 05:17 PM
so... this code makes the saber system like mb2? and what file do i need to replace or add this code to?

JRHockney*
05-31-2006, 05:47 PM
so... this code makes the saber system like mb2? and what file do i need to replace or add this code to?

No, I believe thou art thinking wishfully! LOL. I think this code makes the sabers appearance and trails like MB2. As for file or whatever, I think the location of where you put it is written in the readme at the top of each code and says whether to add or replace the code in this section.
Examples:

cgame\cg_local.h --> Added: (meaning add to cgame folder in cg_local.h file)
cgame\cg_main.c --> Added:
cgame\cg_players.c --> CG_DoSaber --> (replaced completely)
cgame\cg_players.c --> CG_AddSaberBlade --> (replaced everything after: CheckTrail) (find the CheckTrial line)

Of course this is just a wild guess based on what is said in the readme. I don't actually trust myself enough with C code yet to try it. If you get it working, any change of making a patch? I love the saber trail of MB2 especially and they would really help make the combat look cooler.

Btw, if Ensiform or even Razor responds differently, take their answer! LOL.

Vruki Salet
05-31-2006, 06:20 PM
Thanks for this Master_Luke.

razorace
05-31-2006, 09:48 PM
I think I had someone helping with this already. I can't remember who it is at the moment thou.

Master_Luke
06-02-2006, 08:38 AM
First of All,

Thank you for your replies.
Second,

To razorace:
From what I understand you already work on the blades,yes?

To ZerooftheFour:
Yes this is the code,but also to make this work you'll need the shaders in the
archive inside the zip.The code is the trails as JRHockney* suggested.MBII uses the same code written by AJL.

To Vruki Salet:
No Problem.

razorace
06-03-2006, 01:04 AM
Someone else was working on it for OJP. I'm not sure what the status on that is at the moment.

Maxstate
06-03-2006, 05:14 AM
Sorry for my ignorance, Im on a low time scheme here but this is just the trails right? not the sabers? Personally I think the MB ones looks like lead pipes and further in the game you' ll always starting using them like you would a baseball bat instead of an elegant weapon. Im trying to avoid this with my personal sabers, they have this beautiful glowy trail its and... oh sorry :p

Anyway, will the trails work with any sabers?

UDM
06-03-2006, 05:35 AM
IIRC AJL released those sabers long ago...but I don't think it was very popular with users back then. Something I just remembered 2 mins ago =p

maxstate: Anyway yes I believe the trails will work with sabers that don't have their shader files touched. Essentially, this probably just refers to

a) the original sabers
b) sabers with different hilts
c) changed textures

JRHockney*
06-03-2006, 05:50 AM
Sorry for my ignorance, Im on a low time scheme here but this is just the trails right? not the sabers? Personally I think the MB ones looks like lead pipes and further in the game you' ll always starting using them like you would a baseball bat instead of an elegant weapon. Im trying to avoid this with my personal sabers, they have this beautiful glowy trail its and... oh sorry :p

Anyway, will the trails work with any sabers?

I actually think the MB sabers are more movielike because of where the glow stops (at the tip). Honestly though, we can still make the sabers the way we want them to look if we edit the picture, even with MBs saber (which will give more potential for movielikeness because we cant change where the glow stops with our normal sabers).

Master_Luke
06-03-2006, 01:44 PM
Yes the code just does the trails.If you want you can change the shaders and the look of the sabers but its best to use this shader included in the zip.

I also want to ask if the code can work with Jedi Outcast?

Vruki Salet
06-25-2006, 05:20 PM
Does anyone know what I have to do to this code to make the trails a bit longer?

razorace
06-25-2006, 08:41 PM
Well, in the normal code you just increase the saberTrail->duration in CG_AddSaberBlade.

Vruki Salet
06-25-2006, 09:29 PM
That doesn't seem to work here.

razorace
06-26-2006, 12:52 AM
mmm, remember that you gotta compile the cgame side of things for it to work. I'm nto sure what else could cause a problem. :|

Vruki Salet
06-26-2006, 01:24 AM
Oh I mean the MB2 saber trail code works great, in fact imho it looks even better with my own saber version than in MB2 cause my sabers aren't so fat. It's just that I had an idea that the trails shouldn't *always* be so short. In my thinking the length of the trails should vary more according to the speed of the swing - a very fast swing should have most of it's arc followed by a trail. You know how it is, like waving a glowstick in the dark. If it's waved very slowly you see the stick and if it's waved quickly you see a sheet.

Of course the alpha of the saber trails should depend upon ambient light levels too. They should be bright and solid in the dark and dimmer and more translucent in brighter light...but that's opening up a whole nuther can of worms so I'll just worry about the length first.

The MB2 trails don't take into account the game's normal trail-length determiners.

JRHockney*
06-26-2006, 01:54 AM
Oh I mean the MB2 saber trail code works great, in fact imho it looks even better with my own saber version than in MB2 cause my sabers aren't so fat. It's just that I had an idea that the trails shouldn't *always* be so short. In my thinking the length of the trails should vary more according to the speed of the swing - a very fast swing should have most of it's arc followed by a trail. You know how it is, like waving a glowstick in the dark. If it's waved very slowly you see the stick and if it's waved quickly you see a sheet.

Of course the alpha of the saber trails should depend upon ambient light levels too. They should be bright and solid in the dark and dimmer and more translucent in brighter light...but that's opening up a whole nuther can of worms so I'll just worry about the length first.

The MB2 trails don't take into account the game's normal trail-length determiners.


So does this mean you got the sabertrails from MB2 to work in OJP?! If so, is there any way you can make a code patch or something that includes the MB2 saber trails available? I would personally love to see the MB2 trails in the next enhanced but I might be better if we just made a patch or something like that for people who want them.

UDM
06-26-2006, 02:20 AM
I'm not so sure about that. Are saber trails client only mods? If they are, then good, but if not, that could be a lot of trouble for servers who have the mods loaded, especially since many players, including myself, dislike downloading stuff through JKA

Vruki Salet
06-26-2006, 11:07 AM
They could easily go into ojpE since it already includes the client game dll and and a "stuff" assets pk3 too. I'm no good working with cvs and patches and stuff though - I'm a total diff retard.

I have put them into ojp Basic btw. I could put the changes into the Enhanced code and give a link to download the changed files here. There are only three changed source files. There's one problem though, and that's that it breaks the RGB sabers. Someone'll probably want to fix that before Razor will put it into the real product even if he wants it there at all. Me, I don't care cause I don't ever use RGB sabers anyway.

crail227
06-26-2006, 11:24 AM
ooo please post the download!

Vruki Salet
06-26-2006, 11:31 AM
you mean for ojp basic? Like I said, the RGB sabers are broken and until that gets fixed I don't think it's going to get put into any official release.

Vruki Salet
06-26-2006, 12:39 PM
OK here is something for you, get it while you can:

http://72.227.121.115/vruki/VrukiSaberEffectsCollection.pk3

If you put this in your ojp basic folder it will give you sabers that include the MB2 trails. I don't know if it will work online, or with baseJKA, or with your bloodtype, etc. etc. It might make your computer emit stinky gasses, or make you dead or something, caveat downloadtor, etc. etc.

Here's my readme:


This is a collection of saber effects I use plus a version of the OJP Basic cgame dll made with Movie Battle II style trails.

It does not include sounds since the sound mod I use at the moment is weird for my own testing purposes. (It includes some silent files.)

Some of these things I made, some are others' work that I modded, and some is straight from other people. I can't remember where it all came from and as such, this is NOT for distribution to the general public.

I have also included a few lightsaber hilts I use on my server. They are from Kensai's hilt pack, and the properties of some have been slightly altered.


So don't distribute this please.

UPDATE: I tested this with baseJKA and it works (hooray!) but it didn't work with the JAE mod they use on the Jedi Academy servers, which is strange since that shouldn't have its own client part but oh well.

UDM
06-26-2006, 12:58 PM
Hmm somehow they dont fit in with OJP's combat. The default trails made combat look smoother. The MB trails...well I think they only fit in with MB's theme...

On the sidenote, it screws up the ledge climbing animations too

Vruki Salet
06-26-2006, 01:10 PM
Really? Ledge climbing? That's weird - unless you're trying to use it with Enhanced? It's just for Basic. Is there even ledge climbing in Basic? That would explain it.

JRHockney*
06-26-2006, 01:19 PM
Really? Ledge climbing? That's weird - unless you're trying to use it with Enhanced? It's just for Basic. Is there even ledge climbing in Basic? That would explain it.

Oh so these dont work with enhanced? Thats what I was hoping for. You dont have ones for enhanced do you?

Vruki Salet
06-26-2006, 01:49 PM
Not right now I don't, except for apparently these ones sort of work judging from what UDM said. They just break the ledge stuff, as well as RGB sabers still and probably other client-side Enhanced stuff.

I've been having trouble updating my Enhanced source code lately.

crail227
07-16-2006, 01:03 AM
i tried the sabers with enhanced

i messes up some of the animations, specifically the attack fakes and some others
it also makes the dp bar disappear

Vruki Salet
07-16-2006, 03:46 AM
Did you actually edit them into the enhanced code and recompile the source? Or just stick the pk3 into your folder?

crail227
07-16-2006, 03:39 PM
i just stuck it into the folder

Vruki Salet
07-16-2006, 03:52 PM
That won't work. That zip file includes code that needs to be put into the game code and the thing recompiled.

Lathain Valtiel
07-16-2006, 06:35 PM
...Ewww.

I just tried these, and I have to say the advocates have very poor taste. The glow is thick as all hell.

Vruki Salet
07-16-2006, 07:39 PM
That's easily fixable. It looks nice thinner.

Lathain Valtiel
07-16-2006, 07:44 PM
Anyhow, I have located the issue pertaining to the black, white, and RGB Sabers.

In cgame/cgplayers.c, CG_DoSaber:

switch( color )
{
case SABER_RED:
glow = cgs.media.redSaberGlowShader;
break;
case SABER_ORANGE:
glow = cgs.media.orangeSaberGlowShader;
break;
case SABER_YELLOW:
glow = cgs.media.yellowSaberGlowShader;
break;
case SABER_GREEN:
glow = cgs.media.greenSaberGlowShader;
break;
case SABER_PURPLE:
glow = cgs.media.purpleSaberGlowShader;
break;
default:
glow = cgs.media.blueSaberGlowShader;
break;
}


and in CG_AddSaberBlade:

switch( scolor )
{
case SABER_RED:
VectorSet( rgb1, 255.0f, 0.0f, 0.0f );
break;
case SABER_ORANGE:
VectorSet( rgb1, 253.0f, 125.0f, 80.0f );
break;
case SABER_YELLOW:
VectorSet( rgb1, 250.0f, 250.0f, 160.0f );
break;
case SABER_GREEN:
VectorSet( rgb1, 100.0f, 240.0f, 100.0f );
break;
case SABER_PURPLE:
VectorSet( rgb1, 196.0f, 0.0f, 196.0f );
break;
default:
VectorSet( rgb1, 0.0f, 0.0f, 255.0f );
break;
}

The issue is that there is no case providing for the extra sabers. Add these and you're one step closer to making it work... except for readding all the other RGBSabers code you axed.

Vruki Salet
07-16-2006, 08:24 PM
So what do you think of this?

http://www.taddia.com/vruki/saberbladepics/glowshow.jpg

I know the tint of blue is off from the movies. I like it a little darker and less green than it "really" is supposed to be.

Lathain Valtiel
07-16-2006, 09:28 PM
I edited the SFX code changes in such a way that I believe that RGB Sabers will function properly with them... I'll post the txt file in a minute or so, though I likely made an amateur mistake somewhere.

I'd compile it myself and check, but Im not sure how to compile into an appropriate DLL.

Lathain Valtiel
07-16-2006, 10:21 PM
Here you go. See if it works.

http://www.seraphicradiance.net/BB/avaimages/SaberCode.txt

EDIT: Replaced the file with one that has actual text formatting (damn you Notepad), and have corrected a typo on an if.

razorace
07-16-2006, 10:43 PM
So, you edited the OJP files to make them work with the SFX sabers? I didn't know you could code. :)

Also, if everyone would like this in OJP, I'm going to need a better description of the changes so I can add them in. the easiest way would be to just send me the files with the changes applied to the OJP code.

Lathain Valtiel
07-16-2006, 10:46 PM
To be more accurate, I compared the latest cgame/cg_players.c file in Basic against the changes the SFX Sabers need you to make.

I do technically know some C, but to claim I can code would be something of a lie.

It's a very good thing we replaced the black blade of the black saber, or this code would NEVER work on black sabers as far as I can tell.

On that note, I replaced the text file above with a better one with a single critical error fixed.

razorace
07-16-2006, 10:56 PM
So, if I understand this correctly, this is a complete port of the SFX saber blade code into OJP in a way that would make it compatible with the current rgb saber system?

Lathain Valtiel
07-16-2006, 11:02 PM
I'm HOPING that's what it is, yes. I don't have the capacity to test it myself, which is why I'm asking somebody to compile it for me and see.

I wouldn't be stunned if I made an error somewhere.

Vruki Salet
07-16-2006, 11:41 PM
I had to declare "int cnum = cg.clientNum" and replaced "bnum" with just 0 (zero).
Varaible "i" from "for (i=0;i<3;i++)" needed declaration as an int and sbak needed declaration as a refEntity_t.

Then it compiled. Screenshots coming momentarily.

OK here:

http://www.taddia.com/vruki/saberbladepics/rgb_test_1.jpg
http://www.taddia.com/vruki/saberbladepics/rgb_test_2.jpg
http://www.taddia.com/vruki/saberbladepics/rgb_test_3.jpg
http://www.taddia.com/vruki/saberbladepics/rgb_test_4.jpg
http://www.taddia.com/vruki/saberbladepics/rgb_test_5.jpg
http://www.taddia.com/vruki/saberbladepics/rgb_test_6.jpg
http://www.taddia.com/vruki/saberbladepics/rgb_test_compare1.jpg
http://www.taddia.com/vruki/saberbladepics/rgb_test_compare2.jpg

The RGB look different from the last two pics, which are non-RGB for reference, because I have custom cores for regular sabers but didn't put those in for RGB cause I haven't usually used them.

Thanks for making this work Lath. Here's the dll I got:

http://www.taddia.com/vruki/cgamex86.dll

But I have to warn you it might have other changes since it's part of a work in progress and I can't remember atm what I've done to it in the past and kept. I think spawn shells and shields don't show up but I don't remember what else. If it matters to you let me know and I'll see what I can do to get it into an otherwise OJP basic cgamex86.dll.

Lathain Valtiel
07-16-2006, 11:45 PM
...That's odd, I declared sbak and variable i:

int i;
qhandle_t glow = 0;
refEntity_t saber, sbak;


EDIT: Oh lord I'm a dope. I forgot to edit the function call. Bah. I'll be shocked if it still works, but...

Bnum is the blade the game is supposed to draw. Since you're setting it to 0 I doubt you get a blade now.

Lathain Valtiel
07-17-2006, 12:16 AM
Hey Vruki, can you paste your int i declaration and sbak declaration? I want to see where I messed up. I also have to fix cnum and bnum...

Vruki Salet
07-17-2006, 12:17 AM
Bnum is the blade the game is supposed to draw. Since you're setting it to 0 I doubt you get a blade now.

Of course I've got a blade! See for yourself. Bnum wasn't referred to in that function anymore, just "0", and that's worked fine before. Now though you're right there is a problem and it's that when using RGB with duals the second saber takes the color of the first instead of it's own. Black, white and pimp work OK just pure RGB doesn't. I'll go fix it.

Lathain Valtiel
07-17-2006, 12:19 AM
No no no, I'll do it. Just show me what you did to fix int i and sbak please.

Vruki Salet
07-17-2006, 12:31 AM
Under where you put:

vec3_t rgb={1,1,1};

I just added:

int cnum = cg.clientNum;
int i;
refEntity_t sbak;

That's all.

OK I won't give you a bnum fix if you don't want it.

Lathain Valtiel
07-17-2006, 12:32 AM
Ahhh, you must've used my old file that was missing this stuff...

Anyhow, what animations are you using? Your cgame makes my animations bug out.

Lathain Valtiel
07-17-2006, 12:42 AM
I've uploaded a new text file at the same address as before. Reload the text to see the new one and prevent cache issues.

All that's changed are the calls to CG_DoSaber and the declarations. If I understand what's going on this should make duals work.

Vruki Salet
07-17-2006, 12:48 AM
Oops! I forgot animtable.h was in cgame. Yeah it's all wacky. I've been working on putting a new style in today (BOTH_A8_ etc). That must look funny.

WAIT A MINUTE!! I think you just led me to the bug that was making my thing not work! I just saw where I didn't properly finish editing animtable.h. I'm going to go test that. Thanks!

Lathain Valtiel
07-17-2006, 12:52 AM
Well, tell me when you make a new cgame with my fixes. I want to see if duals work successfully now.

Vruki Salet
07-17-2006, 01:02 AM
Unless I missed something in your new file you have half the solution to the duals. It takes one more step to make them work. (But they will work then.) I've got something to do for about half-an-hour then I'll be back.

But first here's a shot of duals

http://www.taddia.com/vruki/saberbladepics/rgb_duals.jpg

Lathain Valtiel
07-17-2006, 01:12 AM
...That's odd. The cores are colored ingame?

I don't think that's supposed to happen...

But besides there, what's the issue? They seem to be colored properly.

BTW, what I effectively did by fixing bnum was make this part of case SABER_RGB work properly:

if(bnum == 0)
VectorCopy(ci->rgb1, rgb);
else
VectorCopy(ci->rgb2, rgb);


Which, if I understand what I'm reading, means that the various values of the first RGB saber are used if bnum is 0, but otherwise the values for the second RGB blade are used instead. Could you tell me what's missing?

Vruki Salet
07-17-2006, 01:52 AM
I don't see that in code in SaberCode.txt no matter how many times I refresh it. It is in the old version of CG_DoSaber that this MBII code replaces. But no matter because what you're missing is that while you put bnum in the function definition "void CG_DoSaber( vec3_t blade_muz, ...-snip-... int bnum )," you also need to call DoSaber with bnum added in down in CG_AddSaberBlade.

Where it said:

CG_DoSaber( fx.mVerts[0].origin, fx.mVerts[1].origin, fx.mVerts[2].origin, fx.mVerts[3].origin, (client->saber[saberNum].blade[bladeNum].lengthMax), (client->saber[saberNum].blade[bladeNum].radius), scolor, renderfx, (qboolean)(client->saber[saberNum].numBlades < 3 && !(client->saber[saberNum].saberFlags2&SFL2_NO_DLIGHT)), (qboolean)(cg_saberTrail.integer > 0) );


you need to tack on an int that identifies which saber "bnum" is like this:

CG_DoSaber( fx.mVerts[0].origin, fx.mVerts[1].origin, fx.mVerts[2].origin, fx.mVerts[3].origin, (client->saber[saberNum].blade[bladeNum].lengthMax), (client->saber[saberNum].blade[bladeNum].radius), scolor, renderfx, (qboolean)(client->saber[saberNum].numBlades < 3 && !(client->saber[saberNum].saberFlags2&SFL2_NO_DLIGHT)), (qboolean)(cg_saberTrail.integer > 0), saberNum );


Actually bnum is a misnomer since really what they want is "snum" but oh well. Both bnum and snum are used in the code. Bnum should be for like the second blade of a staff instead for a second whole lightsaber.

I think the lack of good core in the RGB sabers is either because of neglect my poor RGB saber graphics files have suffered while I was making regular sabers look like I wanted; or else because the RGB stuff conflicts with and/or fails to use some graphics the MBII sabers use called SFX_Sabers/saber_blade.jpg, SFX_Sabers/saber_end.jpg and/or SFX_Sabers.shader.

Lathain Valtiel
07-17-2006, 02:03 AM
*Blinks, rechecks*

Huh. I was looking at the wrong function, namely CG_RGBForSaberColor. Regardless, it needs bnum filled out anyway, and gets it filled out by CG_DoSaber via bnum. So I wind up being right anyway.

As for bnum in CG_AddSaberBlade, it IS edited. Note:

CG_DoSaber( fx.mVerts[0].origin, fx.mVerts[1].origin, fx.mVerts[2].origin, fx.mVerts[3].origin, (client->saber[saberNum].blade[bladeNum].lengthMax), (client->saber[saberNum].blade[bladeNum].radius), scolor, renderfx, (qboolean)(client->saber[saberNum].numBlades < 3 && !(client->saber[saberNum].saberFlags2&SFL2_NO_DLIGHT)), (qboolean)(cg_saberTrail.integer > 0), cent->currentState.clientNum, saberNum );

Vruki Salet
07-17-2006, 02:39 AM
I didn't see that before. I must be too tired. Anyway then it's all set as long as int cnum is declared and == cg.clientNum in CG_AddSaberBlade. I had to do that but it might be already in what you've got and just be another thing I missed.

Then it works except my cores are still dim even though I tried to fix the graphics. I'm too tired to see what I have to do to fix them tonight. The trails work like MBII and I think the glow too though I forget what it looked like before. The black saber with MBII trails is totally bizarre.

Lathain Valtiel
07-17-2006, 02:42 AM
I already figured out what we need to do. We're missing the two identity shaders that produce the white core.

Lathain Valtiel
07-17-2006, 03:48 AM
...As for that declaration to cnum you mentioned... that's actually a bug in OJP Basic itself. Surprise.

For some reason the code declares cnum in the middle of the scolor switch's RGB Sabers cases, but forgets to do it in case SABER_RGB, which comes first, and therefore you get that error since it hadn't been declared then. I have no idea why this was done this way, so I added a note to declare cnum at the start of CG_AddSaberBlade.

Now then.

I believe I fixed every issue in this latest revision, which now comes in a zip since I had to add a .shader file. Do compile as soon as you can. Tell me of any compile errors, I'll eliminate them.

...God, this saber code is beyond bloated, I swear. The SFX Saber Code draws multiple sabers on top of each other, and to make it work with RGB I had to nearly double the number of sabers it draws. If anyone can find a way to optimize it that'd be great.

http://www.seraphicradiance.net/BB/avaimages/rgbsfxsabers.zip

Vruki Salet
07-17-2006, 10:13 AM
It works fine. Nice job, especially without being able to test it as you go.

Here're screenshots:

http://www.taddia.com/vruki/saberbladepics/rgb_fixedduals_2.jpg
http://www.taddia.com/vruki/saberbladepics/rgb_fixedduals_3.jpg
http://www.taddia.com/vruki/saberbladepics/rgb_fixedduals_4.jpg


update:

Here is what should be a plain OJP basic cgamex86.dll with the RGB MBII sabers:

http://www.taddia.com/vruki/cgamex86.dll

I haven't tested it yet though. If you do before I do let me know how it works. It should be fine - no more animation problems.

(ps. I fixed the links to the pics above) (pps and took out the old bad pic)

Lathain Valtiel
07-17-2006, 02:31 PM
The first fixed duals pic are the old duals with bad cores...

Anyhow, I discovered a mistake in the code. I forgot to remove an old shader for the Black Saber, which is causing its trail to render badly, a trail within a trail. Further, the trail is transparent due to... being transparent, which worked on the old weapon but not here. The zip has been updated with the new instructions, but the only differences are the removal of this code in CG_AddSaberBlade:


//
if(scolor == SABER_BLACK)
fx.mShader = cgs.media.blackSaberTrail;
//


If you can't find it, just search for blacksabertrail since I probably just mistyped the rest. You'll see what to remove.

And the second difference is in the scolor switch in CG_AddSaberBlade, the SABER_BLACK entry turns into:


case SABER_BLACK:
VectorSet( rgb1, 255.0f, 255.0f, 255.0f );
break;


Let me know if you get a chance to recompile. Thanks for the help.

Vruki Salet
07-17-2006, 02:56 PM
Here's a newly baked one with those changes:

http://www.taddia.com/vruki/cgamex86.dll

Lathain Valtiel
07-17-2006, 03:45 PM
And with that, here's a zip with a PK3 for it without Vruki's extra stuff.

http://www.seraphicradiance.net/BB/avaimages/zRGBSFXSabers.zip

Vruki Salet
07-17-2006, 04:07 PM
Since none of that is mine except that I copied in the MBII and RGB code and compiled it, will you please remove the readme?

Lathain Valtiel
07-17-2006, 04:25 PM
Ah, sorry. Done.

JRHockney*
07-17-2006, 07:34 PM
Would either of you guys mind making a pk3 of this for enhanced? No matter what do, I cant get anything to compile on Enhanced with VC Express. I have no idea how to set the include stuff to the platform or what ever sushi said to do. Unless you guys can give me step by step instructions, I would really appreciate a workable version on MB2 sabers for Enhanced to be able to be used by non-computer/code savy forum goers.

Vruki Salet
07-17-2006, 07:48 PM
Let me see if I can get an update of the enhanced code. I was having CVS troubles with it before.

---------

OK it updated but I can't do it til later. Check now and again and I'll try to do it tonight.

JRHockney*
07-18-2006, 12:00 AM
Let me see if I can get an update of the enhanced code. I was having CVS troubles with it before.

---------

OK it updated but I can't do it til later. Check now and again and I'll try to do it tonight.

Oops, I forgot I'm a moderator now. I edited your post rather than replaying LOL. I'll say it again here: Thanks.

Lathain Valtiel
07-18-2006, 12:04 AM
It may not work properly if Razor edited either CG_DoSaber or CG_AddSaberBlade.

razorace
07-18-2006, 03:34 AM
The OJP Basic and Enhanced saber blade rendering should be very similar if not identical. (That's why I use a diff program to check this stuff.)

Vruki Salet
07-18-2006, 06:08 AM
OK here you go for enhanced:

http://www.taddia.com/vruki/zzz-MB2_style_trails_for_OJP_Enhanced_f.pk3

It works.

screen:

http://www.taddia.com/vruki/saberbladepics/ojpE_MBII_blades.jpg

Whatever you want to name this pk3 file, it has to come alphabetically after your OJPE dlls pks loads because it replaces the default cgame dll. Also this pk3 contains no colors so it won't override whatever saber color mods you have, if any.

UDM
07-18-2006, 08:04 AM
That's beautiful. Thanks so much Vruki and Lathain

Vruki Salet
07-18-2006, 10:26 AM
You're welcome but it's really the work of those guys who coded it first.

One issue with Enhanced and these yo should be aware of is that those special long trails of the "fakes" are gone so it's harder to tell if there's one going on. I have my own interest in adjusting the length of these trails so I'll look into the issue but I haven't any success doing it so far.

JRHockney*
07-18-2006, 10:52 AM
You're welcome but it's really the work of those guys who coded it first.

One issue with Enhanced and these yo should be aware of is that those special long trails of the "fakes" are gone so it's harder to tell if there's one going on. I have my own interest in adjusting the length of these trails so I'll look into the issue but I haven't any success doing it so far.

Cool, let us know if you have any success. Thanks for doing this, you've done us Enhanced players a good service.

razorace
07-18-2006, 03:07 PM
Why can't you just use the Enhanced code for changing the saber trail lengths?

Vruki Salet
07-18-2006, 06:31 PM
What do you mean?

Lathain Valtiel
07-18-2006, 07:52 PM
Huh? If the special trails vanish after SFX is applied, it seems to me that Razor edited CG_AddSaberBlade's CheckTrail portion for Enhanced.

EDIT: And he did. Forget about this Razor?

//
if(cent->currentState.userInt3 & (1 << FLAG_ATTACKFAKE))
{//attack faking, have a longer saber trail
saberTrail->duration *= 2;
}

if( cent->currentState.userInt3 & (1 << FLAG_FATIGUED) )
{//fatigued players have slightly shorter saber trails since they're moving slower.
saberTrail->duration *= .5;
}
//


The thing is, SFX totally IGNORES saberTrail->duration. It just sets it to 0 and leaves it.

To fix it, you'll have to edit this part of SFX:

fx.mShader = cgs.media.SaberTrailShader;
fx.mKillTime = 0;


The thing is, SFX's default trails are EXPLICITLY set short. You can't go lower than zero to display fatigue, so your only choice is to mod SFX a bit and make its default fx.mKillTime 1.

fx.mShader = cgs.media.SaberTrailShader;
fx.mKillTime = 1;
//
if(cent->currentState.userInt3 & (1 << FLAG_ATTACKFAKE))
{//attack faking, have a longer saber trail
fx.mKillTime *= 2;
}

if( cent->currentState.userInt3 & (1 << FLAG_FATIGUED) )
{//fatigued players have slightly shorter saber trails since they're moving slower.
fx.mKillTime *= .5;
}
//

Vruki Salet
07-18-2006, 09:21 PM
If this works it'll be dreamy. I'm way too tired to do it now but if I perk up after coffee I'll try it out or else tomorrow.

Lathain Valtiel
07-18-2006, 09:45 PM
I'm just hoping fx.mKillTime can accept floats.

JRHockney*
07-19-2006, 12:43 AM
I just changed the tip of the MB2 saber to be a point rather than rounded off. It now looks amazingly like episode 3 sabers because bright part of the glow does no really pass the point. If any body wants a copy of it, P.M. me or IM me.

Lathain Valtiel
07-19-2006, 12:45 AM
A point? I'm sold.

...You don't have an IM listed.

JRHockney*
07-19-2006, 12:49 AM
PM me and I'll send you my AIM or MSN IM. I'll do a file transfer from there.

crail227
07-19-2006, 12:57 AM
you cant just post it here?

Lathain Valtiel
07-19-2006, 12:58 AM
He might not have webspace.

JRHockney*
07-19-2006, 01:37 AM
He might not have webspace.

Yep, I don't. I still haven't havent joined enough of this century to even have a webcam. LOL! :p

Vruki Salet
07-19-2006, 09:48 AM
Can we have a screenshot from someone? Also send it to me and I'll put it on my server and make a link here.

UDM
07-19-2006, 10:09 AM
PM me your email and I'll send it to you

I'm going ingame to take screenies now

UDM
07-19-2006, 10:20 AM
http://img157.imageshack.us/img157/1381/shot0103xu2.jpg
http://img125.imageshack.us/img125/5033/shot0102sx3.jpg
http://img147.imageshack.us/img147/9764/shot0101il7.jpg

Btw is there any way to make the new saber trails not conflict with swords? When using the trails, they cause the saber blades to show up in sword models

razorace
07-19-2006, 10:26 AM
Huh? If the special trails vanish after SFX is applied, it seems to me that Razor edited CG_AddSaberBlade's CheckTrail portion for Enhanced.

EDIT: And he did. Forget about this Razor?
That was what I was referring to. :)

I'm confused about why sabertrail->duration isn't used anymore. Do I understand this correctly that fx.mKillTime is referring to the actual saber blade textures? Is a trail generated at all then?

Btw is there any way to make the new saber trails not conflict with swords? When using the trails, they cause the saber blades to show up in sword models
I'm sure it's possible, we'll just have to figure out how to adapt the code.

Vruki Salet
07-19-2006, 10:59 AM
Btw is there any way to make the new saber trails not conflict with swords? When using the trails, they cause the saber blades to show up in sword models

Blah! I saw that and wanted to fix it but I didn't see a problem in the code for it so I thought it must be that my sword's .sab file was just bad.

Fixing that should be a priority for these.

Vruki Salet
07-19-2006, 12:09 PM
fx.mKillTime takes an integer, but that could be dealt with. The problem is that it doesn't make enough of a difference in the trails until it gets to be at least 15 or so, and then it starts to look funny. It repeats wedge-shaped trail peices with gaps in between.

JRHockney*
07-19-2006, 04:39 PM
fx.mKillTime takes an integer, but that could be dealt with. The problem is that it doesn't make enough of a difference in the trails until it gets to be at least 15 or so, and then it starts to look funny. It repeats wedge-shaped trail peices with gaps in between.

arrgh I did it again!! I have to remember theres an edit button there now! LOL

Anyways, one way to help make the gaps look smoother is if you make the glow trail a little bit longer (not the core trial) it files those gaps with what ever color the saber is. I'm not sure if it can be done with code, but I've done it by editing the glow trial picture before. The fact that the trials are code based makes a bit uncertain as to if it can be done with this code or not.

Vruki Salet
07-19-2006, 05:02 PM
I don't know how to do that yet. Lathain might.

Lathain Valtiel
07-19-2006, 08:25 PM
That was what I was referring to. :)

I'm confused about why sabertrail->duration isn't used anymore. Do I understand this correctly that fx.mKillTime is referring to the actual saber blade textures? Is a trail generated at all then?


I'm sure it's possible, we'll just have to figure out how to adapt the code.

What the game normally does is take sabertrail->duration, do some math on it, put that in trailDur, then apply that value to fx.mKillTime, which is the value that actually matters. It basically determines how long the trail is.

The SFX Code simply sets sabertrail->duration to 0 and never mentions it again. It's totally ignored.

---

The SFX Code does not allow the use of sword trails. the trailStyle cvar is ignored, just like sabertrail->duration.

Lathain Valtiel
07-19-2006, 08:58 PM
.zip updated. Sword trails now appear and the trailStyle cvar is obeyed, though I make no guarantees to it looking right. They're still short though.

http://www.seraphicradiance.net/BB/avaimages/rgbsfxsabers.zip

Grey Raven
09-05-2006, 10:54 AM
That was what I was referring to. :)

I'm confused about why sabertrail->duration isn't used anymore. Do I understand this correctly that fx.mKillTime is referring to the actual saber blade textures? Is a trail generated at all then?


I'm sure it's possible, we'll just have to figure out how to adapt the code.

Sorry that I haven't posted in a while. Been busy.
Anyway, I was the first to ask for this. Razor, I sent you a PM with the code changes in Enhanced, but you kinda blew me off.

As for the quote, saberTrail->duration and fx.mKillTime don't work with the SFX sabers because SFX uses the previous position of the blade to calculate the trail. If you want to change the length of the trail, you have to do a little vector math on the positions.

razorace
09-05-2006, 04:53 PM
It wasn't my intention to blow you off. For some reason the PM has disappeared and I thought I had replied asking for the actual modified code. Adding code based on line numbers/files is a pain in the ass for large changes.

Anyway, I'm sorry about that. Maybe you could get in contact with Lath and Vruki and get that code smoothed out?