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…')
 
 
(2 intermediate revisions by 2 users not shown)
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;
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:
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.
[[Category:Scripting]]

Latest revision as of 18:42, 10 September 2011

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.