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

A_CustomMeleeAttack detail... weapon isn't hitting anything

Recommended Posts

OK so I'm adding a sword attack to something I'm working on, and obviously it's supposed to be a melee attack. However, it seems as if it's not doing squat. It was working when it was using the old A_CustomPunch but that's deprecated so I'm trying to replace it with A_CustomMeleeAttack. It's just not hitting anything though, and I can't figure out why. I've set Meleerange for both the new player pawn and the weapon itself but neither seem to be doing anything.

All of the sprites, including the player, are much larger than usual. Everything is 240 tall with a larger radius than usual, and the camera height is set for 160. The weapon sprites I'm using are derived from cutmanmike's lightsaber weapon. Any ideas?

Share this post


Link to post

Here's all the relevant DECORATE code for it, btw:

ACTOR Warrior : PlayerPawn
{
	Health 200
	Radius 64
	Height 240
	Mass 100
	Painchance 255
	Speed 3
	MeleeRange 90
	
	Player.DisplayName "Player"
	Player.StartItem "Sword"
	Player.WeaponSlot 1, Sword
    Player.AttackZOffset 64
	
	Player.ColorRange 225, 240
	Player.Colorset 0, "Green",			225, 240,  238
	Player.Colorset 1, "Yellow",		114, 129,  127
	Player.Colorset 2, "Red",			145, 160,  158
	Player.Colorset 3, "Blue",			190, 205,  203
	// Doom Legacy additions
	Player.Colorset 4, "Brown",			 67,  82,   80
	Player.Colorset 5, "Light Gray",	  9,  24,   22
	Player.Colorset 6, "Light Brown",	 74,  89,   87
	Player.Colorset 7, "Light Red",		150, 165,  163
	Player.Colorset 8, "Light Blue",	192, 207,  205
	Player.Colorset 9, "Beige",			 95, 110,  108
	Player.ViewHeight 160

	States
	{
	Spawn:
		WAR1 A -1
		Stop
	See:
		WAR1 ABCD 4
		Loop
	Melee:
	Missile:
		WAR1 F 6 BRIGHT
		WAR1 E 12
		Goto Spawn
	Pain:
		WAR1 G 4
		WAR1 G 4 A_Pain
		Goto Spawn
	Death:
		WBR1 A 6 A_PlayerSkinCheck("AltSkinDeath")
		WBR1 B 6 A_PlayerScream
		WBR1 CD 6
		WBR1 E 6 A_NoBlocking
		WBR1 FGHI 6
		WBR1 J -1
		Stop
	Burn:
		FDTH A 5 BRIGHT A_PlaySound("*burndeath")
		FDTH B 4 BRIGHT
		FDTH C 5 BRIGHT
		FDTH D 4 BRIGHT A_PlayerScream
		FDTH E 5 BRIGHT
		FDTH F 4 BRIGHT
		FDTH G 5 BRIGHT A_PlaySound("*burndeath")
		FDTH H 4 BRIGHT
		FDTH I 5 BRIGHT
		FDTH J 4 BRIGHT
		FDTH K 5 BRIGHT
		FDTH L 4 BRIGHT
		FDTH M 5 BRIGHT
		FDTH N 4 BRIGHT
		FDTH O 5 BRIGHT A_NoBlocking
		FDTH P 4 BRIGHT
		FDTH Q 5 BRIGHT
		FDTH R 4 BRIGHT
		ACLO E 35 A_CheckPlayerDone
		Wait
	AltSkinDeath:	
		PLAY H 10
		PLAY I 10 A_PlayerScream
		PLAY J 10 A_NoBlocking
		PLAY KLM 10
		PLAY N -1
		Stop
	}
}

// weapons

//Weapon: Lighsaber
//By: Cutmanmike

ACTOR Sword : Weapon 25011
{
   Inventory.PickupSound "misc/d3pickup"  
   Weapon.AmmoUse 0 
   Obituary "%o was slashed %k's Lightsaber" 
   Inventory.PickupMessage "You got the Lightsaber!"
   Meleesound "weapons/sclash"
   MeleeRange 90
   States 
   { 
   Spawn: 
      SABR G -1
      Loop
   Ready: 
      SABR A 0 A_Playsound("weapons/sidle")
      SABR A 4 A_WeaponReady 
      SABR B 4 A_WeaponReady 
      Loop 
   Deselect: 
      SABR A 1 A_Playsound("weapons/soff")
      SABR A 1 A_Lower
      Goto Deselect+1
   Select: 
      SABR A 0 A_Playsound("weapons/son")
      SABR A 1 A_Raise 
      Goto Select+1
   Fire: 
      SABR C 3 
      SABR D 3 
      SABR E 3  A_Playsound("weapons/sattack")
      SABR F 3  A_CustomMeleeAttack(random(16,32),"skeleton/melee","none",True)
	  //A_CustomPunch(80, 1, 0, 0)
      SABR E 3 
      SABR D 3 
      Goto Ready 
   } 
}

// allies

ACTOR Ally1 10100
{
	SpawnID 1
	Health 200
	Radius 64
	Height 240
	Mass 100
	Speed 25
	PainChance 255
	Species "Goodguy"
	Monster
	MeleeRange 90
	+FRIENDLY

	States
	{
	Spawn:
		WAR1 I 3 A_Look
		Loop
	See:
		WAR1 ABCDEFGHIJ 2 A_Chase
		Loop
	Melee:
		WAR1 RQPONM 1 A_FaceTarget
		WAR1 L 1 A_CustomMeleeAttack(random(1,16),"skeleton/melee","none",True)
		WAR1 K 1 A_FaceTarget
		Goto See
	Death:
		WBR1 A 2 A_NoBlocking
		WBR1 BCDEFGHIJ 2
		Stop
	}
}

// enemies

ACTOR Enemy1 10200
{
	SpawnID 1
	Health 200
	Radius 64
	Height 240
	Mass 100
	Speed 25
	PainChance 255
	Species "Badguy"
	Monster
	MeleeRange 90
	Translation 2
	Obituary "%o was killed by an enemy knight."
	
	States
	{
	Spawn:
		WAR1 I 3 A_Look
		Loop
	See:
		WAR1 ABCDEFGHIJ 2 A_Chase
		Loop
	Melee:
		WAR1 RQPONM 1 A_FaceTarget
		WAR1 L 1 A_CustomMeleeAttack(random(1,16),"skeleton/melee","none",True)
		WAR1 K 1 A_FaceTarget
		Goto See
	Death:
		WBR1 A 2 A_NoBlocking
		WBR1 BCDEFGHIJ 2
		Stop
	}
}

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
×