PDA

View Full Version : soldier of fortune 2


Tinny
08-02-2002, 03:22 PM
is it even possible to take the ghoul engine 2 of sof2 and incorporate it into JO? it would be awsome cuz now you could disemember enemies vertically because of the 32 different dismembering points.

Darth_Kitty
08-04-2002, 11:51 PM
I have aready done that. It is not possible to just copy and paste. It took me 2 months but I did it.

Master Toddy
08-05-2002, 12:27 AM
Are you planning on releasing it? Or could you e-mail it to me at master_toddy@the-sfa.org ?

Tinny
08-05-2002, 01:26 AM
wow Darth_kitty, you must be an incridible coder. i thought it would be impossible till they release the sof2 sp or mp source code. i think it would be rude of me to ask you to send me a copy of your mod if it isn't completed or you wouldn't like releasing it to the public but could you keep me upgraded with your progress and point me in directions on how you did this? you can e-mail me @ tinnywashington@hotmail.com . Thankx a ton in advance!!!!

Emon
08-05-2002, 04:08 AM
LoL!! The GHOUL2 system is already in JO! How else do you think they managed to get 14 dismemberment points for the lightsaber, and multiple dismemberments?

Tinny
08-05-2002, 05:13 PM
jo is based of the 1st ghoul engine. the 2nd one has twice as many disememberable points and you can see exiting and entering wounds on your opponents.

Emon
08-05-2002, 06:30 PM
Wrong.

JO is built off the SOF2 code base which uses GHOUL2, and the SOF2 code base is built off the EF code base which has Carcass, and the EF code base was built off the Q3 engine. For the SOF2 code base Raven merged EF's Carcass and SOF's GHOUL to create GHOUL2.

Just because JO doesn't have ultra high levels of gore and violence does NOT mean it doesn't use GHOUL2. The extra dismemberment points were never implemented into the game because SW isn't supposed to be gory.

Emon
08-05-2002, 06:31 PM
Oh, and there's also the cvar g_saberGHOUL2collision for MP, just incase you need more convincing. ;)

Darth_Kitty
08-05-2002, 11:04 PM
Very true Emon. The SOF2 engine is sort of in JKII. Not all of it.

Here's an example of what Raven said about it:



//It won't gib, it will disintegrate (because this is Star Wars).
self->takedamage = qfalse;


That made it so that it won't gib. But what I did (as part of my damn two month hell coding trip) is import some of the QIII gib graphics and effects and tured this on to self->takedamage = qtrue;


Also people you can't just copy this to the code. There are way more stuff to do. True you can just "turn dismember on" all the time (it is on all the time but if the player shoots someone in the side of the chest it won't dismember) you can have gibs, but I made it so that it has the splatter effects of QIII and the dimembering of SOFII. That's why I called it GOREŽ 1.3 (Yes it's trademarked).

if ( self->health <= GIB_HEALTH ) {
self->health = GIB_HEALTH+0;
}


If you change GIB_HEALTH+1 to GIB_HEALTH+0, it will make the model dissaper for the gibs (like in QIII, the model dissapers and the gibs are next). However, if you leave the mod so that there is no effects for the gibs and don't tell the code were to fine it, the players model dissapers then comes back because there is nothing there next for it. It assums that it should spawn the player model again.

