Inventory tossable?

Discussions about Coding and Scripting
Post Reply
User avatar
Barbie
Godlike
Posts: 2808
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Inventory tossable?

Post by Barbie »

Is there any method to decide if an inventory is tossable? (Worst case would be using a white- or blacklist.)
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett
User avatar
ExpEM
Adept
Posts: 298
Joined: Wed Nov 09, 2016 1:48 am

Re: Inventory tossable?

Post by ExpEM »

In the base Inventory class, no.
Pickup class also no.
Weapon class has bCanThrow.

What are you trying to do?
Signature goes here.
User avatar
Barbie
Godlike
Posts: 2808
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: Inventory tossable?

Post by Barbie »

Players should be able to toss some inventory things like Scuba or Flashlight. Also they should drop some (random) inventory items on death.
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett
Kismet
Novice
Posts: 10
Joined: Sat Nov 05, 2022 9:45 pm

Re: Inventory tossable?

Post by Kismet »

Look at Pinata mutator. It throws all items including Flashlight.
User avatar
Barbie
Godlike
Posts: 2808
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: Inventory tossable?

Post by Barbie »

Kismet wrote: Wed Oct 18, 2023 8:53 am Look at Pinata mutator. It throws all items including Flashlight.
Thanks, but that mutator drops everything that is not Ammo. (For example I realized personal light as an inventory item and that should never be dropped.)
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett
User avatar
EvilGrins
Godlike
Posts: 9748
Joined: Thu Jun 30, 2011 8:12 pm
Personal rank: God of Fudge
Location: Palo Alto, CA
Contact:

Re: Inventory tossable?

Post by EvilGrins »

True, pinata doesn't drop ammo... but every weapon it does drop has as much ammo in it that it had when it was still held.
http://unreal-games.livejournal.com/
Image
medor wrote:Replace Skaarj with EvilGrins :mrgreen:
Smilies · viewtopic.php?f=8&t=13758
User avatar
ExpEM
Adept
Posts: 298
Joined: Wed Nov 09, 2016 1:48 am

Re: Inventory tossable?

Post by ExpEM »

Are you talking about a drop on death sort of thing or a drop with KeyBind sort of thing?
Looks like both, if you can give us a full detailed explanation of what you want then we would be better able to assist.
Signature goes here.
User avatar
Barbie
Godlike
Posts: 2808
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: Inventory tossable?

Post by Barbie »

Thanks for all comments. I'll try with a blacklist:

Code: Select all

var config string	NoneTossableInventory[8]; // format: <Packagename.classname>, e.g. "Botpack.Pulsegun" (I've chosen "string", because the outer name may contain illegal name characters)

function bool InventoryIsTossable(Inventory Inv) {
local byte i;

	if (Weapon(Inv) != None)
		return Weapon(Inv).bCanThrow;

	if (Ammo(Inv) != None)
		return false;

	for (i = 0; i < ArrayCount(NoneTossableInventory); i++)
		if (NoneTossableInventory[i] != "" )
			if (NoneTossableInventory[i] ~= String(Inv.Class))
				return false;

	return true;
}
FIX: changed "(string(Inv.Class.Outer) $ "." $ String(Inv.Class))" to "String(Inv.Class)"
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett
Post Reply