Intro Scripting Problems

Started by ZZjZmoz, Mon 18/08/2003 20:00:29

Previous topic - Next topic

ZZjZmoz

I tried using the code I made below to animate the intro, using 5 background images, 3 hotspots (new/load/quit), and a character, the evil villain. This is how it goes:

1. It starts with a background with a red circle, then animates to display the title (Frames 1-3), then the evil villain moves to the left from the right, than stops in the circle, kind of like the James Bond bullet barrel intro in every movie.

2. Then, I display the next frame (4) showing his name and he says "that's me."

3. Then, it goes to frame 5, which has the New/Load/Quit buttons and I reactivate the hotspots.

4. Next, the villain will tell you to make a choice and Auto-Quit if you don't make a choice within 20 sec. At the end of 20 sec., the game auto-quits. Otherwise, the next action performed is the one that will occur (New/Load/Quit).

5. Finally, depending on the chosen action, the Villain says something, then moves off screen and disappears.

However, when I test it, it acts as if the script had never existed and just runs the background frames 1-5 over and over. What should I do to fix this?



// room script file
function game_start()
{
SetGlobalInt(1,0);
SetGlobalInt(2,0);


if (GetGlobalInt(1)==0)
{
DisableHotspot(1);
DisableHotspot(2);
DisableHotspot(3);
Wait(80);
SetBackgroundFrame(2);
Wait(80);
SetBackgroundFrame(3);
Wait(80);
MoveCharacterBlocking(EVIL, 165, 158, 1);
SetBackgroundFrame(4);
DisplaySpeech(EVIL, "That's me!");
Wait(80);
SetBackgroundFrame(5);
EnableHotspot(1);
EnableHotspot(2);
EnableHotspot(3);
SetGlobalInt(1,1);
SetGlobalInt(2,1);
}

if (GetGlobalInt(2)==1)
{
Wait(40);
DisplaySpeech(EVIL, "Go on. Make a selection.");
Wait(200);
DisplaySpeech(EVIL, "C'mon. Make a selection.");
Wait(200);
DisplaySpeech(EVIL, "I'll give you 20 seconds to make a selection.");
Wait(200);
DisplaySpeech(EVIL, "15");
Wait(200);
DisplaySpeech(EVIL, "10");
Wait(200);
DisplaySpeech(EVIL, "5");
Wait(200);
 if(GetGlobalInt(3)==0)
 {
 DisplaySpeech(EVIL, "Too late.");
 DisplaySpeech(EVIL, "Goodbye.");
 DisplaySpeech(EVIL, "SHAZAMM!!!");
 QuitGame(0);
 }
 else
 {
   if(GetGlobalInt(3)==1)
   {
   DisplaySpeech(EVIL, "Okay. Good Choice. I'll go run the intro.");
   MoveCharacterBlocking(EVIL, 50, 158, 1);
   NewRoom(1);
   SetGlobalInt(2,1);
   }
   else if(GetGlobalInt(3)==2)
   {
   DisplaySpeech(EVIL, "Okay. Let's hit the gallery.");
   MoveCharacterBlocking(EVIL, 50, 158, 1);
   RestoreGameDialog();
   SetGlobalInt(2,1);
   }
   else if(GetGlobalInt(3)==3)
   {
   DisplaySpeech(EVIL, "Okay, sissy boy/girl/it. Fine. I'll let you leave...");
   Wait(50);
   DisplaySpeech(EVIL, "For now. HAHAHA!!!");
   MoveCharacterBlocking(EVIL, 50, 158, 1);
   SetGlobalInt(2,1);
   QuitGame(0);
   }
 }
}
}
function hotspot3_a() {
 // script for hotspot3: Interact hotspot
 SetGlobalInt(3,1);
}

function hotspot2_a() {
 // script for hotspot2: Interact hotspot
 SetGlobalInt(3,2);
}

function hotspot3_b() {
 // script for hotspot3: Interact hotspot
 SetGlobalInt(3,3);
}

function hotspot1_a() {
 // script for hotspot1: Interact hotspot
 SetGlobalInt(3,1);  
}

function hotspot1_b() {
 // script for hotspot1: Interact hotspot
 SetGlobalInt(3,1);  
}



Please help!

Released Late August 2007

Ishmael

I think that dont belong to the game_start... It belongs to the room interaction "Player enters screen (after fadein)"... and using those Wait's will make the game pause, so the mouse click wont perhaps be noticed by the game...
I used to make games but then I took an IRC in the knee.

<Calin> Ishmael looks awesome all the time
\( Ö)/ ¬(Ö ) | Ja minähän en keskellä kirkasta päivää lähden minnekään juoksentelemaan ilman housuja.

SMF spam blocked by CleanTalk