Disabling the players "use" action

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.

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
User avatar
FFFFRRRR
Posts: 99
Joined: Sat Nov 04, 2017 3:33 am

Disabling the players "use" action

Post by FFFFRRRR »

Hi,

I have made a custom menu that the player can access ingame whenever he/she wants. It also freezes the game using PowerTimeFreeze and SetPlayerProperty().
Of course, the player can still press the "use" key to activate switches, doors or anything. Which makes sense from a technical perspective, though it doesn't make sense for the player.

I know that using Aprop_TotallyFrozen doesn't disable the "use" key. I'd like to know if there is a way to make the player unable to use something. Temporarily morphing into a class with a Player.UseRange of 0 is problematic due to inventory and user variables.
Is there a way to do this in zscript? I am very poor at it so far, so maybe there is a way there that I am unable to find.
Jarewill
 
 
Posts: 1768
Joined: Sun Jul 21, 2019 8:54 am

Re: Disabling the players "use" action

Post by Jarewill »

With ZScript you can directly modify the player's properties like you would with variables in ACS.
For example, this powerup will take away the player's ability to use [Use] and give it back once it's taken away:
Spoiler:
User avatar
FFFFRRRR
Posts: 99
Joined: Sat Nov 04, 2017 3:33 am

Re: Disabling the players "use" action

Post by FFFFRRRR »

Thats wonderful. Tested it and it works.
Many thanks!
Post Reply

Return to “Scripting”