getting a pickup without Touch()?

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

FireSlash

Whats a FireSlash?
Feb 3, 2001
4,300
0
0
38
Central Ohio
www.unrealannihilation.com
The goal of this code is to determine if we can pickup the item listed, and if we can, add it to an array for use later. Now, this works great for everything EXCEPT ammuniton, which seems to get picked up when this is done if the player has the weapon which uses the ammo.

Code:
var int	/*-------------------*/ WFMode, HUDPanelOffset;
var byte /*------------------*/ ECost, MaxItems;
var() float /*---------------*/ TraceRange, SelectRadius;
var array<pickup>	/*-------*/ Items; 
var vector /*----------------*/ EndEffect;

<snip>

simulated function DrawWeaponInfo(Canvas Canvas)
{
	local byte h, i;
	local float Distance;
	local Vector StartTrace, EndTrace, X,Y,Z;
	local Vector HitLocation, HitNormal;
	local Actor Other;

	
	Canvas.DrawColor = class'HUD'.Default.WhiteColor;
	Canvas.Font = font'DefaultFont';
	switch (WFMode)
	{
		case 0:
<snip>
		case 1:
			GetViewAxes(X,Y,Z);

			// the to-hit trace always starts right in front of the eye
			StartTrace = Instigator.Location + Instigator.EyePosition() + X*Instigator.CollisionRadius;

			EndTrace = StartTrace + TraceRange * X;

			Other=Trace(HitLocation, HitNormal, EndTrace, StartTrace, false);
				
			GetItemList ( HitLocation, Items );

			Canvas.SetPos( ( Canvas.ClipX / 2 ) + HUDPanelOffset, ( Canvas.ClipY / 2) + HUDPanelOffset);
			Canvas.DrawTile( Material'InterfaceContent.Menu.EditBox', 100, 10, 0,0,64,64);
			Canvas.SetPos( ( Canvas.ClipX / 2 ) + HUDPanelOffset + 5, ( Canvas.ClipY / 2) + HUDPanelOffset +1 );
			Canvas.DrawText("Pickups",true);
			ECost=0;
			h=1;
			for(i=0; i<MaxItems; i++)
			{
				if(Items[i] != None)
				{
					if (Items[i].ReadyToPickup(0) && FastTrace(Items[i].location, instigator.Location)
						&& Level.Game.PickupQuery(Instigator, Items[i]) /* oO */ ) 
					{
						Canvas.SetPos( ( Canvas.ClipX / 2 ) + HUDPanelOffset, ( Canvas.ClipY / 2) + HUDPanelOffset + 10*h);
						Canvas.DrawTile( Material'InterfaceContent.Menu.EditBox', 100, 10, 0,0,64,64);
						Canvas.SetPos( ( Canvas.ClipX / 2 ) + HUDPanelOffset + 5, ( Canvas.ClipY / 2) + HUDPanelOffset + 10*h+1 );
						Canvas.DrawText(Items[i].PickupForce,true);
						ECost++;
						h++;
					}
				}
			}
	}
}
:con: