No GetPlayerProperty? How to check if the player is frozen?

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!)
GrayFace
Posts: 24
Joined: Mon Feb 13, 2023 1:34 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 7 x64
Graphics Processor: ATI/AMD with Vulkan/Metal Support

No GetPlayerProperty? How to check if the player is frozen?

Post by GrayFace »

Is there a way to check if the player is frozen? Preferably in ACS.
Bizarrely there's SetPlayerProperty, but no GetPlayerProperty.
User avatar
SPZ1
Posts: 324
Joined: Wed Aug 02, 2017 3:01 pm
Location: Illinois

Re: No GetPlayerProperty? How to check if the player is frozen?

Post by SPZ1 »

Well there is GetActorProperty but I don't think it can check to see if you are frozen. If you want that you have to modify the 'Ice' state. Here is the Ettin's 'Ice' state from the wiki:

Code: Select all

  Ice:
    ETTN R 5 A_FreezeDeath
    ETTN R 1 A_FreezeDeathChunks
    Wait
You could easily slip in a new line to run an ACS script or whatever.
User avatar
The DANDY Company
Posts: 40
Joined: Sat Jul 09, 2022 2:51 am
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia with Vulkan support
Location: Houston, TX, USA

Re: No GetPlayerProperty? How to check if the player is frozen?

Post by The DANDY Company »

I think OP is referring to PROP_FROZEN from SetPlayerProperty, not anything to do with FreezeDeath.

GrayFace, you might need to track whether the player is frozen via a global variable instead.


Andarch
The DANDY Company
Jarewill
 
 
Posts: 1805
Joined: Sun Jul 21, 2019 8:54 am

Re: No GetPlayerProperty? How to check if the player is frozen?

Post by Jarewill »

If you don't mind a little ZScript, you can also use ScriptCall like this:

Code: Select all

//In ZScript
Class FreezeChecker{
	Static bool CheckFreeze(Actor activator){
		If(!activator||!activator.player){Return false;}
		Return activator.player.cheats & CF_FROZEN;
	}
}

//In ACS
ScriptCall("FreezeChecker","CheckFreeze")

Return to “Scripting”