Code: Select all
script 2 (void)
{
ACS_Execute(222, 2, 3); // Execute script that allows terminating the cutscene early
// The 2 is this script's number, and
// the 3 is the script to execute when this one is terminated early.
SetPlayerProperty (1, 1, 0); // the player cannot move
delay(pause*2);
print(s:"Welcome visitor, please be patient for a moment.");
delay(pause*2);
print(s:"Initiating deep scan, now!");
delay(pause*2);
Ceiling_LowerByValue (30, 8, 8);
delay(pause);
Light_Fade(43, 160, pause); //slope arc
Light_Fade (30, 160, pause); //slope
int scan1fl=128;
int scan1cl=136;
int scan1flcur=0;
int scan1clcur=0;
int scan1=0;
int scan0=0;
//Sector_SetColor (37, 255, 210, 1, 0);
Light_Fade (37, 255, pause/4); //scan
for(scan0=0; scan0<2; scan0++)
{
for(scan1=128; scan1>=0; scan1--)
{
Light_Fade (37, 200, pause/4); //scan
FloorAndCeiling_LowerByValue(37, pause/8, 1);
delay(pause/8);
Light_Fade (37, 255, pause/4); //scan
}
delay(pause/4);
for(scan1=0; scan1<=128; scan1++)
{
Light_Fade (37, 200, pause/4); //scan
FloorAndCeiling_RaiseByValue(37, pause/8, 1);
delay(pause/8);
Light_Fade (37, 255, pause/4); //scan
}
}
delay(pause/2);
Light_ChangeToValue(81, 120); //room
Light_ChangeToValue(31, 120); //scan's spot
Light_ChangeToValue(37, 120); //scan 3d sector
Light_ChangeToValue(30, 120); //slope
print(s:"Scan complete.");
delay(pause);
Light_Fade (81, 140, pause*2);
Light_Fade (31, 140, pause*2);
Light_Fade (37, 140, pause*2);
Light_Fade (30, 140, pause*2);
print(s:"I'm sorry Major Falco.");
delay(pause);
print(s:"I did not know it was you, you can enter the station now.");
delay(pause);
SetPlayerProperty (1, 0, 0); // the player can move
PorteDebut = true;
hudmessage(s:" "; HUDMSG_FADEINOUT, 999, 0, 350.0, 400.0, 1.0, 1.0, 1.0);
Autosave();
}
// Cleanup after a prematurely terminated script 2
script 3 (void)
{
//place everything that the cutscene at script 2 should be at the end of it
//set any vars at the value they should all have
//set any player property back to what they should be
Floor_MoveToValue(37, 0, 128, 0);
Ceiling_MoveToValue(37, 0, 136, 0);
Light_Fade (81, 140, pause*2);
Light_Fade (31, 140, pause*2);
Light_Fade (37, 140, pause*2);
Light_Fade (30, 140, pause*2);
SetPlayerProperty (1, 0, 0); // the player can move
PorteDebut = true;
print(s:"cutscene skipped"); //confirm the player that he skipped the cutscene
Autosave();
}
// This script sits in a loop waiting for +use to be pressed.
// If +use was held down, it will be ignored until it is released and repressed.
// It takes the cutscene's script number as a parameter, so you can reuse it for any number of cutscenes.
// It also takes as parameter a script to cleanup after an incomplete cutscene.
script 222 (int scriptnum, int skipscript)
{
setfont("SMALLFONT");
HudMessage(s:"\cj Press the \cg use key \cj to skip this scene"; HUDMSG_PLAIN, 10, 0, 350.0, 400.0, 0);
while (!(GetPlayerInput(-1, INPUT_BUTTONS) & BT_USE) || (GetPlayerInput(-1, INPUT_OLDBUTTONS) & BT_USE))
{
delay(1);
}
ACS_Terminate(scriptnum);
ACS_Execute(skipscript);
}