Item drop style

Moderator: GZDoom Developers

User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49130
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Item drop style

Post by Graf Zahl »

Since I like Strife's item tossing much more than ZDoom's original, how about:

Code: Select all

//---------------------------------------------------------------------------
//
// PROC P_DropItem
//
//---------------------------------------------------------------------------
CVAR(Int, dropstyle, 0, CVAR_ARCHIVE|CVAR_SERVERINFO);

AInventory *P_DropItem (AActor *source, const TypeInfo *type, int special, int chance)
{
	if (type != NULL && pr_dropitem() <= chance)
	{
		AActor *mo;
		fixed_t spawnz;

		spawnz = source->z;
		if (!(compatflags & COMPATF_NOTOSSDROPS))
		{
			int style = dropstyle;
			if (style==0) style= (gameinfo.gametype == GAME_Strife)? 2:1;
			
			if (style==2)
			{
				spawnz += 24*FRACUNIT;
			}
			else
			{
				spawnz += source->height / 2;
			}
		}
and

Code: Select all

//============================================================================
//
// P_TossItem
//
//============================================================================

void P_TossItem (AActor *item)
{
	int style = dropstyle;
	if (style==0) style= (gameinfo.gametype == GAME_Strife)? 2:1;
	
	if (style==2)
	{
		item->momx += pr_dropitem.Random2(7) << FRACBITS;
		item->momy += pr_dropitem.Random2(7) << FRACBITS;
	}
	else
	{
		item->momx = pr_dropitem.Random2() << 8;
		item->momy = pr_dropitem.Random2() << 8;
		item->momz = FRACUNIT*5 + (pr_dropitem() << 10);
	}
}
to make it configurable by the user.
User avatar
Shadelight
Posts: 5113
Joined: Fri May 20, 2005 11:16 am
Location: Labrynna

Post by Shadelight »

so you mean we can configure how far we throw the item when we drop it?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49130
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Post by Graf Zahl »

no. This is about monsters.
User avatar
Shadelight
Posts: 5113
Joined: Fri May 20, 2005 11:16 am
Location: Labrynna

Post by Shadelight »

oh. that would be pretty neat though. confiuring how far the item the monster dropped would be cool then.
User avatar
Enjay
 
 
Posts: 26540
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland

Post by Enjay »

Whilst we are discussing this topic, am I right in saying that when a monster drops more than one item the items are all dropped at the same angle? It seems to be that way.

eg I set a monster to drop a random number of armor helmets by putting this in the monster definition

Code: Select all

DROPITEM ArmorBonus 128
DROPITEM ArmorBonus 128
DROPITEM ArmorBonus 128
DROPITEM ArmorBonus 128
DROPITEM ArmorBonus 128
It works pretty much as I want it to (ie the monster drops a random number of helmets from 0-5) but the helmets all get thrown in exactly the same way. So as far as you can see, until you actually pick up the helmets, it looks like he has actually only dropped one. Quite a useful effect from one point of view, but not what I wanted. What I would prefer is the monster to drop each helmet at a random angle so that a monster dropping 5 helmets would be surrounded by a scattering of the dropped items rather than them all sitting on top of each other.

Possible?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49130
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Post by Graf Zahl »

The momentum is so small that you won't really be able to notice it but it is there. If I had to decide that item dropping style could go poof. I think it sucks.

Return to “Closed Feature Suggestions [GZDoom]”