Difference between revisions of "Reloadable Automag"

From Oldunreal-Wiki
Jump to navigation Jump to search
(Created page with '==Manually reloading the Automag== It's actually really simple, and only requires a small block of code to be added to the end of the Automag script. Start by opening UnrealED an…')
 
(Fixed formating...)
Line 3: Line 3:
  state Idle
  state Idle
  {
  {
function AnimEnd()
function AnimEnd()
{
{
PlayIdleAnim();
PlayIdleAnim();
}
}
function bool PutDown()
function bool PutDown()
{
{
GotoState('DownWeapon');
GotoState('DownWeapon');
return True;
return True;
}
}
function Timer()
function Timer()
{
{
if (FRand()>0.8) PlayAnim('Twiddle',0.6,0.3);
if (FRand()>0.8) PlayAnim('Twiddle',0.6,0.3);
else if (AnimSequence == 'Twiddle') LoopAnim('Sway1',0.02, 0.3);
else if (AnimSequence == 'Twiddle') LoopAnim('Sway1',0.02, 0.3);
}
}
  Begin:
  Begin:
bPointing=False;
bPointing=False;
if ( (AmmoType != None) && (AmmoType.AmmoAmount<=0) )
if ( (AmmoType != None) && (AmmoType.AmmoAmount<=0) )
Pawn(Owner).SwitchToBestWeapon();  //Goto Weapon that has Ammo
Pawn(Owner).SwitchToBestWeapon();  //Goto Weapon that has Ammo
Disable('AnimEnd');
Disable('AnimEnd');
LoopAnim('Sway1',0.02, 0.1);
LoopAnim('Sway1',0.02, 0.1);
SetTimer(1.5,True);
SetTimer(1.5,True);
if ( /*bFireMem ||*/ Pawn(Owner).bFire!=0 ) Global.Fire(0.0);
if ( Pawn(Owner).bFire!=0 ) Global.Fire(0.0);
if ( /*bAltFireMem ||*/ Pawn(Owner).bAltFire!=0 ) Global.AltFire(0.0);
if ( Pawn(Owner).bAltFire!=0 ) Global.AltFire(0.0);
  Looper:
  Looper:
if ( Pawn(Owner).bExtra3!=0) GotoState('NewClip');
if ( Pawn(Owner).bExtra3!=0) GotoState('NewClip');
Sleep(0.05);
Sleep(0.05);
Goto('Looper');
Goto('Looper');
  }
  }


Compile and save. Once you are in a game, summon your new Automag, bind a key to the command "Button Bextra3" and hit it.
Compile and save. Once you are in a game, summon your new Automag, bind a key to the command "Button Bextra3" and hit it.

Revision as of 06:52, 28 August 2009

Manually reloading the Automag

It's actually really simple, and only requires a small block of code to be added to the end of the Automag script. Start by opening UnrealED and subclassing Automag. Package and class name doesn't matter. Copy and paste the following into your new Automag:

state Idle
{
	function AnimEnd()
	{
		PlayIdleAnim();
	}
	function bool PutDown()
	{
		GotoState('DownWeapon');
		return True;
	}
	function Timer()
	{
		if (FRand()>0.8) PlayAnim('Twiddle',0.6,0.3);
		else if (AnimSequence == 'Twiddle') LoopAnim('Sway1',0.02, 0.3);
	}
Begin:
	bPointing=False;
	if ( (AmmoType != None) && (AmmoType.AmmoAmount<=0) )
		Pawn(Owner).SwitchToBestWeapon();  //Goto Weapon that has Ammo
	Disable('AnimEnd');
	LoopAnim('Sway1',0.02, 0.1);
	SetTimer(1.5,True);
	if ( Pawn(Owner).bFire!=0 ) Global.Fire(0.0);
	if ( Pawn(Owner).bAltFire!=0 ) Global.AltFire(0.0);
Looper:
	if ( Pawn(Owner).bExtra3!=0) GotoState('NewClip');
		Sleep(0.05);
	Goto('Looper');
}

Compile and save. Once you are in a game, summon your new Automag, bind a key to the command "Button Bextra3" and hit it.