Give ZScript access to isFast() and isSlow()

Remember, just because you request it, that doesn't mean you'll get it.

Moderator: GZDoom Developers

User avatar
Arctangent
Posts: 1235
Joined: Thu Nov 06, 2014 1:53 pm
Contact:

Give ZScript access to isFast() and isSlow()

Post by Arctangent »

I feel like this is a bit self-explanatory, and I feel like the fact that ZScript doesn't already have access to these functions is just an oversight given how much ZDoom already allows in terms of extending the fast and slow monsters settings. Granted, isSlow() might be a little niche compared to isFast(), but that goes for the slow monsters setting in general and this'd be nice for the handful of mods that'll end up using it.
User avatar
Major Cooke
Posts: 8214
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support
Location: GZBoomer Town
Contact:

Re: Give ZScript access to isFast() and isSlow()

Post by Major Cooke »

You can already access the state directly to retrieve the booleans.

(Note, I haven't tested this code.)

Code: Select all

let s = CurState;
if (s && s.bSlow)
// ...
Likewise, bFast is the boolean for fast.
User avatar
Arctangent
Posts: 1235
Joined: Thu Nov 06, 2014 1:53 pm
Contact:

Re: Give ZScript access to isFast() and isSlow()

Post by Arctangent »

That checks the Fast / Slow state flag, not whether or not the actor itself is fast or slow.
User avatar
Major Cooke
Posts: 8214
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support
Location: GZBoomer Town
Contact:

Re: Give ZScript access to isFast() and isSlow()

Post by Major Cooke »

Ah, you mean to also include the skill config then. I see.
Post Reply

Return to “Feature Suggestions [GZDoom]”