Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
rabidrage

CWeapMace in Doom?

Recommended Posts

Man. I am getting carried a-freaking-way with this WAD/PK3 combo I've been slaving over. Don't worry, though--it does have a good measure of confluence to it. It's just big and complex. I've got all the Doom64 weapons plus the MP40 from Brutal Doom, and a ton of monsters as well. It occurred to me that the Ettin could drop the Cleric mace from Hexen, but I can't get it to function properly. Because A_CMaceAttack doesn't mean anything in Doom, I deleted it--and the mace does no damage. It doesn't hit anything, it just swings. How do I tell ZDoom what A_CMaceAttack is?

I'm sure my WAD sounds needlessly extravagant. Don't worry--the mapping part is coming along at a good pace and when the map is finally done, I won't have time to think up any more weapons or monsters to add in.

Share this post


Link to post

ZDoom "knows" all its DECORATE functions, it doesn't matter what the IWAD is. The wiki page for A_CMaceAttack suggests that the function is restricted to the weapon CWeapMace or derived weapons. If you're not giving the player CWeapMace itself, but you redefine the weapon in DECORATE, you need to make your weapon inherit from CWeapMace, something like:

actor MyMace : CWeapMace 12345 {
   ... 
}

Share this post


Link to post

Does this mean I need a Doom editor number for the mace? I can't find it anywhere. I do want to just give the original CWeapMace.

Share this post


Link to post

1. Make sure that you've reincluded all CWeapMace sprites into your PWAD.
2. The original CWeapMace doesn't have a pickup, because Cleric already starts with it. You need to create a custom inventory that will give the weapon to the player upon pickup. You also need to include an additional pickup sprite for it. Something like this:

Actor MacePickup : CustomInventory 1234567 {
  States {
    Spawn:
      XXXX A -1 // <- insert your own custom sprite name instead of XXXX
    Pickup:
      TNT1 A 0 A_GiveInventory("CWeapMace",1)
      stop
  }
}

Share this post


Link to post

Hmm. I'll have to think more about this. I've never tried my hand at making sprites...only importing and renaming them. That being said, first I'd like to make sure the mace works when it's wielded. Right now it does no damage, but all the original sprites are present and functioning. I'm just still having trouble with that one function.

Share this post


Link to post

You should be able to find out some mace-like pickup sprite, although I can't advise you where.

rabidrage said:

Because A_CMaceAttack doesn't mean anything in Doom, I deleted it

Tell me, what exactly did you actually do?

Share this post


Link to post

I'd suggest using a weapon giver (following the example of Strife's alternate assault gun pickup) instead of a custominventory for a weapon. That way it's treated as a weapon in coop/deathmatch and other weirdo gamemodes where weapons respawn or can be picked up by everybody.

rabidrage said:

Hmm. I'll have to think more about this. I've never tried my hand at making sprites...only importing and renaming them.

When you gib an ettin, its own mace flies away, as a separate actor with its own sprite. You can use and perhaps edit a bit the mace sprite from the ettin gib.

Share this post


Link to post
scifista42 said:

You should be able to find out some mace-like pickup sprite, although I can't advise you where.
Tell me, what exactly did you actually do?


I keep changing the entry to see what might work. Right now it looks like this:

ACTOR CWeapMace : CWeapMace
{
Weapon.SelectionOrder 3500
Weapon.KickBack 150
Weapon.YAdjust -8
+BLOODSPLATTER
Obituary "$OB_MPCWEAPMACE"
Tag "$TAG_CWEAPMACE"

States
{
Select:
CMCE A 1 A_Raise
Loop
Deselect:
CMCE A 1 A_Lower
Loop
Ready:
CMCE A 1 A_WeaponReady
Loop
Fire:
CMCE B 2 Offset(60, 20)
CMCE B 1 Offset(30, 33)
CMCE B 2 Offset(8, 45)
CMCE C 1 Offset(8, 45)
CMCE D 1 Offset(8, 45)
CMCE E 1 Offset(8, 45)
CMCE E 1 Offset(-11, 58)
CMCE F 1 Offset(8, 45)
CMCE F 2 Offset(-8, 74)
CMCE F 1 Offset(-20, 96)
CMCE F 8 Offset(-33, 160)
CMCE A 2 Offset(8, 75) A_ReFire
CMCE A 1 Offset(8, 65)
CMCE A 2 Offset(8, 60)
CMCE A 1 Offset(8, 55)
CMCE A 2 Offset(8, 50)
CMCE A 1 Offset(8, 45)
Goto Ready
}
}

And that's not even loading. It was loading before. In addition, I've put all the sprites into my custom WAD and put the weapon in slot 0.

Share this post


Link to post

Changed it to this and now it loads, but no damage:

