Heretic and HeXen weapons FROM SCRATCH

Advanced OpenGL source port fork from ZDoom, picking up where ZDoomGL left off.
[Home] [Download] [Git builds (Win)] [Git builds (Mac)] [Wiki] [Repo] [Bugs&Suggestions]

Moderator: Graf Zahl

Locked
User avatar
MartinHowe
Posts: 154
Joined: Tue Aug 30, 2005 22:07
Location: East Suffolk (UK)

Heretic and HeXen weapons FROM SCRATCH

Post by MartinHowe »

OK, here's a big one: how can the HeXen and Heretic weapons be recreated from scratch? I am trying to make a modfied Cleric Mace for use in DOOM and have got thus far:

Code: Select all

ACTOR HammerOfHatred : Weapon 15072
{
//
// The item is a modified Cleric Mace; the settings were
// copied direct from the ZDOOM source code as they were
// not detailed in the WIKI at the time of writing. The graphics
// are heavily-modified Hammer of Retribution sprites.
//
	Radius 20
	Height 55
	Inventory.PickupMessage "You have the Hammer of Hatred!"
	Obituary "%o was hammered."
	Weapon.SelectionOrder 3500
	Weapon.Kickback 150
//	Weapon.AmmoType "NULL"
	Weapon.AmmoUse 0
	Weapon.AmmoGive 0
	Weapon.YAdjust -8
	+WEAPON.MELEEWEAPON
	States
	{
	Ready:
		SHRG A  1 A_WeaponReady
		Loop
	Deselect:
		SHRG A  1 A_Lower
		Loop
	Select:
		SHRG A  1 A_Raise
		Loop
	Fire:
		SHRG B  2
		SHRG B  1
		SHRG B  2
		SHRG C  1
		SHRG D  1
		SHRG E  1
		SHRG E  1 A_CMaceAttack
		SHRG F  1
		SHRG F  2
		SHRG F  1
		SHRG F  8
		SHRG A  2 A_ReFire
		SHRG A  1
		SHRG A  2
		SHRG A  1
		SHRG A  2
		SHRG A  1
		Goto Ready
	Spawn:
		SHRA A -1
		Stop
	}
}
EDIT:

The problem is that A_CMaceAttack is not exposed by DECORATE, for reasons given in this thread; however, it surely should be possible to code most of the Heretic and HeXen weapons from scratch, at least to a reasonable approximation. Of course, this could involve adding extra codepointers or states, or arguments to the existing ones. For example, there could be separate states in melee weapons for "miss entirely" and "hit wall instead of monster", or extra arguments to A_CustomPunch (i.e, "hit", "miss" and "hit a wall" sounds)?

In the meantime, however:
wildweasel wrote:You can do this by using a special puff, making its DeathSound the "thud" sound, and then putting A_Scream on one of the frames.
This would handle the "hit wall" thing, but what about hitting a monster? Sorry if these are dumb questions; I'm new to weapon creation and there's a lot of stuff I don't know about yet and therefore don't know to look for it.
User avatar
MartinHowe
Posts: 154
Joined: Tue Aug 30, 2005 22:07
Location: East Suffolk (UK)

Post by MartinHowe »

OK, I've tried WW's idea and found the bulletpuff in the Wiki. This is it:

Code: Select all

ACTOR HammerBlow : BulletPuff
{
    ActiveSound    "shammer/miss"
    AttackSound    "shammer/hitwall"
    SeeSound       "shammer/hitactor"
    DamageType     Normal
}
The HammerBlow is specified as the puff type using A_CustomPunch. It all works fine except when the hammer hits a monster. Then no sound is heard. On the other hand, when a genuine Cleric Mace is used, with the correct SNDINFO entries and sounds, there is indeed a sound heard when the mace hits a monster.

What am I doing wrong? According to the Wiki, the SeeSound is meant to be played when a monster is hit.
User avatar
Graf Zahl
GZDoom Developer
GZDoom Developer
Posts: 7148
Joined: Wed Jul 20, 2005 9:48
Location: Germany
Contact:

Post by Graf Zahl »

But only when the puff is being spawned. You need to add +PUFFONACTORS but then the puff will be spawned in addition to the blood.
User avatar
MartinHowe
Posts: 154
Joined: Tue Aug 30, 2005 22:07
Location: East Suffolk (UK)

Post by MartinHowe »

Thanks, that explains that. Is there anything you can do about it? It is quite important, as "not fixing" it prevents at least one HeXen weapon from being definable in DECORATE.

I'd post a feature request, but you're in a much better position to know what such a request should contain, as there are several ways of doing it.

One way would be to have the engine define a specific blood puff of some sort.

Another would be to add another flag to the Puff class, say, BLOODONACTORS which would behave the same as for PUFFONACTORS, but suppress the puff if the actor bleeds.

Yet another would be to have three extra arguments to A_CustomPunch only, those being the sound to play in each circumstance. This is not as weird as it sounds at first sight, since an impact sound on bleedable things only really makes sense for the punch anyway ("Wanna hear bones crack!", as Hammerstein once said, if you know your 2000AD :) ).

What do you think?
User avatar
wildweasel
DRD Team Admin (Inactive)
Posts: 2132
Joined: Wed Jun 29, 2005 22:00
Location: the Admincave!
Contact:

Post by wildweasel »

For an impact sound, add AttackSound to the weapon itself - unless you're already using that?
User avatar
MartinHowe
Posts: 154
Joined: Tue Aug 30, 2005 22:07
Location: East Suffolk (UK)

Post by MartinHowe »

wildweasel wrote:For an impact sound, add AttackSound to the weapon itself - unless you're already using that?
Cool 8) it works now, thanks a lot :rock:

I hadn't done that before, not realising that the impact would only be heard if the weapon hits the target; I interpreted the word "attack" too literally.

The actual values for the damage will need tweaking, of course, but at least now that is one HeXen weapon that can be defined from scratch (although the example used here is called a hammer, it's a 1:1 skin replacement for the mace; the behaviour is meant to be the same). Thanks again.
User avatar
The Ultimate DooMer
Persecution Complex
Posts: 152
Joined: Tue Nov 08, 2005 23:04
Location: Industrial Zone
Contact:

Post by The Ultimate DooMer »

It's not possible to recreate many of the weapons unless you inherit from them. I had to create slightly altered versions of the fist and hammer, the rest I was ok with (or inherited from original).
User avatar
MartinHowe
Posts: 154
Joined: Tue Aug 30, 2005 22:07
Location: East Suffolk (UK)

Post by MartinHowe »

The Ultimate DooMer wrote:It's not possible to recreate many of the weapons unless you inherit from them. I had to create slightly altered versions of the fist and hammer, the rest I was ok with (or inherited from original).
Yes, it is all to do with side-effects and so forth, apparently. I don't entirely agree with that as for DOOM player classes, the side effects are not needed; nevertheless I understand it would be a lot of work to Graf to separate out the raw monster-killing functionality as generalised codepointers. As it happens, though, I have managed to create a reasonable approximation of the wraithverge using the Doom Alpha "Evil Scepter" (via Lee Killough) and Doom "Release" version lost souls; have a look in this thread if you're interested; (it includes a test map).
Locked

Return to “GZDoom”