trouble with credits shutdown and gui visibility[SOLVED]

Started by spook1, Tue 04/04/2006 20:06:13

Previous topic - Next topic

spook1

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:
Code: ags

// 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

Radiant

Well, for starters, add GUIOff commands to that sequence.

Khris

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().

spook1

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...

Code: ags

#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

strazer

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.

spook1

No I hav'nt.

The functions are created using the interaction button ;-)

SSH

I assume that the Credits themselves are actually running, though?

Any chance you could upload the source for someone to have a look?
12

spook1

Do you mean the whole game?
Where should I place it?

SSH

12

spook1

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 ;-)

SSH

Um, you need to include these files too:

ac2game.ags
ac2game.dta
acsprset.spr
editor.dat
sprindex.dat
12

Gilbert

Just what SSH said but NOT the ac2game.ags, as that's the whole game packed, and is not needed.


spook1

I chnaged the source.zip. It is complete now:

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

SSH

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.
12

spook1

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!

SSH

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?

12

SMF spam blocked by CleanTalk