UE1 - UT Removing items/pickups from map

  • 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.

kes-hat

New Member
Apr 26, 2010
7
0
1
I would like to figure out how to remove all of the items/pickups from a map, but not those that are in player inventory.

What I want it to do is spawn a player with adjustable items/health/armour, and not be able to improve this by picking up further items, yet use normal/standard DM maps to do this on. So need to remove the other stuff that is already on the map.

I've had a look at the code for the Last Man Standing mod, and I can't figure out how it removes the pickups at all (must be stupid, but I can't see where it removes them). So I continued looking elsewhere, for example the Arena mutator, but the checkreplacement function seems to destroy all instances of the items to be removed (including those carried by the player). Yet I can't seem to get into PreBeginPlay or InitGame which something like SiegeXXL uses to remove all pickups from the game. Any bright ideas?
 

War_Master

Member
May 27, 2005
702
0
16
do a loop on all Inventory items using a Mutator's PostBeginPlay and Destroy(); the items. You might also need to clear the inventorySpot for each item so bots wont get stuck. There's also some Decorations that spawn items when they get destroyed and you will have to set their 3 properties that spawn items to None.

if you use CheckReplacement it will prevent the specified Inventory item from spawning, so dont use this function if all you want is to remove them from the map.
 

kes-hat

New Member
Apr 26, 2010
7
0
1
Oh yeah! PostBeginPlay appears to be a winner. Thanks WM.
Code:
function PostBeginPlay()
{
	local Actor PBPcheck;
	// Before the game starts we check all actors. If they are Inventory, but not jumpboots, they are removed.
	foreach AllActors( class'Actor', PBPcheck)
	{
		if ( (UT_Jumpboots(PBPcheck) == None ) && ( Inventory(PBPcheck) != None ) )
		{
			PBPcheck.Destroy();
		}
	}
}
Have some code for other people looking to do similar things.