Page 1 of 1

Replacing berserk fist with another melee weapon

Posted: Fri Jan 09, 2009 16:10
by Rex Claussen
I have been looking through the ZDooM Wiki and these forums for information that will help me with the following:
  • 1. I want to replace the fist with a melee weapon (such as a lead pipe, wrench, or crowbar).
    2. I want the new weapon to have the same power as a berserk fist.
I have read this thread but want to streamline the definition. I will only be using four animation frames - the equivalent of PUNGA0, PUNGB0, PUNGC0, PUNGD0 (I will change the sprite names, of course). Simply replacing the berserk pickup with my replacement weapon will not do, as I don't want the screen turning to the red color (i.e., Powerup.Color 255,0,0,0.5).

Please tell me if the following is the way to proceed:
  • 1. I will need to create a new powerup type [e.g., PowerStrength, but minus the Powerup.Color].
    2. I will need to create the CustomInventory for the new weapon [e.g., Berserk with the modified PowerStrength minus the HealThing (100, 0)].
    3. Create a Weapon definition for the new weapon that works like the fist.
Is there a simpler way? Furthermore, where does PowerupGiver figure in all this, and will I need to create a new definition under that?

Many thanks.

Posted: Fri Jan 09, 2009 22:03
by wildweasel
Perhaps using the Tome of Power as a Berserk replacement? By doing that, you could opt to only have the fist be affected (using Weapon.SisterWeapon and the POWERED_UP flag), then define your new alternate weapon with the new frames. The only issue with that, though, is that I don't think there's a way to make it permanent; it'll still end at the end of the level.

Posted: Fri Jan 09, 2009 22:43
by Rex Claussen
I asked the same question in this thread in the ZDooM forums, and I got an answer that was consistent with what I had believed was necessary. However, I got an error message from GZDooM telling me that the native class that I defined is unknown.

Any suggestions for fixing the error?

Posted: Sat Jan 10, 2009 1:16
by Rachael
Remove the "native".

You will never need to define a native class in GZDoom. What you will probably need to do is inherit from that class. If you're trying to create a custom PowerStrength, it should look like this:

Actor PowerStrengthTwo : PowerStrength { blah blah ... etc ... }

Posted: Sun Jan 11, 2009 5:27
by Rex Claussen
Thanks for the advice.

I'm really new to DECORATE definitions, and because of the lack of coherent and comprehensive documentation I am stumbling along trying to pick up a piece here and a piece there.