Here's a harder way of doing it. This is just copied so it won't work if you copy and paste from this post (I don't want to do the caculations!)

//move it
limb->s.eType = ET_GENERAL;
limb->s.weapon = G2_MODEL_PART;

if (limbType == G2_MODELPART_HEAD)
{
limb->bounceCount = 2;
}
else
{
limb->bounceCount = 1;
}
limb->s.pos.trType = TR_GRAVITY;
limb->s.pos.trTime = level.time; // move a bit on the very first frame
VectorSubtract( point, ent->r.currentOrigin, dir );
VectorNormalize( dir );
if (ent->client)
{
VectorCopy(ent->client->ps.velocity, vel);
}
else
{
VectorCopy(ent->s.pos.trDelta, vel);
}
VectorMA( vel, 100, dir, limb->s.pos.trDelta );

//add some vertical velocity
if (limbType == G2_MODELPART_HEAD ||
limbType == G2_MODELPART_WAIST)
{
limb->s.pos.trDelta[2] += 100;
}

//make it bounce some
limb->s.eFlags |= EF_BOUNCE_HALF;
//no trDuration?
//spin it
VectorClear( limb->s.apos.trBase );
/*
limb->s.apos.trBase[0] = limbPitchBase;
limb->s.apos.trBase[1] = ent->client->ps.viewangles[1];
limb->s.apos.trBase[2] = limbRollBase;
*/
if (ent->client)
{
limb->s.apos.trBase[1] = ent->client->ps.viewangles[1];
}
else
{
limb->s.apos.trBase[1] = ent->r.currentAngles[1];
}

VectorClear( limb->s.apos.trDelta );

/*
limb->s.apos.trDelta[0] = Q_irand( -300, 300 );
limb->s.apos.trDelta[2] = Q_irand( -300, 300 );
limb->s.apos.trDelta[1] = Q_irand( -300, 300 );

if (limbType == G2_MODELPART_WAIST)
{
limb->s.apos.trDelta[0] = Q_irand( -60, 60 );
limb->s.apos.trDelta[2] = Q_irand( -60, 60 );
limb->s.apos.trDelta[1] = Q_irand( -60, 60 );
}
*/
VectorClear(limb->s.apos.trDelta);

limb->s.apos.trTime = level.time;
limb->s.apos.trType = TR_LINEAR;

limb->s.modelGhoul2 = limbType;
limb->s.g2radius = 200;
if (ent->client)
{
limb->s.modelindex = ent->s.number;
limb->s.modelindex2 = deathAnim;
}
else
{
limb->s.modelindex = -1;
limb->s.otherEntityNum2 = ent->s.number;
}

trap_LinkEntity( limb );
}

void DismembermentTest(gentity_t *self)
{
int sect = G2_MODELPART_HEAD;
vec3_t boltPoint;
G_GetDismemberBolt(self, boltPoint, sect);
G_Dismember( self, boltPoint, sect, 90, 0, BOTH_DEATH1 );
}

void DismembermentByNum(gentity_t *self, int num)
{
int sect = G2_MODELPART_HEAD;
vec3_t boltPoint;

switch (num)
{
case 0:
sect = G2_MODELPART_HEAD;
break;
case 1:
sect = G2_MODELPART_WAIST;
break;
case 2:
sect = G2_MODELPART_LARM;
break;
case 3:
sect = G2_MODELPART_RARM;
break;
case 4:
sect = G2_MODELPART_RHAND;
break;
case 5:
sect = G2_MODELPART_LLEG;
break;
case 6:
sect = G2_MODELPART_RLEG;
break;
default:
break;
}

G_GetDismemberBolt(self, boltPoint, sect);
G_Dismember( self, boltPoint, sect, 90, 0, BOTH_DEATH1 );
}

int G_GetHitQuad( gentity_t *self, vec3_t hitloc )
{
vec3_t diff, fwdangles={0,0,0}, right;
vec3_t clEye;
float rightdot;
float zdiff;
int hitLoc = -1;

if (self->client)
{
VectorCopy(self->client->ps.origin, clEye);
clEye[2] += self->client->ps.viewheight;
}
else
{
VectorCopy(self->s.pos.trBase, clEye);
clEye[2] += 16;
}

VectorSubtract( hitloc, clEye, diff );
diff[2] = 0;
VectorNormalize( diff );

if (self->client)
{
fwdangles[1] = self->client->ps.viewangles[1];
}
else
{
fwdangles[1] = self->s.apos.trBase[1];
}
// Ultimately we might care if the shot was ahead or behind, but for now, just quadrant is fine.
AngleVectors( fwdangles, NULL, right, NULL );

rightdot = DotProduct(right, diff);
zdiff = hitloc[2] - clEye[2];

if ( zdiff > 0 )
{
if ( rightdot > 0.3 )
{
hitLoc = G2_MODELPART_RARM;
}
else if ( rightdot < -0.3 )
{
hitLoc = G2_MODELPART_LARM;
}
else
{
hitLoc = G2_MODELPART_HEAD;
}
}
else if ( zdiff > -20 )
{
if ( rightdot > 0.1 )
{
hitLoc = G2_MODELPART_RARM;
}
else if ( rightdot < -0.1 )
{
hitLoc = G2_MODELPART_LARM;
}
else
{
hitLoc = G2_MODELPART_HEAD;
}
}
else
{
if ( rightdot >= 0 )
{
hitLoc = G2_MODELPART_RLEG;
}
else
{
hitLoc = G2_MODELPART_LLEG;
}
}

return hitLoc;
}

