Weapon Animations


(daz2007) #1

I Created this Mod Years ago but i want to add the RTCW Animations

What are the RTCW Equivilent of “.weap Files” ??

weaponDef
{
// This basically fills out weaponInfo_t
client {
//standModel “” // weapon pickup ‘stand’ (do we still use this?)
pickupModel “models/weapons2/tesla/pu_tesla.md3”
pickupSound “sound/misc/w_pkup.wav”

  weaponConfig		"models/weapons2/tesla/weapon.cfg"
  handsModel			"models/weapons2/tesla/v_tesla_hand.mdc"
  
  //flashDlightColor	0 0 0
  flashSound		"sound/weapons/tesla/spinup.wav"							// supports up to 4 flash sounds
  //flashEchoSound	""										// supports up to 4 flash echo sounds
  //lastShotSound		""										// supports up to 4 last shot sounds
  
  readySound		"sound/weapons/tesla/ready.wav"
  //firingSound		""									// no weapons seem to use this, basically it's a replacement hum for readysound, but then when firing
  //overheatSound		""
  //reloadSound		""
  //reloadFastSound	""									// some weapons have fast reloads due to the skill system
  spinupSound		""									// sound started when fire button goes down, and stepped on when the first fire event happens
  //spindownSound		""									// sound called if the above is running but player doesn't follow through and fire
  //switchSound		""									// allow overriding of weaponswitch sound
  
  //weaponIcon			"icons/iconw_tesla_1"
  weaponSelectedIcon	"icons/iconw_tesla_1_select"
  
  //missileModel		""
  //missileSound		""
  //missileTrailFunc	""									// supports "GrenadeTrail", "RocketTrail", "PyroSmokeTrail" and "DynamiteTrail" (we REALLY want a particle system for this)
  //missileDlight		0
  //missileDlightColor	0 0 0							// do we still use this?
  
  //ejectBrassFunc	""									// supports "MachineGunEjectBrass" and "PanzerFaustEjectBrass"
  
  modModel 0			"models/weapons2/tesla/tesla_barrel.mdc"
  modModel 1			"models/weapons2/tesla/tesla_barrel2.mdc"
  
  firstPerson {
  	model			"models/weapons2/tesla/v_tesla.mdc"
  	//flashModel	""
  	
  	// weapon building
  	// the parts are numbered because there are some hardcoded references for some weapons to certain parts
  	weaponLink
  	{
  		part 0
  		{
  			tag		"tag_barrel"
  			model	"models/weapons2/tesla/v_tesla_barrel.md3"
  		}
  		part 1
  		{
  			tag		"tag_barrel2"
  			model	"models/weapons2/tesla/v_tesla_barrel2.mdc"
  		}   
  	}
  }
  
  thirdPerson {
  	model			"models/weapons2/tesla/tesla.mdc"
  	flashmodel		"models/weapons2/flamethrower/flamethrower_flash.mdc"
  }

}
}

///////////////////////
//
// TESLA
//
///////////////////////

newfmt
// config file for weapon animations

// barrel barrel
// first length fps looping anim bits animated weap draw bits
// / ___/ / / / / /
// / / ______/ / / / /
// / / / ________/ / / /
// / / / / ___________/ / /
// / / / / / ___________________/ /
/// / / / / / ______________________________/
// / / / / / /

0 1 20 1 0 0 0 // IDLE1
0 1 20 1 0 0 0 // IDLE2

1 5 20 0 0 0 2 // ATTACK1
//1 6 20 0 0 0 0 // ATTACK2
//1 6 20 0 0 0 0 // ATTACK3
//0 1 20 1 0 0 2 // ATTACK1
0 1 20 1 0 0 2 // ATTACK2
0 1 20 1 0 0 2 // ATTACK3

7 5 20 0 0 0 2 // DROP
12 4 16 0 0 0 2 // RAISE
12 4 16 0 0 0 2 // RELOAD1
12 4 16 4 0 0 2 // RELOAD2
12 4 16 0 0 0 2 // RELOAD3

