Source code: how does Heretic stop chicken changing weapon?

Discuss anything ZDoom-related that doesn't fall into one of the other categories.
Post Reply
User avatar
MartinHowe
Posts: 2072
Joined: Mon Aug 11, 2003 1:50 pm
Preferred Pronouns: He/Him
Location: East Suffolk (UK)

Source code: how does Heretic stop chicken changing weapon?

Post by MartinHowe »

OK, I've spent ages looking through the source code and experimenting, and this is driving me nuts.

If I use the chicken cheat in Heretic, I get a beak via the MorphWeapon property of the chicken player class; I cannot switch to any other weapon, such as the staff or wand, even though I already have them. Yet if I create a morph attack projectile in DOOM and summon a monster that fires it at me, I do indeed become another player class, but can still switch to the weapons I already have!

Using MorphWeapon None only says not to give me one when I first morph; I thought it was the presence of a KEYCONF lump, but in Heretic the behaviour still persists; in DOOM I get rid of the KEYCONF lump from the WAD and yet can still switch to a fist even when morphed.

So please, surely somebody must know exactly what is special about the chicken (and presumably the pig) that prevents them switching weapons?
User avatar
Amuscaria
Posts: 6634
Joined: Mon Jul 26, 2004 12:59 pm
Location: Growing from mycelium near you.

Re: Source code: how does Heretic stop chicken changing weapon?

Post by Amuscaria »

Maybe this has to do with the fact that classes dont handle weapons correctly/well in the current build? As with classes outside the original 3 Hexen ones, all classes can pickup and use all weapons. In Hexen, you cant switch to the weapons belonging to another class even if you pick them up. Just a guess, though.
User avatar
DoomRater
Posts: 8270
Joined: Wed Jul 28, 2004 8:21 am
Preferred Pronouns: He/Him
Location: WATR HQ
Contact:

Re: Source code: how does Heretic stop chicken changing weapon?

Post by DoomRater »

I think we've stumbled upon reasons to get class-specific weapons working.
User avatar
Amuscaria
Posts: 6634
Joined: Mon Jul 26, 2004 12:59 pm
Location: Growing from mycelium near you.

Re: Source code: how does Heretic stop chicken changing weapon?

Post by Amuscaria »

I was playing Hexen DM yesterday and noticed that even with standard Hexen weapons, being morphed into a pig doesnt prevent you from switching into the other weapons you have. They dont do anything, but you can still select them. Maybe this is only with Skulltag, i dunno.
User avatar
MartinHowe
Posts: 2072
Joined: Mon Aug 11, 2003 1:50 pm
Preferred Pronouns: He/Him
Location: East Suffolk (UK)

Re: Source code: how does Heretic stop chicken changing weapon?

Post by MartinHowe »

Eriance wrote:I was playing Hexen DM yesterday and noticed that even with standard Hexen weapons, being morphed into a pig doesnt prevent you from switching into the other weapons you have. They dont do anything, but you can still select them. Maybe this is only with Skulltag, i dunno.
It's Randy's perogative if this or the code below gets added when it's finished, but...

Code: Select all

#ifndef __A_MORPH__
#define __A_MORPH__

#define MORPHTICS (40*TICRATE)
#define MAXMORPHHEALTH	30

// Morph style states how morphing affects health and
// other effects in the game; only valid for players.
// Default should be the old Heretic/HeXen behaviour,
// so the (int) value of MORPH_RAVEN *must* be zero.
enum
{
	MORPH_RAVEN = 0,	// Health limited to 30 (Heretic/HeXen compatibility mode)
	MORPH_CURSE = 1,	// Health limited to MaxHealth of morphed class
	MORPH_POWER = 2		// Health limited only by the usual means (not by morphing)
};

bool P_MorphPlayer (player_s *player, const PClass *morphClass, int duration, int morph_style);
bool P_UndoPlayerMorph (player_s *player, bool force);
bool P_MorphMonster (AActor *actor, const PClass *morphClass, int duration);
bool P_UpdateMorphedMonster (AActor *actor);

#endif //__A_MORPH__
So watch this space...
User avatar
Lumpy
Posts: 256
Joined: Tue Jul 15, 2003 5:29 pm
Location: Pa,USA
Contact:

Re: Source code: how does Heretic stop chicken changing weapon?

Post by Lumpy »

I'm not sure about the source code but in my own decorate code I use this.
Spoiler:
You will still be able to pick up the weapons, but you will not be able to select or use them. There are 2 problems with my code though. 1) I haven't tested this with weapons given to the player via scripts. So said scripts may break this. 2) depending on what you morph the player into it may seem "[censored word]" for them to still be able to pick up the weapons. As in my example I have a gerbil sized marine picking up weapons 8 to 10 times bigger than himself.

[ F.Y.I.] The minibuff is there only because the regular puff is way larger than the boot.
Post Reply

Return to “General”