Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: spook1 on Tue 04/04/2006 20:06:13

Title: trouble with credits shutdown and gui visibility[SOLVED]
Post by: spook1 on Tue 04/04/2006 20:06:13
The final room in my game (no backgroud) is used for showing the credits.

Although I set the GUIs to be not visible, and do a QuitGame after the credits are finished, I do see the GUIs and the quit game sequence is not performed.

(I go to the final page using the transport debug ctrl-x)

Any suggestions?

the code of the room is:

// room script file



#sectionstart room_aÃ,  // DO NOT EDIT OR REMOVE THIS LINE
function room_a() {
Ã,  // script for Room: Player enters room (after fadein)
Ã, 
Ã,  Credits[1].CreditStyle=eCreditScrolling;
Ã,  Credits[1].DefaultCreditColour=60000;
Ã,  Credits[1].DefaultTitleColour=15;
Ã,  Credits[1].MinY =20;
Ã,  Credits[1].StartY = 250;
Ã, 
Ã, 
Ã,  Credits[1].AddTitle("Design and scripting by");
Ã,  Credits[1].AddCredit("Dr. M.C. Koops");
Ã,  //Credits[1].AddImage(2000, eCreditCentred, eCreditAlignBelow);
Ã,  Credits[1].AddTitle("Technical Advice by");
Ã,  Credits[1].AddCredit("Ing. H.P. Verbist");
Ã,  Credits[1].AddTitle("Produced by");
Ã,  Credits[1].AddCredit("Learning Games");
Ã,  Credits[1].AddTitle("using");
Ã,  Credits[1].AddCredit("AGS");
Ã,  Credits[1].AddCredit("");
Ã, 
Ã,  Credits[1].AddCredit("");
Ã,  Credits[1].AddCredit("www.learning-games.nl");
Ã, 
Ã,  Credits[1].Run();


}
#sectionend room_aÃ,  // DO NOT EDIT OR REMOVE THIS LINE


#sectionstart room_bÃ,  // DO NOT EDIT OR REMOVE THIS LINE
function room_b() {
Ã,  // script for room: Repeatedly execute
Ã,  if (Credits[1].IsRunning() == eCreditFinished) {
Display("Game over");
QuitGame(1);
Ã,  Ã, }
}
#sectionend room_bÃ,  // DO NOT EDIT OR REMOVE THIS LINE


#sectionstart room_cÃ,  // DO NOT EDIT OR REMOVE THIS LINE
function room_c() {
Ã,  // script for room: Player enters screen (before fadein)
gHeartbeat.Visible = false;
gSimlektogui.Visible = false;
mouse.Visible = false;
}
#sectionend room_aÃ,  // DO NOT EDIT OR REMOVE THIS LINE
Title: Re: trouble with drecits shutdown and gui visibility
Post by: Radiant on Wed 05/04/2006 00:19:52
Well, for starters, add GUIOff commands to that sequence.
Title: Re: trouble with drecits shutdown and gui visibility
Post by: Khris on Wed 05/04/2006 01:09:26
He did. (The new function is called GUI.Visible)

Maybe before fadein isn't working properly when you jump to the room via ctrl-x, try testing it with player.ChangeRoom().
Title: Re: trouble with credits shutdown and gui visibility
Post by: spook1 on Wed 05/04/2006 12:42:02
tried it, but also when I finish the game in the regular way (cEgo.changeroom()) the second GUI (gSimlektogui) stays visible, as well as the Mouse.
The game does not shut down...


#sectionstart room_bÃ,  // DO NOT EDIT OR REMOVE THIS LINE
function room_b() {
Ã,  // script for room: Repeatedly execute
Ã,  if (Credits[1].IsRunning() == eCreditFinished) {
Display("Game over");
QuitGame(1);
Ã,  Ã, }
}
#sectionend room_bÃ,  // DO NOT EDIT OR REMOVE THIS LINE


