[No] Disable console log when starting gzDoom?

Moderator: GZDoom Developers

Re: Disable console log when starting gzDoom?

Postby Rachael » Sat Dec 08, 2018 10:13 am

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
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle
Graphics Processor: nVidia with Vulkan support

Re: Disable console log when starting gzDoom?

Postby Graf Zahl » Sat Dec 08, 2018 11:11 am

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
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
Joined: 19 Jul 2003
Location: Germany

Re: Disable console log when starting gzDoom?

Postby Enjay » Mon Dec 10, 2018 3:53 pm

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.
User avatar
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
Joined: 15 Jul 2003
Location: Scotland


Return to Closed Feature Suggestions

Who is online

Users browsing this forum: MSN [Bot] and 1 guest