Thanks, I accidentally typed in 0, instead of 1
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts Menu
function room_FirstLoad()
{
SetRestartPoint();
SetTimer(1, 1);
}
function room_RepExec()
{
if (IsTimerExpired(1))
{
int ran=Random(3);
if (ran == 0)
{
HallRan=true;
aGrandfather_Clock.Play(eAudioPriorityLow, eRepeat);
Wait(20);
cMaid.Say("Looks like I don't have to wind up the grandfather clock.");
ClockPlaying=true;
Wait(20);
blink();
cMaid.Say("Now which cup did the chef ask for?");
cMaid.Walk(140, 190, eBlock);
cMaid.FaceDirection(eDirectionRight, eBlock);
Wait(40);
oPinkCup.Visible=false;
cMaid.Say("That's the one!");
Wait(20);
cMaid.Say("Now isn't there another thing the chef asked for?");
blink();
oVase.Visible=false;
Wait(20);
cMaid.Walk(257, 195, eBlock);
cMaid.Say("Now I'm ready to go to the chef.");
if (DifficultyEasy)
{
mouse.Mode=eModePointer;
gNotebook.Visible=true;
}
}
function room_AfterFadeIn()
{
mouse.Mode=eModePointer;
gNotebook.Visible=true;
if (!gNotebook.Visible) player.Walk(180, 170, eBlock, eAnywhere);
}
function on_key_press(eKeyCode keycode)
{
if (gNotebook.Visible)
{
if ((keycode == eKeyN) &&
(DifficultyEasy))
{
gNotebook.Visible=false;
}
else
{
if ((keycode == eKeyEscape) && gRestartYN.Visible) {
//Use ESC to cancel restart.
gRestartYN.Visible = false;
gIconbar.Visible = true;
// If the panel's not ON, then the player must have gotten here by tapping F9,
// therefore his cursor needs restoring. If the panel IS on, then it doesn't,
// because it's already a pointer. Get used to thinking like this!!
if (!gPanel.Visible) mouse.UseDefaultGraphic();
return;
}
if ((keycode == eKeyEscape) && gPanel.Visible) {
// Use ESC to turn the panel off.
gPanel.Visible = false;
mouse.UseDefaultGraphic();
gIconbar.Visible = true;
return;
}
if ((keycode == eKeyEscape) && (gSaveGame.Visible))
{
// Use ESC to close the save game dialog
close_save_game_dialog();
return;
}
if ((keycode == eKeyEscape) && (gRestoreGame.Visible))
{
// Use ESC to close the restore game dialog
close_restore_game_dialog();
return;
}
if (keycode == eKeyReturn) {
// ENTER, in this case merely confirms restart
if (gRestartYN.Visible) RestartGame();
}
// FUNCTION KEYS AND SYSTEM SHORTCUTS
if (keycode == eKeyEscape) {
// ESC
gPanel.Visible = true;
gIconbar.Visible = false;
mouse.UseModeGraphic(eModePointer);
}
if (keycode == eKeyCtrlQ) QuitGame(1); // Ctrl-Q
if (keycode == eKeyF5) show_save_game_dialog(); // F5
if (keycode == eKeyF7) show_restore_game_dialog(); // F7
if (keycode == eKeyF9) {
// F9, asks the player to confirm restarting (so much better to always confirm first)
gRestartYN.Visible = true;
gIconbar.Visible = false;
mouse.UseModeGraphic(eModePointer);
}
if (keycode == eKeyF12) SaveScreenShot("scrnshot.bmp"); // F12
if (keycode == eKeyTab) show_inventory_window(); // Tab, show inventory
}
// GAME COMMAND SHORTCUTS
if (keycode == 'W') mouse.Mode=eModeWalkto; //Notice this alternate way to indicate keycodes.
if (keycode == 'L') mouse.Mode=eModeLookat; //Note that all we do here is set modes.
if (keycode == 'U') mouse.Mode=eModeInteract; //If you want something else to happen, such as GUI buttons highlighting,
if (keycode == 'T') mouse.Mode=eModeTalkto; //you'll need some more scripting done.
if (keycode == 'I') mouse.Mode=eModeUseinv; //But this will, as-is, give you some standard keyboard shortcuts your players will very much appreciate.
// For extra cursor modes, such as pick up, feel free to add as you will.
// Uncomment the line below if you use the "Pick Up" mode.
//if (keycode == 'P' || keycode == 'G') mouse.Mode=eModePickup;
// DEBUG FUNCTIONS
if (keycode == eKeyCtrlS) Debug(0,0); // Ctrl-S, give all inventory
if (keycode == eKeyCtrlV) Debug(1,0); // Ctrl-V, version
if (keycode == eKeyCtrlA) Debug(2,0); // Ctrl-A, show walkable areas
if (keycode == eKeyCtrlX) Debug(3,0); // Ctrl-X, teleport to room
if (keycode == eKeyCtrlW && game.debug_mode)
player.PlaceOnWalkableArea(); //Ctrl-W, move to walkable area
}
}
if ((keycode == eKeyN) &&
(DifficultyEasy))
{
gNotebook.Visible=!gNotebook.Visible;
}
function on_key_press(eKeyCode keycode) {
// The following is called before "if game is paused keycode=0", so
// it'll happen even when the game is paused.
if ((keycode == eKeyEscape) && gRestartYN.Visible) {
//Use ESC to cancel restart.
gRestartYN.Visible = false;
gIconbar.Visible = true;
// If the panel's not ON, then the player must have gotten here by tapping F9,
// therefore his cursor needs restoring. If the panel IS on, then it doesn't,
// because it's already a pointer. Get used to thinking like this!!
if (!gPanel.Visible) mouse.UseDefaultGraphic();
return;
}
if ((keycode == eKeyEscape) && gPanel.Visible) {
// Use ESC to turn the panel off.
gPanel.Visible = false;
mouse.UseDefaultGraphic();
gIconbar.Visible = true;
return;
}
if ((keycode == eKeyEscape) && (gSaveGame.Visible))
{
// Use ESC to close the save game dialog
close_save_game_dialog();
return;
}
if ((keycode == eKeyEscape) && (gRestoreGame.Visible))
{
// Use ESC to close the restore game dialog
close_restore_game_dialog();
return;
}
if (keycode == eKeyReturn) {
// ENTER, in this case merely confirms restart
if (gRestartYN.Visible) RestartGame();
}
if (IsGamePaused() || (IsInterfaceEnabled() == 0))
{
// If the game is paused with a modal GUI on the
// screen, or the player interface is disabled in
// a cut scene, ignore any keypresses.
return;
}
// FUNCTION KEYS AND SYSTEM SHORTCUTS
if (keycode == eKeyEscape) {
// ESC
gPanel.Visible = true;
gIconbar.Visible = false;
mouse.UseModeGraphic(eModePointer);
}
if (keycode == eKeyCtrlQ) QuitGame(1); // Ctrl-Q
if (keycode == eKeyF5) show_save_game_dialog(); // F5
if (keycode == eKeyF7) show_restore_game_dialog(); // F7
if (keycode == eKeyF9) {
// F9, asks the player to confirm restarting (so much better to always confirm first)
gRestartYN.Visible = true;
gIconbar.Visible = false;
mouse.UseModeGraphic(eModePointer);
}
if (keycode == eKeyF12) SaveScreenShot("scrnshot.bmp"); // F12
if (keycode == eKeyTab) show_inventory_window(); // Tab, show inventory
if ((keycode == eKeyN) &&
(DifficultyEasy))
{
if ((gNotebook.Visible) &&
(IsGamePaused()))
{
gNotebook.Visible=false;
}
else if (!gNotebook.Visible) gNotebook.Visible=true;
else
{
gNotebook.Visible=false;
}
}
// GAME COMMAND SHORTCUTS
if (keycode == 'W') mouse.Mode=eModeWalkto; //Notice this alternate way to indicate keycodes.
if (keycode == 'L') mouse.Mode=eModeLookat; //Note that all we do here is set modes.
if (keycode == 'U') mouse.Mode=eModeInteract; //If you want something else to happen, such as GUI buttons highlighting,
if (keycode == 'T') mouse.Mode=eModeTalkto; //you'll need some more scripting done.
if (keycode == 'I') mouse.Mode=eModeUseinv; //But this will, as-is, give you some standard keyboard shortcuts your players will very much appreciate.
// For extra cursor modes, such as pick up, feel free to add as you will.
// Uncomment the line below if you use the "Pick Up" mode.
//if (keycode == 'P' || keycode == 'G') mouse.Mode=eModePickup;
// DEBUG FUNCTIONS
if (keycode == eKeyCtrlS) Debug(0,0); // Ctrl-S, give all inventory
if (keycode == eKeyCtrlV) Debug(1,0); // Ctrl-V, version
if (keycode == eKeyCtrlA) Debug(2,0); // Ctrl-A, show walkable areas
if (keycode == eKeyCtrlX) Debug(3,0); // Ctrl-X, teleport to room
if (keycode == eKeyCtrlW && game.debug_mode)
player.PlaceOnWalkableArea(); //Ctrl-W, move to walkable area
}
function room_AfterFadeIn()
{
gNotebook.Visible=true;
}
function room_Load()
{
DifficultyEasy=true;
}
if ((keycode == eKeyN) &&
(DifficultyEasy))
{
if ((gNotebook.Visible) &&
(IsGamePaused()))
{
gNotebook.Visible=false;
}
else if (!gNotebook.Visible) gNotebook.Visible=true;
else
{
gNotebook.Visible=false;
}
}
if (IsGamePaused() || (IsInterfaceEnabled() == 0))
{
// If the game is paused with a modal GUI on the
// screen, or the player interface is disabled in
// a cut scene, ignore any keypresses.
return;
}
function room_AfterFadeIn()
{
gTest.Visible=true;
mouse.Mode=eModePointer;
}
if (keycode == eKeyN) gTest.Visible = !gTest.Visible;
By continuing to use this site you agree to the use of cookies. Please visit this page to see exactly how we use these.
Page created in 0.041 seconds with 14 queries.