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?
Source code: how does Heretic stop chicken changing weapon?
- 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?
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.
- 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?
I think we've stumbled upon reasons to get class-specific weapons working.
Re: Source code: how does Heretic stop chicken changing weapon?
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.
- 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?
It's Randy's perogative if this or the code below gets added when it's finished, but...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.
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__
Re: Source code: how does Heretic stop chicken changing weapon?
I'm not sure about the source code but in my own decorate code I use this.
[ F.Y.I.] The minibuff is there only because the regular puff is way larger than the boot.
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.