Disable console log when starting gzDoom?

Moderator: GZDoom Developers

User avatar
Rachael
Posts: 13558
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: Disable console log when starting gzDoom?

Post by Rachael »

What they really want is something I don't think we could do, even if we wanted to: They want you to just change random() to be floating point.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49067
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Disable console log when starting gzDoom?

Post by Graf Zahl »

No, we couldn't. It'd throw off any mod expecting an integer return, even if some fractional number gets passed in by accident.
Note that the warning only appears outside developer mode if a floating point constant gets passed, because that can be assumed to be an error in the vast majority of cases. Here it certainly is.
User avatar
Enjay
 
 
Posts: 26534
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: Disable console log when starting gzDoom?

Post by Enjay »

Graf Zahl wrote:I find it astounding how many people made this mistake with the random() function
I can easily understand how that happened though. I think that the reason is that, to a layman/non-programmer, "random" sounds exactly like what they want. Many of the people dabbling in DECORATE or ACS have minimal or no programming background and rely on looking at examples or figuring stuff out as they go - so when something seems to work, that's good enough.

So they type in something like random(1.0, 3.0) [perhaps having copied/pasted the code from another mod or example] to try to get any fractional value between 1.0 and 3.0 or maybe just think that writing it like that is correct to get either 1, 2 or 3 generated. The layman may not ever really appreciate that 1 and 1.0 carry a different data-type meaning.

With the incorrect format, earlier versions of (G)ZDoom would not spit out an error and the modder may simply have been unaware that "random" was not doing what they thought; perhaps because it was probably doing something close enough to what they wanted (and possibly did for a very long time). Our layman had also probably never heard of frandom [because, unlike random, it's not a real word, and even looks like a typo] and never seen it in an example - because so many examples and other sources of code were also wrong.

I'm not saying that the warning should not exist; it most certainly should. I'm saying that I completely understand how the "random()" mistake became so common. Even taking all that into account, I do still agree that just how ubiquitous it became is quite amazing.
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”