PDA

View Full Version : A mini-mod


ASk
06-01-2002, 05:34 AM
i am doing now a mini-mod:
*rockets bounce and deflectable by sabers
*disruptor fires through walls - this is giving me pains :P
the rockets bounce around at least :)

ASk
06-01-2002, 07:31 AM
anyway....i couldn't find the code for the Disruptor to shoot through walls.
So, I enchanced the rockets:

with each bounce there's a damage increase, but a speed decrease.

download it at http://www.darklordofsith.net/missilemod.zip
Also, I submit this mod to various JK2 sites

ASk
06-01-2002, 07:38 AM
anyway....i couldn't find the code for the Disruptor to shoot through walls.
So, I enchanced the rockets:

with each bounce there's a damage increase, but a speed decrease.

download it at http://www.darklordofsith.net/missilemod.zip
Also, I submit this mod to various JK2 sites

Chua
06-01-2002, 12:31 PM
could u post a short 'tutorial' to tell us n00bs how u did it?

TheDarkJedi
06-01-2002, 01:53 PM
hey awesome mod,but is there anyway to use it in single player?

ASk
06-01-2002, 02:56 PM
i will answer both questions:
a) i dont think it's possible in single player, because it uses another dll, and we do not have it's source :(
b) a tutorial
file: g_weapon.c
Original, line 1674

//rww - We don't want rockets to be deflected, do we?
missile->clipmask = MASK_SHOT;// | CONTENTS_LIGHTSABER;
missile->splashDamage = ROCKET_SPLASH_DAMAGE;
missile->splashRadius = ROCKET_SPLASH_RADIUS;

// we don't want it to ever bounce
missile->bounceCount = 0;


changed to


//rww - We don't want rockets to be deflected, do we? Well, we do....25% chance :P
if(Q_irand(1, 4)==1) //defines 25% chance
{
missile->clipmask = MASK_SHOT | CONTENTS_LIGHTSABER;
}
else
{
missile->clipmask = MASK_SHOT;
}
missile->splashDamage = ROCKET_SPLASH_DAMAGE;
missile->splashRadius = ROCKET_SPLASH_RADIUS;

// we don't want it to ever bounce...yeah right :P
missile->s.eFlags |= EF_ROCKETBOUNCE; //custom flag for special processing
missile->bounceCount=5; //bounce count


file: g_missile.c
original, line168 - end of if...else code
added

if (ent->s.eFlags & EF_ROCKETBOUNCE)
{
VectorScale( ent->s.pos.trDelta, 0.8, ent->s.pos.trDelta );
ent->damage *= 1.2; //up damage, etc
ent->speed /= 1.2;
ent->splashDamage *=1.05;

// check for stop
if ( trace->plane.normal[2] > 0.2 && VectorLength( ent->s.pos.trDelta ) < 40 )
{
G_SetOrigin( ent, trace->endpos );
return;
}
if (ent->bounceCount==0)
{
G_ExplodeMissile(ent); //explode at the end
return;
}
}


file: g_cmds.c
original, line 2726

else if (Q_stricmp(cmd, "thedestroyer") == 0 && CheatsOk( ent ) && ent && ent->client && ent->client->ps.saberHolstered && ent->client->ps.weapon == WP_SABER)

removed CheatsOK(ent)

file: bg_pmove.c
original:

float forceJumpHeight[NUM_FORCE_POWER_LEVELS] =
{
32,//normal jump (+stepheight+crouchdiff = 66)
96,//(+stepheight+crouchdiff = 130)
192,//(+stepheight+crouchdiff = 226)
384//(+stepheight+crouchdiff = 418)
};

float forceJumpStrength[NUM_FORCE_POWER_LEVELS] =
{
JUMP_VELOCITY,//normal jump
420,
590,
840
};


edited the values:

float forceJumpHeight[NUM_FORCE_POWER_LEVELS] =
{
69,//normal jump (+stepheight+crouchdiff = 66)
288,//(+stepheight+crouchdiff = 130)
576,//(+stepheight+crouchdiff = 226)
1152//(+stepheight+crouchdiff = 418)
};

float forceJumpStrength[NUM_FORCE_POWER_LEVELS] =
{
JUMP_VELOCITY,//normal jump
840,
1180,
1680
};


Most edits here are very simple
My problem now, is that i can't find the handler of Disruptor hitting the wall

ASk
06-01-2002, 02:58 PM
oh and i suggest that you redownload the mod, as it's been enchanced, as can be seen from the above code

ASk
06-01-2002, 06:58 PM
another feature added, yay

the original disruptor shooting through walls feature was finally figured out!!!!!

now, it's alt-fire shoots through walls. You have to use seeing to see through the walls, though, as this would be a cheat if i added it directly to the sniper.
Enjoy

http://www.darklordofsith.net/missilemod.zip