[Zscript or DECORATE] player dash attack?

Wed Feb 09, 2022 5:43 am

I'm out of ideas how to make player dash forward a certain distance when using melee attack. Should it be Zcript and what parameters should be used or can it be done simply in decorate?
I don't have any fancy code to show whats wrong in it, since I've discarded all that I've tried.

Edit*
I found out that there is a A_RECOIL Decorate parameter, and it can be used for negative values instead of positive, will test it out. Maybe this will solve it.

Edit2*
Now it does dash, BUT the Angle is messed up, sometimes it dashes towards enemy and sometimes it takes sharp 90 degree turns away from enemy. Any idea how to solve this? Can it be done so that the dash would follow the crosshair? Here is the code

Code:
  AltFireBerserk:
    PUNG B 0 A_Recoil (-50)
    PUNG B 0 A_PlaySound("skeleton/swing")
   PUNG B 0 A_PlaySound("usefail")
    PUNG B 5 {a_overlayflags(1, pspf_flip, 1); a_overlayflags(1, pspf_mirror, 1);}
    PUNG C 5 A_Punch
    PUNG D 5 A_Punch
    PUNG C 5 A_Punch
    PUNG B 5 {a_overlayflags(1, pspf_flip, 0); a_overlayflags(1, pspf_mirror, 0);}
    PUNG B 0
    Goto Ready2

Re: [Zscript or DECORATE] player dash attack?

Sat Feb 12, 2022 1:46 pm

That is odd, it shouldn't do that.
What I assume is happening, is the weapon recoils the player forwards and it's the punch attack that jerks the camera away.
A_Punch is coded to move the player's camera in the direction of the enemy hit.
If you want it to not do that, you will have to use A_CustomPunch with the CPF_NOTURN flag instead.

Re: [Zscript or DECORATE] player dash attack?

Sun Feb 13, 2022 4:46 am

Not sure how helpful this would be, but a simple "dash" could use something alogn this line:
Code:
   TNT1 A 0 A_ChangeVelocity(25,0,0,CVF_RELATIVE | CVF_REPLACE)

Note that probably you'd need to change Z speed as well, since being on the ground tends to greatly reduce horizontal speed.
(This is actually code for a charge attack, a copy from a weapon that duplicates lost soul attack)

Re: [Zscript or DECORATE] player dash attack?

Mon Feb 14, 2022 3:55 pm

nakkemake wrote:I'm out of ideas how to make player dash forward a certain distance when using melee attack. Should it be Zcript and what parameters should be used or can it be done simply in decorate?

The only way I can think of doing this, is by doing it in ZScript and using a custom action that sets the player actor's bSkullFly flag to true. That's the Lost Soul and Maulotaur's charge flag. What this does is propel the actor forward at the speed of your choosing, and disables all actions until it collides with an obstacle (sort of making the actor into a temporary projectile), at which point it will call bool Slam(Actor victim), which you can customize to your liking.

Re: [Zscript or DECORATE] player dash attack?

Fri Feb 18, 2022 1:03 pm

I implemented A_ChangeVelocity and CPF_NOTURN. It works somewhat better, 90% of the time no random sidebounce versus just "recoil decorate command" 50% of the time random bounce. bSkullfly sound intriguing so I have to try that aswell.

Thanks!