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

Can't make a melee weapon pushback enemies

Recommended Posts

Hi people. In gzdoom, I was trying to modify cleric's mace weapon from Hexen in DECORATE by making it push back enemies like the fighter's fists. I tried making use of "Weapon.pushback" but it doesn't seem to have any effect regardless of the value assigned to it.

 

I modified mace by making a new actor called "CWeapMaceNew" that inherits from and replaces original weapon "CWeapMace".

actor CWeapMaceNew : CWeapMace replaces CWeapMace
{
	Weapon.Kickback 9999
	States
	{
		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) A_CustomPunch (random(45,55), 1, 0, "HammerPuff", 144, 0)
			CMCE F 1 Offset(8, 45)
			CMCE F 2 Offset(-8, 74)
			CMCE F 1 Offset(-20, 96)
			CMCE F 6 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
	}
}

 

What is wrong with this?

 

And before u ask. I had also provided this new weapon to cleric by adding following code in DECORATE

Actor ClericPlayerNew : ClericPlayer replaces ClericPlayer
{
	Player.WeaponSlot 1, CWeapMaceNew
	Player.WeaponSlot 2, CWeapStaff
	Player.WeaponSlot 3, CWeapFlame
	Player.WeaponSlot 4, CWeapWraithverge
	Player.StartItem "CWeapMaceNew"
}

 

Share this post


Link to post
10 hours ago, Empyre said:

You have created the weapon and the class, but are you playing as the new class?  You can't use "replaces" with player classes.

https://zdoom.org/wiki/Creating_new_player_classes

 

Forgot to mention that I have also done that. Other edited weapons are working fine tho (even the increased damage of mace is working fine) and only the kickback thing is not working.

Edited by ReaperAA

Share this post


Link to post
1 hour ago, Empyre said:

I don't know why Kickback is not working, but maybe you can fake it with A_RaduisThrust.

 

Thanks. By using it, I managed to get close to the desired kickback effect I needed.

 

For those wondering, I added this line after the line that contains "A_CustomPunch" in code provided at OP:

CMCE E 0 Offset(-11, 58) A_RadiusThrust(5000, 64, RTF_NOIMPACTDAMAGE)

 

Share this post


Link to post

I would recommend finding a different solution than A_CustomPunch. The melee attack functions for Hexen's weapons actually perform hitscan checks in a 45 degree cone around the player, unlike A_CustomPunch which (I believe) only fires one hitscan check straight ahead. So the results don't feel the same.

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
×