Jump to content

Saber rain fizz/boil effect


Guest Redemption
Go to solution Solved by Guest Redemption,

Recommended Posts

Guest Redemption
Posted

Hello, I have looked for it in the code but can't find it, can anyone help? Its for understanding how to call it for saber lightning block in Outcast...The way it is done for Academy doesn't work in Outcast BTW.

Guest Redemption
Posted

No worries, found it in wp_saber.cpp.

Guest Redemption
Posted

Hello, I need help with making an effect play when lightning hits a lightsaber. What got me started implementing this was following @@Serenity937 code and then going with what @@Dusty did. Problem is that Outcast's code differs from Academy's slightly, so I had a look at the rain "saber/fizz" code and I tried this:

qboolean blockedWithSaber = qfalse;
	int saberContents = gi.pointcontents( ent->client->renderInfo.muzzlePoint, ent->client->ps.saberEntityNum );
	if ( (saberContents&CONTENTS_WATER)||
		(saberContents&CONTENTS_SLIME)||
		(saberContents&CONTENTS_LAVA) )
	{//um... turn off?  Or just set length to 1?
		//FIXME: short-out effect/sound?
		ent->client->ps.saberActive = qfalse;
		return;
	}
	else if (saberContents&CONTENTS_OUTSIDE)
	{
		if ((level.worldFlags&WF_RAINING))
		{
			//add steam in rain
			if ( Q_flrand( 0, 500 ) < ent->client->ps.saberLength )
			{
				vec3_t	end, normal = {0,0,1};//FIXME: opposite of rain angles?
				VectorMA( ent->client->renderInfo.muzzlePoint, ent->client->ps.saberLength*Q_flrand(0, 1), ent->client->renderInfo.muzzleDir, end );
				G_PlayEffect( "saber/fizz", end, normal );
			}
		}
	}
	else if (saberContents&blockedWithSaber)
	{//add steam for lightning block
		if (Q_flrand(0, 500) < ent->client->ps.saberLength)
			{
				blockedWithSaber = qtrue;
				vec3_t	end, normal = { 0, 0, 1 };//FIXME: opposite of rain angles?
				VectorMA(ent->client->renderInfo.muzzlePoint, ent->client->ps.saberLength*Q_flrand(0, 1), ent->client->renderInfo.muzzleDir, end);
				G_PlayEffect("saber/fizz", end, normal);
			}
	} 

Nothing changed and I'm at a loss :/

Then I tried putting that bit of code in void ForceLightningDamage, but I had to comment it out because it causes a crash.

else if (blockedWithSaber)
				{
					traceEnt->client->ps.powerups[PW_SHOCKED] = 0;
					gentity_t *ent;

					int saberContents = gi.pointcontents(ent->client->renderInfo.muzzlePoint, ent->client->ps.saberEntityNum);

					if (Q_flrand(0, 500) < ent->client->ps.saberLength)
					{
						vec3_t	end, normal = { 0, 0, 1 };//FIXME: opposite of rain angles?
						VectorMA(ent->client->renderInfo.muzzlePoint, ent->client->ps.saberLength*Q_flrand(0, 1), ent->client->renderInfo.muzzleDir, end);
						G_PlayEffect("saber/fizz", end, normal);
					}

					/*G_PlayEffect(G_EffectIndex("saber/saberhitspark runner"), end, normal);
					G_PlayEffect(G_EffectIndex("force/lightning"), end, normal);*/
				}

I would really like to get this working somehow, but I'm almost exhausted my attempts. Anyone willing to help? @@MGummelt

Posted

Might have something to do with engine differences between JA and JO. I remember somewhere OpenJK saying that if you run JK2 with it you should be able to get weather effects that had support added in the engine for JA, but I assume you are already using the OpenJK executable to run your game, so I would maybe ask one of the OpenJK devs about it.

Guest Redemption
Posted

@@Dusty Cheers for the reply. Still haven't got to play you're mod yet, but my heads been stuck in Outcast for so long that, I haven't played Academy in years.

 

At first I tried pasting you're saber lightning blocking code, but never worked. I am using OpenJK instead of @@eezstreet mod as a base now; seems to fix the dismemberment issue.

  • Solution
Guest Redemption
Posted

Got it working to an a reasonable degree :)

Thanks @@Dusty, pretty much trimmed the code and changed ent to traceEnt... Bingo

Posted

Got it working to an a reasonable degree :)

Thanks @@Dusty, pretty much trimmed the code and changed ent to traceEnt... Bingo

Sorry I didn't respond sooner - work has been pretty busy this last week.  Sounds like you figured it out, though - nice work!

 

-Mike

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...