Start screen flashing at end of intro cutscene. *SOLVED*

Started by lizzlebizzle, Mon 13/06/2011 07:11:53

Previous topic - Next topic

lizzlebizzle

So, here's a weird question. I've scoured the forums on this one, but it's buried under a number of threads, or it's not out there yet.

I'm designing my game using one of the Maniac Mansion Mania starter packs, and I'm almost finished. I'm working on my intro/outro cutscenes, and I've noticed that after I introduced an NPC character to the start of the game (who disappears soon after), the start screen pops up briefly, and then it goes back to the room my player is in.

When I say "start screen", I'm talking about that classic Maniac Mansion screen in the beginning of the game where you press "Start" and it takes you to the game.

Anywho, is there any idea what might cause this? It happens at the end of the cutscene in room 1. It's only started happening since I introduced an NPC. The NPC's start room is Room 1. Player character's start room is Start Screen. Need more details?

Thanks for the help; sorry for the noobishness. :D


Liz

Icey


Khris

We can only guess without taking a look at the codes you have in before and after fadein.

AGS changes the room if the current player character changes the room or another character is set as player. One of those two things must be happening at some point.

lizzlebizzle

Yay, here's some code. Here's the code for my "Start Screen". This is the ENTIRE room script.

Code: ags

// room script file

#sectionstart room_a  // DO NOT EDIT OR REMOVE THIS LINE
function room_a() {
  // script for room: Player enters screen (before fadein)
aMusic1.Play();
GUIOff(0);
GUIOff(1);  


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

#sectionstart hotspot2_a  // DO NOT EDIT OR REMOVE THIS LINE
function hotspot2_a() {
  // script for hotspot2: Any click on hotspot
StopMusic();
HideMouseCursor();
NewRoom(1);
  
}
#sectionend hotspot2_a  // DO NOT EDIT OR REMOVE THIS LINE



Here's "Room 1" code, before the fade-in.

Code: ags


// room script file


#sectionstart room_a  // DO NOT EDIT OR REMOVE THIS LINE
function room_a (){
  // script for room: Player enters screen (before fadein)
AudioChannel* chan = aMusic9.Play();
ShowMouseCursor();
GUIOn(0);
GUIOn(1);
player.UnlockView();
cBernhard.UnlockView();

//Cutscene
#sectionstart cutscene
FaceDirection(cBernhard.ID, DIR_LEFT);
cBernhard.Say ("...");
cBernhard.Say ("HA! Let's see you get out of this, sweet sister.");
cBritney.Say ("Bernard! Get out of my room, you weirdo!");
cBernhard.Say ("Oh, I'll get out, all right.");
cBernhard.Say ("...But good luck finding a way out.");
cBernhard.Walk (275, 135);
cBritney.Say ("What does THAT mean??");
FaceDirection(cBernhard.ID, DIR_LEFT);
cBernhard.Say ("Heh, heh.");

chan.Volume = 90;
chan.Volume = 80;

player.Say( "...");

cBritney.Say ("Seriously, you need a girlfriend.");
cBernhard.Say ("Who needs a girlfriend when I have an automatic chess board?");

chan.Volume = 70;
chan.Volume = 60;

cBernhard.Walk (307, 135);
cBernhard.ChangeRoom(3);
PlaySound(3);
oOpenDoor.Visible = false;

chan.Volume = 50;
StopMusic();
chan = aZEPPELIN.Play();


#sectionend cutscene
}

#sectionend room_a  // DO NOT EDIT OR REMOVE THIS LINE


Please keep in mind this is my very first game... :)

lizzlebizzle

Wait!! I figured it out! Oh, I'm so proud!

It was a stupid mistake. I confused my before fade-in and after fade-in scripts.

*rubs eyes* And with that, dear sirs, I'm off to bed. Thank you both!



Liz

monkey0506

#5
Seeing as you've got both the "room_a"-style room event handlers and "aMusic"-style new audio scripting, it would seem that you've updated this from a pre-3.0 version of AGS (2.72 or prior) to AGS 3.2.1. Given that, I'd like to point out that in all versions of AGS 3.0 and later you can name these room event handlers whatever you want, so long as they are properly "linked" (see the Events pane for the room, by clicking on the lightning bolt icon in the room's properties (when you have it open for editing, in the bottom corner)).

For example, if you wanted your room before fade-in handler to be called "room_BeforeFadein" and the room after fade-in handler to be called "room_AfterFadein" then you could make the following changes to your project:

- Rename the function in your roomX.asc script file.
- Rename the function in the room's Events pane, to the same name (function name only, no parenthesis or anything else).
- (possibly not needed) Make sure if you were calling the function somewhere else in the room script, that you change it to call the correct function name.
- Rebuild your game. If there's any errors that you can't figure out, make sure you've followed the above steps exactly!

This will drastically help prevent these type of issues! ;) Oh, and also you might want to consider indenting your code. Some people don't like to do it because it's not essential, but it can make it much more readable for you, and us!

Glad you got it figured out though..doing so by yourself is always the most rewarding!

Khris

As I said in the other thread, I strongly recommend to use one of the new starter packs.

You've put your own "#sectionstart cutscene" lines in your code; this serves absolutely no purpose.
If you want to allow the player to skip cutscenes, use the StartCutscene() and EndCutscene() commands.

lizzlebizzle

#7
Thanks, guys. monkE3y, you've hit the nail on the head. I'm trying to get my code to be consistent and updated with the 3.2.1 version. A couple weeks ago, this was a mish-mash of object-oriented and non-object-oriented code (painful, I know). Uh, and I dunno why I didn't indent this. Probably tired. The rest has been indented. Done and done now.

Khris, thanks for the reminder. On the MMM website, they have mostly 2.72 starter packs. They have one for Wendy that's a 3.0.2....anyway, I decided to finish this (first) game with the current starter pack and then find another, or, better yet, do my own. :) Is there a resource for more updated MMM-style starter packs?

And also, I obviously have no idea what the #blahblahstart does. I inserted that for consistency, but if it's pointless, I'll take 'em out.


lizzlebizzle

Aaaaand I just saw this thread: http://www.adventuregamestudio.co.uk/yabb/index.php?topic=37901.0

So I'll do away with #sectionstart and #sectionend all around.

SMF spam blocked by CleanTalk