0 1 20 1 0 0 2 // ALTSWITCH (SA) new alt-mode switching anim
0 1 20 1 0 0 2 // ALTSWITCH (SA) new alt-mode switching anim

This is What is Written as ported from RTCW, But the Animations are not Showing in-game


(eQuilibrium) #2

I believe there is no such thing as .weap files in RTCW. It’s all in the source code. You should only need the weapon.cfg and all the correct barrels and the correct hands model for it to work, though?


(daz2007) #3

In RTCW when the Tesla Was Firing, the weapon Would Animate, which is what i want in et

Watch this Video to see what i mean


(Scennative) #4

You cant add the animation, when you only make a Mini-Mod.

Then the rotation of the XXX is coded:
Rtcw-Code/SP:
cg_weapons.c

/*
==============
CG_TeslaSpinAngle
==============
*/

//#define TESLA_SPINSPEED .2
//#define TESLA_COASTTIME	2000
#define TESLA_SPINSPEED .05
#define TESLA_IDLESPEED .15
#define TESLA_COASTTIME 1000

static float CG_TeslaSpinAngle( centity_t *cent ) {
	int delta;
	float angle;
	float speed;

	delta = cg.time - cent->pe.barrelTime;

	angle = cent->pe.barrelAngle;

	if ( cent->currentState.eFlags & EF_FIRING ) {
		angle += delta * TESLA_SPINSPEED;
	} else {
		angle += delta * TESLA_IDLESPEED;
	}

	cent->pe.barrelAngle = AngleMod( angle );

	cent->pe.barrelTime = cg.time;

	return AngleMod( angle );

//----(SA)	trying new tesla effect scheme for MK
//	angle = -(cent->pe.barrelAngle + delta * TESLA_SPINSPEED);
//	cent->pe.barrelAngle = AngleMod( angle );

//	if(cent->currentState.eFlags & EF_FIRING)
//		cent->pe.barrelAngle += delta * TESLA_SPINSPEED;
//	else
//		cent->pe.barrelAngle += delta * TESLA_IDLESPEED;

	return AngleMod( cent->pe.barrelAngle );





	return angle;


	if ( cent->pe.barrelSpinning ) {
		angle = -( cent->pe.barrelAngle + delta * TESLA_SPINSPEED );
	} else {
		if ( delta > TESLA_COASTTIME ) {
			delta = TESLA_COASTTIME;
		}

		speed = 0.5 * ( TESLA_SPINSPEED + (float)( TESLA_COASTTIME - delta ) / TESLA_COASTTIME );
		angle = -( cent->pe.barrelAngle + delta * speed );
	}

	if ( cent->pe.barrelSpinning == !( cent->currentState.eFlags & EF_FIRING ) ) {
		cent->pe.barrelTime = cg.time;
		cent->pe.barrelAngle = AngleMod( angle );
		cent->pe.barrelSpinning = !!( cent->currentState.eFlags & EF_FIRING );
	}

	return angle;
}

But why you dont make a shader that is rotating? Maybe it has the same effect.

Edit: AND PLZ USE THE FU CODE NOT THE QUOTE SH!T!


(daz2007) #5

error C2039: ‘barrelSpinning’ : is not a member of ‘playerEntity_t’

!!!


(daz2007) #6

i guess i need to also change the position of the weapon to match rtcw

Anyone Know any good Electric Shaders

For some reason in RTCW they where two sets of sprites for the flamethrower
twiltb2 and triltb2_lg in ET there is only twiltb2, but et does not use flamethrower.shader.

If i put flamethrower.shader in ET, i get black and Orange, unless i put twiltb2_lg in ET from rtcw

flamethrowerFire1
{
nofog
nomipmaps
allowCompress
cull none
{
mapcomp sprites/twiltb2_lg/spr000.tga
mapnocomp sprites/twiltb2/spr000.tga
blendFunc GL_ONE GL_ONE_MINUS_SRC_COLOR
}
}

This means they are 80 Sprites that are used for the Flamethrower ??

whats difference between mapcomp and mapnocomp