Triple Bolt Crossbow 1. Open up the mp.dll source files in your compiler.
2. Open up crossbow.cpp.
3. Go to the line with "void CCrossbow::FireBolt()" which
should be around line 429.
4. Find these lines:
CCrossbowBolt *pBolt =
CCrossbowBolt::BoltCreate();
pBolt->pev->origin = vecSrc;
pBolt->pev->angles = anglesAim;
pBolt->pev->owner = m_pPlayer->edict();
5.
And add the curiously similar lines:
#define TRIPLE_SHOT_SPREAD Vector(0.175,0,0) // 10
degree spread
CCrossbowBolt *pBolt2 = CCrossbowBolt::BoltCreate();
pBolt2->pev->origin = vecSrc+Vector(25,0,0);
pBolt2->pev->angles = anglesAim + TRIPLE_SHOT_SPREAD;
pBolt2->pev->owner = m_pPlayer->edict();
CCrossbowBolt *pBolt3 =
CCrossbowBolt::BoltCreate();
pBolt3->pev->origin = vecSrc-Vector(25,0,0);
pBolt3->pev->angles = anglesAim - TRIPLE_SHOT_SPREAD;
pBolt3->pev->owner = m_pPlayer->edict();
Ok, what that did was create two extra objects, initilize them as
bolts, give them the same angles and owner as the first bolt, but alter it's
position on the X Axis (side to side) by +25 and -25 units.
6. Now find these lines:
pBolt->pev->velocity = vecDir * BOLT_WATER_VELOCITY;
pBolt->pev->speed = BOLT_WATER_VELOCITY;
7. And right below them insert:
pBolt2->pev->velocity = (vecDir + TRIPLE_SHOT_SPREAD) * BOLT_WATER_VELOCITY;
pBolt2->pev->speed = BOLT_WATER_VELOCITY;
pBolt3->pev->velocity = (vecDir - TRIPLE_SHOT_SPREAD) * BOLT_WATER_VELOCITY;
pBolt3->pev->speed = BOLT_WATER_VELOCITY;
Ok, here's what this does. By adding/subtracting the triple
shot spread vector to vecDir before multiplying, the velocity is adjusted to the left and
right so that the left and right arrows gradually fade from the center.
8. Then peek down a few more lines to see:
pBolt->pev->velocity = vecDir * BOLT_AIR_VELOCITY;
pBolt->pev->speed = BOLT_AIR_VELOCITY;
9. And insert these lines:
pBolt2->pev->velocity = (vecDir + TRIPLE_SHOT_SPREAD) * BOLT_AIR_VELOCITY;
pBolt2->pev->speed = BOLT_AIR_VELOCITY;
pBolt3->pev->velocity = (vecDir - TRIPLE_SHOT_SPREAD) * BOLT_AIR_VELOCITY;
pBolt3->pev->speed = BOLT_AIR_VELOCITY;
This is essentially the same as step 7, it simply needs to be done
for both air and water.
10. Compile crossbow.cpp and build mp.dll.
11. Make sure mp.dll is in a dir like c:\sierra\half-life\temp\dlls
12. Make sure liblist.gam is in c:\sierra\half-life\temp or the
equivilent
13. If you don't have the contents of liblist.gam look to the
Getting Started tutorial. |