Custom Credits Not Working [SOLVED]

Started by Cogliostro, Sat 16/06/2018 16:41:39

Previous topic - Next topic

Cogliostro

Okay, I wasn't happy with any of the modules/pug-ins for credits, so I made my own.  Somewhere along the line it stopped working and I didn't notice.  Now I cannot figure out what went wrong?!

For troubleshooting purposes, I set the background of my gCredit from transparent to BLUE.  Then I installed a couple of checks, TEST A thru D to make sure that I wasn't moving the GUI on accident.

Between Tests C & D the GUI turns goes transparent/disappears/moves - I didn't know?!

So I created the ResetCredit function, and added the lines to run it.

The screen starts, the GUI background image is set, and then it all disappears between test C & D?!  Keep in mind the position of the GUI never wavers.  Also, the ResetCredit function which worked fine to initially set the background image, does nothing on any of the subsequent runs.

I REM'ed out the repeatedly_execute_always() to see if THAT was giving me grief, and nothing.  The GUI still disappears.

Went into the GUI, checked controls 0 thru 4, (they are labels), and NONE of them are locked.  The GUI covers the entire screen.

Any ideas?

- Cogliostro.

Code: ags

// room script file

String RollCredits[5];
short Number;
int OrgPosition=500;
  
function room_Load()
{
  gBox.Visible=false;
  gGear.Visible=false;
  Mouse.Visible=false;

  aGreek.Play();
  gCredits.Visible=true;
  
  Number = 1;
  RollCredits[Number]=String.Format("Design, Story, Scripting, & Graphics:[Cogliostro");
  Number++;
  RollCredits[Number]=String.Format("AGS Game Engine:[Chris Jones");
  Number++;
  RollCredits[Number]=String.Format("");
  Number++;
  RollCredits[Number]=String.Format("Thank you for playing!");
  Number++;
  RollCredits[Number]=String.Format("");
 
  gCredits.Controls[0].X=0;
  gCredits.Controls[0].Y=OrgPosition;
}

function room_AfterFadeIn()
{
  int x=0;
  while (x<Number) {
    gCredits.Controls[0].AsLabel.Text=String.Format(RollCredits[x+1]);
    gCredits.Controls[0].TweenPosition(0.75, 0, 200, eEaseInSineTween, eBlockTween);
    Wait(10);
    gCredits.Controls[0].TweenPosition(0.75, 0, -50, eEaseInSineTween, eBlockTween);
    x++;
    gCredits.Controls[0].Y=OrgPosition;
  }
  Wait(300);
  RestartGame();
}



**********************************************
EDIT
**********************************************

Looks like the TWEEN module died.  Replacing with a newer version....  More troubleshooting later - It's not the tween module. 


A lot of troubleshooting has allowed me to eliminate a bunch of possible causes.  The code as it is currently represented shows the problem.  If I do anything that causes a delay in the LOOP - WHILE (lines 47-59) it causes the GUI to disappear: either a wait command or a eBlock.
"First things first, but not necessarily in that order." - Dr. Who

Cogliostro

#1
Solution = If you're working with a GUI it'll turn off during BLOCK commands or while the code is waiting?!  I set it off screen and to ALWAYS on.  Issue resolved.

- Cogliostro
"First things first, but not necessarily in that order." - Dr. Who

SMF spam blocked by CleanTalk