ACTOR CWeapMace2 : CWeapMace
{
Weapon.SelectionOrder 3500
Weapon.KickBack 150
Weapon.YAdjust -8
+BLOODSPLATTER
Obituary "$OB_MPCWEAPMACE"
Tag "$TAG_CWEAPMACE"

States
{
Select:
CMCE A 1 A_Raise
Loop
Deselect:
CMCE A 1 A_Lower
Loop
Ready:
CMCE A 1 A_WeaponReady
Loop
Fire:
CMCE B 2 Offset(60, 20)
CMCE B 1 Offset(30, 33)
CMCE B 2 Offset(8, 45)
CMCE C 1 Offset(8, 45)
CMCE D 1 Offset(8, 45)
CMCE E 1 Offset(8, 45)
CMCE E 1 Offset(-11, 58)
CMCE F 1 Offset(8, 45)
CMCE F 2 Offset(-8, 74)
CMCE F 1 Offset(-20, 96)
CMCE F 8 Offset(-33, 160)
CMCE A 2 Offset(8, 75) A_ReFire
CMCE A 1 Offset(8, 65)
CMCE A 2 Offset(8, 60)
CMCE A 1 Offset(8, 55)
CMCE A 2 Offset(8, 50)
CMCE A 1 Offset(8, 45)
Goto Ready
}
}

Share this post


Link to post
rabidrage said:

I keep changing the entry to see what might work.

Why are you changing the entry at all?!?!? You said you wanted to use the original CWeapMace as is. Then, you don't need to redefine its code at all, ZDoom has it already defined. ;)

Share this post


Link to post

Whoa. I am so dumb. Yeah, so I just took out everything I had put into Decorate relating to the mace, and suddenly it works. I hit 0 and change to it, and I can kill stuff. THANKS, GUYS!!

Share this post


Link to post

Oh yeah...so this brings us back to the custom pickup. I found a sprite in Samsara that could work. This is what I've typed out, but no mace is being dropped yet:

Actor MacePickup : CustomInventory 1234567
{
States
{
Spawn:
WMCE A -1 //
Pickup:
TNT1 A 0 A_GiveInventory("CWeapMace",1)
stop
}
}

I've also added this to the Ettin: DropItem "CWEAPMACE"

Share this post


Link to post
rabidrage said:

Oh yeah...so this brings us back to the custom pickup. I found a sprite in Samsara that could work. This is what I've typed out, but no mace is being dropped yet:

Actor MacePickup : CustomInventory 1234567
{
States
{
Spawn:
WMCE A -1 //
Pickup:
TNT1 A 0 A_GiveInventory("CWeapMace",1)
stop
}
}

I've also added this to the Ettin: DropItem "CWEAPMACE"


Three things:

1. Use WeaponGiver to give weapons.
2. 1234567 is far too large a number for a doomednum, since the maximum value is 32767 (that's five digits, not seven).
3. You'll want the ettins to have DropItem "MacePickup" since CWeapMace does not have a spawn state at all and therefore cannot be spawned.

Also:

rabidrage said:

ACTOR CWeapMace : CWeapMace

NEVER DO THAT! Don't try to derive an actor from itself, it's an ontological paradox. Furthermore, don't try to define actors that already exist (like CWeapMace).

Share this post


Link to post
Gez said:

2. 1234567 is far too large a number for a doomednum, since the maximum value is 32767 (that's five digits, not seven).

I didn't know this myself, sorry for giving away a confusing advice.

I thought that the other points by Gez were obvious, though. You want to drop the custom pickup thing (or weapon giver), that's why you've just created it.

Share this post


Link to post

Okay. So here's what we've got. I have them dropping the weapon and I'm able to pick it up. But now it doesn't seem to equip slot 0, so if I get it that way I can't select it. However, when I put in IDKFA and hit 0, it's equipped. What am I missing? Also, it doesn't have sounds.

Share this post


Link to post

Sounds are in Hexen (are your surprised) and their definitions are in Hexen's SNDINFO lump.

Share this post


Link to post

Not surprised at all, Gez. I dunno--considering that ZDoom doesn't need the entry changed even though I'm not loading up the Hexen WAD file, I wasn't sure how much information DID need to come out of it. So this is almost all in working order, except that picking up the dropped sprite doesn't actually give me anything...

Share this post


Link to post

So as it turns out, there are no sounds for the mace in Hexen, at least not that I can find. Nothing in the actor code points to any sounds: http://zdoom.org/wiki/Classes:CWeapMace. The SNDINFO lump has nothing pertaining to the mace at all. It's a little weird, though; when I play Hexen, the mace has sound. There just doesn't seem to be anything to reference it.

Share this post


Link to post

Open Hexen.wad in SLADE3 and find out the sounds that you heard Mace to be making, then copy them into your wad. Then find out their names in Hexen's SNDINFO and copy them into SNDINFO in your wad.

Share this post


Link to post
rabidrage said:

So as it turns out, there are no sounds for the mace in Hexen, at least not that I can find. Nothing in the actor code points to any sounds: http://zdoom.org/wiki/Classes:CWeapMace. The SNDINFO lump has nothing pertaining to the mace at all. It's a little weird, though; when I play Hexen, the mace has sound. There just doesn't seem to be anything to reference it.


You have to dig a little deeper. No sound visible on CWeapMace? Okay, but sound happens during attack, right? So let's look at its attack function: A_CMaceAttack. No mention of a sound here either, but it does say it creates HammerPuffs. And there you go, three sounds: FighterHammerHitThing, FighterHammerHitWall, and FighterHammerMiss. Get these sounds (and the puff sprites, too) and you should be good to go. Cross-reference Hexen's SNDINFO lump to find the sounds' lump names.

Share this post


Link to post

All done. Thanks. :)

Since then I've also added the Hacx Buzzer and the Strife Ceiling Turret. It's fun to add things!

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×