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

EDF Custom Scratch Damage Formula Help

Recommended Posts

I'm working on resources for a MBF-Boom mapset. There's a new mid-tier melee enemy that uses the Revenant punch, but I want it do a bit more damage in more advanced source ports. This is my first time delving into Eternity.

I've been trying to get a an enemy melee attack damage formula to work in Eternity over the past day and I'm having a hard time understanding how to build the custom melee damage formula. I can get static damage to work, but not the custom damage formula I want to use. I want the melee attack to deal between 9-72 damage, formula is (random(1, 8) * 9. Very simple to do in Decorate with the A_CustomMeleeAttack codepointer.

In Eternity, A_Scratch is the custom enemy attack codepointer. I check the Eternity wiki entry for A_Scratch and found that the user can assign a custom damage formula, unlike MBF. This is where I get lost and confused as I'm pointed towards A_SetCounter and A_CounterOp to create the damage formula. I'll post my attempted Eternity code below along with the Decorate code.

Eternity code:

// Too confusing. New monster replaces Light Amp Visor graphic sprite.

    PVIS E 0 A_FaceTarget
	PVIS E 4 A_SkelWhoosh
	PVIS F 4 A_FaceTarget
	PVIS G 0 A_CounterOp (1, 2, 3, 12) // 1 calls first counter, 2 calls second counter, 3 calls third counter is also considered destination
					  // 12 is hit dice roll < destination = operand1 * random(1, operand2) >
      					 // 9 = 9 * random(1, 8) // This is where I pray that it works even though it doesn't make sense.
	PVIS G 0 A_SetCounter (1, 9, 0) // (Counter, Value, Operation)
	PVIS G 0 A_SetCounter (2, 8, 0)
	PVIS G 0 A_SetCounter (3, 9, 0) // Destination, totally lost on this one. Damage is static, 9 damage only. Setting it to 0 deals no damage.
	PVIS G 4 A_Scratch (2, 3, "weapons/sawhit") // 2 = usecounter, 3 = counter which is also the destination.
    goto See

Decorate Code:

PVIS G 4 A_CustomMeleeAttack(random(1,8) * 9, "weapons/sawhit")

I have no idea what I'm doing with Eternity code, lol. I can't articulate what I'm doing with the Eternity code as I'm grasping at straws and hoping it works. The monster itself walks around and attacks but the damage is static. I'm hoping it's more simple than I'm making it out to be. Help is appreciated, thanks.

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