Jump to content


Photo

TUVAZ detection!


  • Please log in to reply
7 replies to this topic

#1 Big J

Big J

    GMC Member

  • GMC Member
  • 2848 posts
  • Version:GM8.1

Posted 01 November 2011 - 09:43 AM

This is something I came up with while implementing mouse_wheel_down() and mouse_wheel_up() for Game Maker 7 in this topic.
/*
    tuvaz_check()
    by Big J
    simplified by torigara
    This script will throw an error
    if "Treat uninitialized variables as zero"
    is enabled in Global Game Settings.
    Call it once at the beginning of the game.
*/
if (variable_global_exists(""))
{
    show_error("Uninitialized variables are treated as zero! "
    + "Uncheck the box for it in Global Game Settings --> Errors. "
    + "This is worse than division by zero.", true);
}

Old overcomplicated script:
Spoiler

Feel free to use it with or without giving credit, modify it any way you like, I don't care. Whatever you do, just put an end to "Treat uninitialized variables as zero" AKA "TUVAZ"! :yucky:

Posted Image

Edited by Big J, 15 December 2011 - 10:47 AM.

  • 3

#2 IceMetalPunk

IceMetalPunk

    InfiniteIMPerfection

  • Retired Staff
  • 9322 posts
  • Version:Unknown

Posted 01 November 2011 - 07:06 PM

I approve this message :) .

-IMP
  • 0

#3 torigara

torigara

    GMC Member

  • GMC Member
  • 6507 posts

Posted 01 November 2011 - 11:44 PM

Can't this be enough:
if (variable_global_exists("")) { /*blah*/ }
Any string that is invalid as a variable name would work.
  • 0

#4 Big J

Big J

    GMC Member

  • GMC Member
  • 2848 posts
  • Version:GM8.1

Posted 01 November 2011 - 11:55 PM

Yes, you are right. I was assuming that I had to check for a variable with a valid name, I hadn't thought of trying an empty string, good one! :biggrin: This is really just a work-around for a bug feature in Game Maker.

Edited by Big J, 02 November 2011 - 12:15 AM.

  • 1

#5 Davve

Davve

    GMC Member

  • GMC Member
  • 4006 posts
  • Version:GM:Studio

Posted 21 December 2011 - 10:37 PM

This could be useful for rare situations (such as when releasing an open source engine that the user is expected to fiddle around with) and TUVAZ has caused me a lot of pain, so I definitely approve this!
  • 0

#6 LukePattinson1

LukePattinson1

    GMC Member

  • New Member
  • 24 posts
  • Version:GM8

Posted 23 April 2012 - 09:30 AM

What's wrong with TUVAZ? I've never had a problem with it.

...

*sarcasm*
  • 0

#7 Silver Scratch

Silver Scratch

    GMC Member

  • GMC Member
  • 166 posts
  • Version:GM8

Posted 23 April 2012 - 10:20 AM

I'll totally try out the script Lol~~!
:Trollface:
  • 0

#8 Big J

Big J

    GMC Member

  • GMC Member
  • 2848 posts
  • Version:GM8.1

Posted 23 April 2012 - 10:31 AM

I'll totally try out the script Lol~~!
Posted Image

Fixed. :D
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users