Jump to content

Home

soldier of fortune 2


Tinny

Recommended Posts

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!!!!

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...