how do i make the D3 shotgun semi-auto?

Deadguy

Limp Gawd
Joined
Jul 2, 2003
Messages
465
does anyone know how to do this??

maybe i can remove the cocking anim altogether, or make it really fast.

but i dont know how to change those things
 
well, if you're looking down in the weapon script (pak000.pak\scripts\weapon_shotgun.script), you'll find a section for the firing:

Code:
void weapon_shotgun::Fire() {
	float ammoClip;

	if ( WEAPON_NETRELOAD ) {
		WEAPON_NETRELOAD = false;
		weaponState( "Reload", SHOTGUN_IDLE_TO_RELOAD );			
	}

	next_attack = sys.getTime() + SHOTGUN_FIRERATE;
	
	ammoClip = ammoInClip();
	//Bottom modified by Kronchev - semi-auto weapon operation :)
	if ( WEAPON_ATTACK ) {
		if ( ammoClip == SHOTGUN_LOWAMMO ) {
			startSound( "snd_lowammo", SND_CHANNEL_ITEM, true );
		}
	
		launchProjectiles( SHOTGUN_NUMPROJECTILES, spread, 0, 1.0, 1.0 );
1.0);
		playAnim( ANIMCHANNEL_ALL, "fire" );
		//waitUntil( animDone( ANIMCHANNEL_ALL, PISTOL_FIRE_TO_IDLE ) );
		waitUntil(!WEAPON_ATTACK);
		weaponState( "Idle", SHOTGUN_FIRE_TO_IDLE );

	}
	//end kronchev's modifications
}

EDIT: changed this to use kronchev's script, since the on i originally posted was fully auto (oops)

then, just change this right at the top of the same file:
Code:
#define SHOTGUN_FIRERATE		1.333[CODE]

and change that number there to the amount of time you want 1 shot to take up in seconds.  you could, for example, set this number to 0.01.  Then the player could fire the shotgun (theoretically) up to 100 times per second.
 
i inserten this and i get an error

Code:
 Error: file script/weapon_shotgun.script, line 139: expected ';', found ')'

what am i missing??

also does anyone know how to make the flashlight into a floodlight?
i saw screens of it on here before and it looked like fun

also what do i change to make the flashlight in the center of the screen?
 
Back
Top