Item drop style

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: Item drop style

by Graf Zahl » Tue Aug 09, 2005 12:52 pm

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.

by Enjay » Tue Aug 09, 2005 12:06 pm

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?

by Shadelight » Tue Aug 09, 2005 11:50 am

oh. that would be pretty neat though. confiuring how far the item the monster dropped would be cool then.

by Graf Zahl » Tue Aug 09, 2005 11:37 am

no. This is about monsters.

by Shadelight » Tue Aug 09, 2005 11:19 am

so you mean we can configure how far we throw the item when we drop it?

Item drop style

by Graf Zahl » Tue Aug 09, 2005 10:30 am

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.

Top