Difference between revisions of "Reloadable Automag"

From Oldunreal-Wiki
Jump to navigation Jump to search
(Fixed formating...)
(Added AI support and removed recasting)
Line 3: Line 3:
  state Idle
  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:
  Begin:
  bPointing=False;
  bPointing=False;
Line 26: Line 12:
  if ( Pawn(Owner).bFire!=0 ) Global.Fire(0.0);
  if ( Pawn(Owner).bFire!=0 ) Global.Fire(0.0);
  if ( Pawn(Owner).bAltFire!=0 ) Global.AltFire(0.0);
  if ( Pawn(Owner).bAltFire!=0 ) Global.AltFire(0.0);
Looper:
if( PlayerPawn(Owner)!=None )
  if ( Pawn(Owner).bExtra3!=0) GotoState('NewClip');
  {
Sleep(0.05);
while( Pawn(Owner).bExtra3==0 )
  Goto('Looper');
Sleep(0.05);
}
else Sleep(3.f); // If AI does not fire within 3 seconds, make em reload.
  GotoState('NewClip');
  }
  }


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 17:08, 17 January 2010

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
{
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);
	if( PlayerPawn(Owner)!=None )
	{
		while( Pawn(Owner).bExtra3==0 )
			Sleep(0.05);
	}
	else Sleep(3.f); // If AI does not fire within 3 seconds, make em reload.
	GotoState('NewClip');
}

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