Kick Stamina

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!)
Post Reply
YeeTee2
Posts: 29
Joined: Sun Feb 07, 2021 1:36 pm

Kick Stamina

Post by YeeTee2 »

How would I add stamina to this kick? I'm not great at Zscript or Decorate.
Attachments
kick.pk3
(89.81 KiB) Downloaded 19 times
Jarewill
 
 
Posts: 1855
Joined: Sun Jul 21, 2019 8:54 am

Re: Kick Stamina

Post by Jarewill »

You'd have to define a stamina actor first. Something like this:

Code: Select all

ACTOR StaminaActor : Inventory
{
    Inventory.MaxAmount 20 //Replace 20 with maximum stamina for the player
}
And then modify the Kick script to check for the stamina actor and take away an amount of it:
Spoiler:
You will also need a script to restore stamina to the player. (Unless it's supposed to be restored another way) This script does that:
Spoiler:
YeeTee2
Posts: 29
Joined: Sun Feb 07, 2021 1:36 pm

Re: Kick Stamina

Post by YeeTee2 »

That was very simple, thank you!
YeeTee2
Posts: 29
Joined: Sun Feb 07, 2021 1:36 pm

Re: Kick Stamina

Post by YeeTee2 »

So, I added it to the linked pk3, and modified it so every kick takes all stamina, and 4 seconds later stamina is completely full. It doesn't seem to work
http://www.mediafire.com/file/rel0on0la ... 2.pk3/file
Jarewill
 
 
Posts: 1855
Joined: Sun Jul 21, 2019 8:54 am

Re: Kick Stamina

Post by Jarewill »

Sorry for not specifying, that part in the Kick script had to be replaced, not added.
The scripts should look like this:
Spoiler:
Also don't forget to compile the script, you will have to press this blue arrow in upper right corner of the editor in SLADE:

You will also need to specify a path to ACC to compile it properly.
YeeTee2
Posts: 29
Joined: Sun Feb 07, 2021 1:36 pm

Re: Kick Stamina

Post by YeeTee2 »

Ah, thank you
Post Reply

Return to “Scripting”