#sectionstart room_cÃ,  // DO NOT EDIT OR REMOVE THIS LINE
function room_c() {
Ã,  // script for room: Player enters screen (before fadein)
gHeartbeat.Visible = false;
gSimlektogui.Visible = false;

mouse.Visible = false;
}
#sectionend room_aÃ,  // DO NOT EDIT OR REMOVE THIS LINE
Title: Re: trouble with credits shutdown and gui visibility
Post by: strazer on Wed 05/04/2006 12:56:00
You haven't just copied the room_b and _c functions into the room script, have you?
The event functions have to be created using the interaction editor, otherwise they are not linked to the events and won't be executed.
Title: Re: trouble with credits shutdown and gui visibility
Post by: spook1 on Wed 05/04/2006 15:13:22
No I hav'nt.

The functions are created using the interaction button ;-)
Title: Re: trouble with credits shutdown and gui visibility
Post by: SSH on Wed 05/04/2006 15:39:37
I assume that the Credits themselves are actually running, though?

Any chance you could upload the source for someone to have a look?
Title: Re: trouble with credits shutdown and gui visibility
Post by: spook1 on Wed 05/04/2006 16:32:01
Do you mean the whole game?
Where should I place it?
Title: Re: trouble with credits shutdown and gui visibility
Post by: SSH on Wed 05/04/2006 16:43:51
Use the AGS uploader: http://www.adventuregamestudio.co.uk/yabb/index.php?topic=22428.0

Except it is broken. If it zips to less than 1M try http://www.2dadventure.com/ags/upload/upload.html
Title: Re: trouble with credits shutdown and gui visibility
Post by: spook1 on Wed 05/04/2006 21:13:23
I placed the whole little game (18 MB) on my server:

www.xs4all.nl/~koops/room7.zip

The problem is in room7.
room8, and 9 are rooms I tried to do other stuff, but I cannot remove them anymore. (probably I can delete the files form the directory I figure right now, but the zips are already uploaded) So please ignore the rooms that are not used.
The game is in room 1,3,4,7 ;-)
Title: Re: trouble with credits shutdown and gui visibility
Post by: SSH on Thu 06/04/2006 09:50:12
Um, you need to include these files too:

ac2game.ags
ac2game.dta
acsprset.spr
editor.dat
sprindex.dat
Title: Re: trouble with credits shutdown and gui visibility
Post by: Gilbert on Thu 06/04/2006 12:44:43
Just what SSH said but NOT the ac2game.ags, as that's the whole game packed, and is not needed.
Title: Re: trouble with credits shutdown and gui visibility
Post by: spook1 on Thu 06/04/2006 13:07:23
okidoki

The game is in dutch...
Title: Re: trouble with credits shutdown and gui visibility
Post by: spook1 on Thu 06/04/2006 14:52:52
I chnaged the source.zip. It is complete now:

www.xs4all.nl/~koops/room7.zip
Title: Re: trouble with credits shutdown and gui visibility
Post by: SSH on Thu 06/04/2006 15:34:43
Quote from: strazer on Wed 05/04/2006 12:56:00
You haven't just copied the room_b and _c functions into the room script, have you?
The event functions have to be created using the interaction editor, otherwise they are not linked to the events and won't be executed.

This IS what you did, spook1!

Go to room 7 and start the interaction editor... there is only an interaction for the After Fadein

if i added the ones for before fadein and rep_ex, it worked fine.
Title: Re: trouble with credits shutdown and gui visibility
Post by: spook1 on Thu 06/04/2006 20:01:45
Sorry, sorry sorry. I feel so stupid.
I was convinced that I had created the interactions myself.
In a copy past action from one room to another something must have gone wrong.

I had not thought of the possibility to check it so easily; just look at the interaction window as you explained.

All together, I made a stupid midtake but learned a lesson from it
Unfortunatelyu at cost of your time   :-[

thanks for helping!
Title: Re: trouble with credits shutdown and gui visibility[SOLVED]
Post by: SSH on Thu 06/04/2006 21:06:35
Don't worry about it, spook, I'm glad you're using the module and that you seem to be developing a nice-looking game, with an educational slant, maybe?