Game Development Community

[Fixed]Dual.exe Error Nulling

by CSMP · in Torque Game Engine · 09/21/2009 (11:33 am) · 10 replies

Ok, I've got two seperate .exe files for my project, One with TMK and One without TMK.

The problem is i'm using the same exact scripts for both .exe's and I'm getting errors saying missing shaders and etc.. when using the Non-TMK.exe.

Other then actually seeing the errors I dont care for them, as I'm not loading TMK so I dont care about its errors... unless the TMK.exe is used.

I'm curious if there is an "IF" statement I can incorporate in the scripts to check if the program was loaded with the Non-TMK.exe to stop the errors from occuring when not loaded.

I'm not completely sure of any other method other then an IF statement, but even then I'm not sure how to check the .exe used.
(I'm almost sure there is enough unique info in the .exe source when compiled to tell the differances from script... but again I'm not sure what and how I would get that info)

#1
09/27/2009 (4:01 pm)
OK, I've narrowed it down to a reasonable method that I still cant quite get working:

if(getVersionString() == "MPGE Advanced(TGE 1.5.2)")
{
   echo("\c4Version Name: " @ getVersionString());

   //TMK Init code goes here...
...
...

}

I get errors on the getVersionString returning 0, but for some odd reason it returns the proper string!?

Also, the TMK code is not being properly recognized with this method.
#2
09/27/2009 (4:25 pm)
You're comparing (attempting anyway) a supposed value with that operator, which will always return '0'; try using a string comparison:
if(getVersionString() $= "MPGE Advanced(TGE 1.5.2)")
#3
09/27/2009 (4:57 pm)
LOL, I'm not so good with strings as you have probably found out lately.

Very correct at the attempting part, lmao!
#4
09/27/2009 (5:02 pm)
That was the problem (both technically).

:)
Thanks again!
#5
09/27/2009 (5:13 pm)
Quote:
BTW: "$=" is Equal To and "!=" is Not Equal To right?
Yeah, pretty much in a nutshell. I tend to think of it as
  • "==" means "VALUE is Equal To"
  • "!=" means "VALUE does Not Equal"
  • "$=" means "STRING is Equal To"
  • "$!= means "STRING does Not Equal"
  • Thinking of it that way made it easier for me to remember when I started with Torque and would get confused in a situation like this.

    It still trips me up every now and then, just like missing semi-colons and braces, but you do learn to spot the problem when it happens.

    #6
    09/28/2009 (1:57 am)
    lol, I decided not to ask because of the massive amount of help you've already supplied... but I'm glad you saw that!
    :)
    #7
    09/28/2009 (2:31 am)
    "!$=" means string does not equal, not "$!=" as Michael would have you believe ;)
    #8
    09/28/2009 (3:57 am)
    Oops! My bad! ;)
    Yeah, that should be:

    "!$=" means "does Not STRING Equals"
    For some reason that just seems/sounds awkward doesn't it :D
    #9
    09/28/2009 (4:04 am)
    Truthfully, that had been nagging me for some reason, I'm glad someone caught it, thanks Philip!
    #10
    09/28/2009 (9:31 am)
    Thanks for the help guys, makes much more sense now when I look at the scripts.