Zscript Change Velocity Custom Monster Attack [RESOLVED]

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Psychojack88
Posts: 53
Joined: Sat May 07, 2022 10:12 pm
Graphics Processor: nVidia (Modern GZDoom)

Zscript Change Velocity Custom Monster Attack [RESOLVED]

Post by Psychojack88 »

I'm making a custom monster that at times does a jump attack. Originally I made this in Decorate and it worked well, but what I need a ZScript equivalent. Here's the code I got at the moment, unfortunately the custom monster is not jumping upwards at all, but doing the attack well enough. Here's the current Zscript I have for the jump attack.

Code: Select all

JumpAttack:
        JUMA A 4 {A_FaceTarget(); A_SetInvulnerable() ;} //A_SetInvulnerable prevents Daisy from being interupted mid-attack. She'll float in the air otherwise.
        JUMA B 4 A_ChangeVelocity(8, 0, 3, CVF_RELATIVE);// leap forward + small hop (jump up)
        JUMA C 4 A_PlaySound ("daisy/jump"); // mid-air frame start 
		JUMA D 4 A_PlaySound ("daisy/jumpspeak"); // mid-air frames
		JUMA E 4  A_SetInvulnerable ();
        JUMA F 2 {A_ChangeVelocity(0, 0, -10, CVF_REPLACE); A_UnSetInvulnerable() ;} // controlled fall (slam down). UnsetInvulnerable makes Daisy Vulnerable to attacks again.
        JUMA G 6 A_FaceTarget();
        JUMA H 6 {A_CustomMeleeAttack(50); A_SpawnItemEx ("DaisyJumpStrike", 5);}  // slam hit
        Goto Dash;
What would I need to do to get my custom monster jumping/moving for this attack?

(Updated: Never mind, I was able to make this work fine.

Return to “Scripting”