GUI problem

This is a public forum, where you can find out everything you wanted to know about making games. Please don't use this forum as a place to recruit new members.

Moderators: adeyke, VampD3, eriqchang, Angelus3K

Post Reply
Message
Author
Sadistyk
Peasant Status
Posts: 11
Joined: Tue Apr 06, 2004 4:37 am
Location: Argentina
Contact:

GUI problem

#1 Post by Sadistyk » Tue Mar 01, 2005 12:24 am

Hi. I was trying to make a Day Night GUI, but it seems that the code that I put in the global Repeatedly_Execute section it's in some kind of way blocking the game, because when I run it, I can't move the character, but I can iteract with the other GUIs.
 Let me explain my idea. I've created a GUI with a black background that it's set to 100 transparency, and when 5 minutes have passed, the transparency changes to 90, 80, 70 all the way to 50, where it returns to 60, 70, 80 all the way to 100 again, being 50 the darkest the gui will get (midnight). All this using global ints and the SetTimer function. The global int it's on 1 and the GUI is on, and the GUI it's set to not be clickeable.

Here's the code. If anyone can help me, please, do it.

Code: Select all

function repeatedly_execute() {
if (GetGlobalInt(13)==1) {
  SetGUITransparency(6, 100);
  SetTimer(1, 12000);
  SetGlobalInt(13, 2);
}
else if (GetGlobalInt(13)==2) {
  if (IsTimerExpired(1)==1) {
    SetGUITransparency(6, 90);
    SetTimer(2, 12000);
    SetGlobalInt(13, 3);
  }
}
else if (GetGlobalInt(13)==3) {
  if (IsTimerExpired(2)==1) {
    SetGUITransparency(6, 80);
    SetTimer(3, 12000);
    SetGlobalInt(13, 4);
  }
}
else if (GetGlobalInt(13)==4) {
  if (IsTimerExpired(3)==1) {
    SetGUITransparency(6, 70);
    SetTimer(4, 12000);
    SetGlobalInt(13, 5);
  }
}
else if (GetGlobalInt(13)==5) {
  if (IsTimerExpired(4)==1) {
    SetGUITransparency(6, 60);
    SetTimer(5, 12000);
    SetGlobalInt(13, 6);
  }
}
else if (GetGlobalInt(13)==6) {
  if (IsTimerExpired(5)==1) {
    SetGUITransparency(6, 50);
    SetTimer(6, 12000);
    SetGlobalInt(13, 7);
  }
}
else if (GetGlobalInt(13)==7) {
  if (IsTimerExpired(6)==1) {
    SetGUITransparency(6, 60);
    SetTimer(7, 12000);
    SetGlobalInt(13, 8);
  }
}
else if (GetGlobalInt(13)==8) {
  if (IsTimerExpired(7)==1) {
    SetGUITransparency(6, 70);
    SetTimer(8, 12000);
    SetGlobalInt(13, 9);
  }
}
else if (GetGlobalInt(13)==9) {
  if (IsTimerExpired(8)==1) {
    SetGUITransparency(6, 80);
    SetTimer(9, 12000);
    SetGlobalInt(13, 10);
  }
}
else if (GetGlobalInt(13)==10) {
  if (IsTimerExpired(9)==1) {
    SetGUITransparency(6, 90);
    SetTimer(10, 12000);
    SetGlobalInt(13, 1);
  }
}
}
P.S.:sorry for the mistakes, my english it's not the best.

Post Reply