View Full Version : How to remove items from the inventory
09-01-2003, 02:47 PM
I am working on a simple mutator that switches everyone in the game to the same random weapon every so many timer ticks. However, I don't know how to remove all the other weapons once the new one is added. Any ideas?
09-01-2003, 03:28 PM
I've been using this to delete all inventory.
How can I selectively delete certain weapons?
09-01-2003, 05:38 PM
3ddd:There's already a mutator like that,loojk for "no Item UT2k3" or "NIUT2k3" or a similar name
Ciced: either use a mutator or if you know the desired class o finventory to delete :
local inventory inv;
} until (inv==none)
09-01-2003, 10:55 PM
that's a really bad way to do it if you already know the class. In general you should never Destroy() something that a pawn is attached to.
local Inventory inv;
for( inv=Pawn.Inventory;inv!=none;inv=inv.Inventory )
if( inv.IsA('ShockRifle') )
That will work a million times better.
09-02-2003, 01:57 AM
Thanks for the help everyone! It turns out I came across the mods mentioned and another really good one called AngelWeaponSwitcherII.zip. We are going to test it out on a LAN game tomorrow. I plan on trying out the code posted above to see if I can get it to work anyway. This is a good project to learn a bit of UnrealScript. Thanks again!
I also want to add something new to it. Check it out: Certain people I play against at work tend to hog powerups which makes the game unbalanced. I want to include a "feature" where say, 1 out of 3 times, picking up a sheild takes you down to 1 health or a damage amp takes away all your weapons. I have an idea how to implement it... I'm going to give it a shot.
09-03-2003, 04:41 AM
yeh don't give up even if someone else has already done it. at least you get some good experience coding if nothing else.
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.