IMin, IMax, FMin, and FMax

Moderator: GZDoom Developers

Post Reply
User avatar
Major Cooke
Posts: 8212
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:

IMin, IMax, FMin, and FMax

Post by Major Cooke »

Pull Request

Simply put, these four functions get the minimum or maximum of the entered integer/floating numbers. Like (f)randompick, you can input as many values as you like.

And for those of you wondering why it's called 'imin/imax', it's because of conflicts with actor.txt. I.e. A_SetRipperMin(int min) causes zdoom to fail start-up. So, it has to be something else. I settled with imin/imax to indicate integer.
Attachments
test.pk3
Summon MCD. Spews out a few numbers, the last two are the lowest and highest (min/max) respectively.
(7.67 KiB) Downloaded 110 times
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49234
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: IMin, IMax, FMin, and FMax

Post by Graf Zahl »

This makes me think that using tokens for function names is a very bad idea that will put new restrictions on the parser for each new function that's getting added.
But in any case: I believe this falls unter 'no new DECORATE functions outside the scripting branch' so I'll leave the decision to Randi.
User avatar
Major Cooke
Posts: 8212
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: IMin, IMax, FMin, and FMax

Post by Major Cooke »

By functions he means things like IsPointerEqual and CheckClass, I think. And that's because randi was forced to overhaul it entirely, whereas randompick he had nothing to change.
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”