int gGAvoidDismember = 0;

void G_CheckForDismemberment(gentity_t *ent, vec3_t point, int damage, int deathAnim)
{
int hitLoc, hitLocUse = -1;
vec3_t boltPoint;
int dismember = g_dismember.integer;

if (!dismember)
{
return;
}

if (gGAvoidDismember == 1)
{
return;
}

if (!gGAvoidDismember != 2)
{ //this means do the dismemberment regardless of randomness and damage
if (Q_irand(0, 100) > dismember)
{
return;
}

if (damage < 20)
{
return;
}
}

if (gGAvoidDismember == 2)
{
hitLoc = HL_HAND_RT;
}
else
{
hitLoc = G_GetHitLocation( ent, point );
}

switch(hitLoc)
{
case HL_FOOT_RT:
case HL_LEG_RT:
hitLocUse = G2_MODELPART_RLEG;
break;
case HL_FOOT_LT:
case HL_LEG_LT:
hitLocUse = G2_MODELPART_LLEG;
break;

case HL_WAIST:
hitLocUse = G2_MODELPART_WAIST;
break;
/*
case HL_BACK_RT:
case HL_BACK_LT:
case HL_BACK:
case HL_CHEST_RT:
case HL_CHEST_LT:
case HL_CHEST:
break;
*/
case HL_ARM_RT:
hitLocUse = G2_MODELPART_RARM;
break;
case HL_HAND_RT:
hitLocUse = G2_MODELPART_RHAND;
break;
case HL_ARM_LT:
case HL_HAND_LT:
hitLocUse = G2_MODELPART_LARM;
break;
case HL_HEAD:
hitLocUse = G2_MODELPART_HEAD;
break;
default:
hitLocUse = G_GetHitQuad(ent, point);
break;


Well that should help.

Emon
08-06-2002, 12:34 AM
I said that JO uses the SOF2 code base, I didn't say that JO is SOF2.

Tinny
08-06-2002, 12:47 AM
are u planning on releasing it? i noticed that u trademarked it, so im confused now :confused: . does that mean we have to pay to get it or we have to mention you in our acknowledgements if we use it in our mods. oh and emon, im srry about the confusion, i thought jo only had the basic ghoul, i feel really stupid now.

Emon
08-06-2002, 12:52 AM
Hehe, it's okay. JO's GHOUL2 doesn't have as much dismemberment and gore as SoF2 simply because it's SW, and SW isn't gory. I think adding more dismemberment points would require additional capping and segmenting of models and new tags. Old models would work just not with the new dismemberment points.

Tinny
08-06-2002, 01:42 AM
oh, and what about the entering and exiting wounds like in sof2? you could have blaster marks not only on the walls but also on oponents, and when you drag ur lightsaber on an oponent, it would make similar marks that you see when you drag it along walls.

Darth_Kitty
08-06-2002, 02:19 AM
No, no, no, no Tinny. I tradmarked the word GOREŽ 1.3.

Darth_Kitty
08-06-2002, 02:30 AM
Also no I am not planning to release it. It was a clan mod. Sorry.:rolleyes: