I have a point in my game, where after something happens I want a dialog box to appear when I get to a certain screen. Now I set a Global Int, and with the other code, my code works fine. But once I put a displayMessage, code, it displays the message no matter what the GlobalInt is set for. (I've already set it so it starts at 0 from the beginning). What's wierd is that the the scripting works perfect until I put that code in. And I know I've put it in correctly. I even tried a couple of diffrent kinds of Display scripts...the same results as the DisplayMessage.
-MillsJROSS
hmmm can you post that part of code in question here?
oops...I intended to, sorry.
Here it is before said code...
{
if (GetGlobalInt(1)==20)
{PlayMusic(3);}
{SetGlobalInt(1,10);}
}
After...
{
if (GetGlobalInt(1)==20)
{PlayMusic(3);}
{SetGlobalInt(1,10);}
{DisplayMessage(16);}
}
Hope that helps.
-MillsJROSS
hehe isn't it obvious? ;)
{
if (GetGlobalInt(1)==20)
{PlayMusic(3);
SetGlobalInt(1,10);
DisplayMessage(16);}
}
Even the old version should be:
{
if (GetGlobalInt(1)==20)
{PlayMusic(3);
SetGlobalInt(1,10);}
}
(Unless that was what you intended to do)
Thanks Gil...that did the trick. But no it wasn't so obvious...I actually had the DisplayMessage before the SetGlobalInt, and that didn't work either. I had tried making a whole seperate globalint for just the dialog, that didn't work either. But somehow this one did, and that's all I honestly care about. Thanks! You've allowed AQ to go that much further.
-MillsJROSS
The problem was not the order of the codes, it's in the braces. As you enbraced PlayMusic(3); with the full open and closed braces, so ONLT that line will be actions of that 'if' statements, the following 2 lines will not belong to the 'if' statement.
Yes, but that doesn't explain why when I made a whole diffrent set of codes for just the Displaymessage it didn't work.
Which would look similar to this
{
if (GetGlobalInt(1)==20)
{DisplayMessage(16);}
}
Hmmm... Probably because that original standalone {SetGlobalInt(1,10);} did something to it, but I cant tell as I didn't see the whole script. Anyway, it's fine that the problem was solved. :D