Kick Stamina

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

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.

Kick Stamina

Postby YeeTee2 » Sun Feb 21, 2021 11:28 am

How would I add stamina to this kick? I'm not great at Zscript or Decorate.
You do not have the required permissions to view the files attached to this post.
YeeTee2
 
Joined: 07 Feb 2021

Re: Kick Stamina

Postby Jarewill » Sun Feb 21, 2021 12:34 pm

You'd have to define a stamina actor first. Something like this:
Code: Select allExpand view
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:
Jarewill
 
 
 
Joined: 21 Jul 2019

Re: Kick Stamina

Postby YeeTee2 » Mon Feb 22, 2021 6:58 am

That was very simple, thank you!
YeeTee2
 
Joined: 07 Feb 2021

Re: Kick Stamina

Postby YeeTee2 » Mon Feb 22, 2021 7:11 am

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
YeeTee2
 
Joined: 07 Feb 2021

Re: Kick Stamina

Postby Jarewill » Mon Feb 22, 2021 7:49 am

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.
Jarewill
 
 
 
Joined: 21 Jul 2019

Re: Kick Stamina

Postby YeeTee2 » Mon Feb 22, 2021 7:59 am

Ah, thank you
YeeTee2
 
Joined: 07 Feb 2021


Return to Scripting

Who is online

Users browsing this forum: No registered users and 0 guests