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// main global script file
#sectionstart game_start // DO NOT EDIT OR REMOVE THIS LINE
function game_start() {
// called when the game starts, before the first room is loaded
}
#sectionend game_start // DO NOT EDIT OR REMOVE THIS LINE
#sectionstart repeatedly_execute // DO NOT EDIT OR REMOVE THIS LINE
function repeatedly_execute() {
lboxLoad.FillSaveGameList();
lboxSave.FillSaveGameList();
// put anything you want to happen every game cycle here
}
#sectionend repeatedly_execute // DO NOT EDIT OR REMOVE THIS LINE
function show_inventory_window () {
// This demonstrates both types of inventory window - the first part is how to
// show the built-in inventory window, the second part uses the custom one.
// Un-comment one section or the other below.
// ** DEFAULT INVENTORY WINDOW
// InventoryScreen();
// ** CUSTOM INVENTORY WINDOW
gInventory.Visible = true;
// switch to the Use cursor (to select items with)
mouse.Mode = eModeInteract;
// But, override the appearance to look like the arrow
mouse.UseModeGraphic(eModePointer);
}
#sectionstart on_key_press // DO NOT EDIT OR REMOVE THIS LINE
function on_key_press(int keycode) {
// called when a key is pressed. keycode holds the key's ASCII code
if (IsGamePaused() == 1) keycode=0; // game paused, so don't react to keypresses
if (keycode==17) QuitGame(1); // Ctrl-Q
if (keycode==363) SaveGameDialog(); // F5
if (keycode==365) RestoreGameDialog(); // F7
if (keycode==367) RestartGame(); // F9
if (keycode==434) SaveScreenShot("scrnshot.bmp"); // F12
if (keycode==9) show_inventory_window(); // Tab, show inventory
if (keycode==19) Debug(0,0); // Ctrl-S, give all inventory
if (keycode==22) Debug(1,0); // Ctrl-V, version
if (keycode==1) Debug(2,0); // Ctrl-A, show walkable areas
if (keycode==24) Debug(3,0); // Ctrl-X, teleport to room
}
#sectionend on_key_press // DO NOT EDIT OR REMOVE THIS LINE
#sectionstart on_mouse_click // DO NOT EDIT OR REMOVE THIS LINE
function on_mouse_click(MouseButton button) {
// called when a mouse button is clicked. button is either LEFT or RIGHT
if (IsGamePaused() == 1) {
// Game is paused, so do nothing (ie. don't allow mouse click)
}
else if (button == eMouseLeft) {
ProcessClick(mouse.x, mouse.y, mouse.Mode );
}
else { // right-click, so cycle cursor
mouse.SelectNextMode();
}
}
#sectionend on_mouse_click // DO NOT EDIT OR REMOVE THIS LINE
#sectionstart interface_click // DO NOT EDIT OR REMOVE THIS LINE
function interface_click(int interface, int button) {
// This function is obsolete, from 2.62 and earlier versions.
}
#sectionend interface_click // DO NOT EDIT OR REMOVE THIS LINE
#sectionstart btnInvUp_Click // DO NOT EDIT OR REMOVE THIS LINE
function btnInvUp_Click(GUIControl *control, MouseButton button) {
invCustomInv.ScrollUp();
}
#sectionend btnInvUp_Click // DO NOT EDIT OR REMOVE THIS LINE
#sectionstart btnInvDown_Click // DO NOT EDIT OR REMOVE THIS LINE
function btnInvDown_Click(GUIControl *control, MouseButton button) {
invCustomInv.ScrollDown();
}
#sectionend btnInvDown_Click // DO NOT EDIT OR REMOVE THIS LINE
#sectionstart btnInvOK_Click // DO NOT EDIT OR REMOVE THIS LINE
function btnInvOK_Click(GUIControl *control, MouseButton button) {
// They pressed the OK button, close the GUI
gInventory.Visible = false;
mouse.UseDefaultGraphic();
}
#sectionend btnInvOK_Click // DO NOT EDIT OR REMOVE THIS LINE
#sectionstart btnInvExit_Click // DO NOT EDIT OR REMOVE THIS LINE
function btnInvExit_Click(GUIControl *control, MouseButton button) {
// They pressed the exit button, close the GUI
gInventory.Visible = false;
mouse.UseDefaultGraphic();
}
#sectionend btnInvExit_Click // DO NOT EDIT OR REMOVE THIS LINE
#sectionstart btnInvSelect_Click // DO NOT EDIT OR REMOVE THIS LINE
function btnInvSelect_Click(GUIControl *control, MouseButton button) {
// They pressed SELECT, so switch to the Get cursor
mouse.Mode = eModeInteract;
// But, override the appearance to look like the arrow
mouse.UseModeGraphic(eModePointer);
}
#sectionend btnInvSelect_Click // DO NOT EDIT OR REMOVE THIS LINE
#sectionstart btnIconInv_Click // DO NOT EDIT OR REMOVE THIS LINE
function btnIconInv_Click(GUIControl *control, MouseButton button) {
show_inventory_window();
}
#sectionend btnIconInv_Click // DO NOT EDIT OR REMOVE THIS LINE
#sectionstart btnIconCurInv_Click // DO NOT EDIT OR REMOVE THIS LINE
function btnIconCurInv_Click(GUIControl *control, MouseButton button) {
if (player.ActiveInventory != null)
mouse.Mode = eModeUseinv;
}
#sectionend btnIconCurInv_Click // DO NOT EDIT OR REMOVE THIS LINE
#sectionstart btnIconSave_Click // DO NOT EDIT OR REMOVE THIS LINE
function btnIconSave_Click(GUIControl *control, MouseButton button) {
gSave.Visible = true;
// They pressed SELECT, so switch to the Get cursor
mouse.Mode = eModeInteract;
// But, override the appearance to look like the arrow
mouse.UseModeGraphic(eModePointer);
}
#sectionend btnIconSave_Click // DO NOT EDIT OR REMOVE THIS LINE
#sectionstart btnIconLoad_Click // DO NOT EDIT OR REMOVE THIS LINE
function btnIconLoad_Click(GUIControl *control, MouseButton button) {
gLoad.Visible = true;
// They pressed SELECT, so switch to the Get cursor
mouse.Mode = eModeInteract;
// But, override the appearance to look like the arrow
mouse.UseModeGraphic(eModePointer);
}
#sectionend btnIconLoad_Click // DO NOT EDIT OR REMOVE THIS LINE
#sectionstart btnIconExit_Click // DO NOT EDIT OR REMOVE THIS LINE
function btnIconExit_Click(GUIControl *control, MouseButton button) {
gQuit.Visible = true;
// They pressed SELECT, so switch to the Get cursor
mouse.Mode = eModeInteract;
// But, override the appearance to look like the arrow
mouse.UseModeGraphic(eModePointer);
}
#sectionend btnIconExit_Click // DO NOT EDIT OR REMOVE THIS LINE
#sectionstart btnIconAbout_Click // DO NOT EDIT OR REMOVE THIS LINE
function btnIconAbout_Click(GUIControl *control, MouseButton button) {
gMenu.Visible = true;
// They pressed SELECT, so switch to the Get cursor
mouse.Mode = eModeInteract;
// But, override the appearance to look like the arrow
mouse.UseModeGraphic(eModePointer);
}
#sectionend btnIconAbout_Click // DO NOT EDIT OR REMOVE THIS LINE
#sectionstart btnQuitYes_Click // DO NOT EDIT OR REMOVE THIS LINE
function btnQuitYes_Click(GUIControl *control, MouseButton button) {
QuitGame(0);
}
#sectionend btnQuitYes_Click // DO NOT EDIT OR REMOVE THIS LINE
#sectionstart btnQuitNo_Click // DO NOT EDIT OR REMOVE THIS LINE
function btnQuitNo_Click(GUIControl *control, MouseButton button) {
gQuit.Visible = false;
}
#sectionend btnQuitNo_Click // DO NOT EDIT OR REMOVE THIS LINE
#sectionstart btnMenuExit_Click // DO NOT EDIT OR REMOVE THIS LINE
function btnMenuExit_Click(GUIControl *control, MouseButton button) {
gMenu.Visible = false;
}
#sectionend btnMenuExit_Click // DO NOT EDIT OR REMOVE THIS LINE
#sectionstart btnLoadExit_Click // DO NOT EDIT OR REMOVE THIS LINE
function btnLoadExit_Click(GUIControl *control, MouseButton button) {
gLoad.Visible = false;
}
#sectionend btnLoadExit_Click // DO NOT EDIT OR REMOVE THIS LINE
#sectionstart btnSaveExit_Click // DO NOT EDIT OR REMOVE THIS LINE
function btnSaveExit_Click(GUIControl *control, MouseButton button) {
gSave.Visible = false;
}
#sectionend btnSaveExit_Click // DO NOT EDIT OR REMOVE THIS LINE
#sectionstart sldVolume_Change // DO NOT EDIT OR REMOVE THIS LINE
function sldVolume_Change(GUIControl *control) {
sldVolume.Max = 100;
sldVolume.Min = 0;
SetMusicMasterVolume(sldVolume.Value);
}
#sectionend sldVolume_Change // DO NOT EDIT OR REMOVE THIS LINE
#sectionstart sldSpeed_Change // DO NOT EDIT OR REMOVE THIS LINE
function sldSpeed_Change(GUIControl *control) {
sldSpeed.Max = 200;
sldSpeed.Min = 40;
SetGameSpeed(sldSpeed.Value);
}
#sectionend sldSpeed_Change // DO NOT EDIT OR REMOVE THIS LINE
#sectionstart lboxLoad_SelectionChanged // DO NOT EDIT OR REMOVE THIS LINE
function lboxLoad_SelectionChanged(GUIControl *control) {
int LoadGame = lboxLoad.SelectedIndex;
Wait(5);
RestoreGameSlot(savegameindex[LoadGame]);
}
#sectionend lboxLoad_SelectionChanged // DO NOT EDIT OR REMOVE THIS LINE
#sectionstart btnSaveOk_Click // DO NOT EDIT OR REMOVE THIS LINE
function btnSaveOk_Click(GUIControl *control, MouseButton button) {
int index = lboxSave.ItemCount;
if (index < 4) {
String text = tboxSave.Text;
SaveGameSlot(index+1, text);
gSave.Visible = false;
}
else {
String text = tboxSave.Text;
int SaveGame = lboxSave.SelectedIndex;
if (SaveGame == -1) DisplayAtY (20, "Capacity reached, Select a slot to overwrite.");
else {
SaveGameSlot(savegameindex[SaveGame], text);
Wait(5);
gSave.Visible = false;
}
}
}
#sectionend btnSaveOk_Click // DO NOT EDIT OR REMOVE THIS LINE
#sectionstart lboxSave_SelectionChanged // DO NOT EDIT OR REMOVE THIS LINE
function lboxSave_SelectionChanged(GUIControl *control) {
}
#sectionend lboxSave_SelectionChanged // DO NOT EDIT OR REMOVE THIS LINE
#sectionstart tboxSave_Activate // DO NOT EDIT OR REMOVE THIS LINE
function tboxSave_Activate(GUIControl *control) {
}
#sectionend tboxSave_Activate // DO NOT EDIT OR REMOVE THIS LINE
#sectionstart btnMenuAGS_Click // DO NOT EDIT OR REMOVE THIS LINE
function btnMenuAGS_Click(GUIControl *control, MouseButton button) {
Display("Thanks to Chris Jones for creating the AGS engine.");
}
#sectionend btnMenuAGS_Click // DO NOT EDIT OR REMOVE THIS LINE
#sectionstart btnSaveOk_ClickÃ, // DO NOT EDIT OR REMOVE THIS LINE
function btnSaveOk_Click(GUIControl *control, MouseButton button) {
Ã, int index = lboxSave.ItemCount;
Ã, if (index < 4) {
Ã, Ã, String text = tboxSave.Text;
Ã, Ã, SaveGameSlot(index+1, text);
Ã, Ã, gSave.Visible = false;
Ã, }
Ã, else {
Ã, Ã, String text = tboxSave.Text;
Ã, Ã, DisplayAtY (20, "Capacity reached, Select a slot to overwrite.");
Ã, Ã, int SaveGame = lboxSave.SelectedIndex;
Ã, Ã, SaveGameSlot(SaveGame, text);
Ã, Ã, Wait(5);
Ã, Ã, gSave.Visible = false;
Ã, }
}
#sectionend btnSaveOk_ClickÃ, // DO NOT EDIT OR REMOVE THIS LINE
#sectionstart lboxLoad_SelectionChanged // DO NOT EDIT OR REMOVE THIS LINE
function lboxLoad_SelectionChanged(GUIControl *control) {
int LoadGame = lboxLoad.SelectedIndex;
Wait(5);
RestoreGameSlot(savegameindex[LoadGame]);
}
#sectionend lboxLoad_SelectionChanged // DO NOT EDIT OR REMOVE THIS LINE
#sectionstart lboxLoad_SelectionChanged // DO NOT EDIT OR REMOVE THIS LINE
function lboxLoad_SelectionChanged(GUIControl *control) {
int LoadGame = lboxLoad.SelectedIndex;
RestoreGameSlot(LoadGame);
}
#sectionend lboxLoad_SelectionChanged // DO NOT EDIT OR REMOVE THIS LINE
#sectionstart btnSaveOk_Click // DO NOT EDIT OR REMOVE THIS LINE
function btnSaveOk_Click(GUIControl *control, MouseButton button) {
String text = tboxSave.Text;
SaveGameSlot(1, text);
gSave.Visible = false;
}
#sectionend btnSaveOk_Click // DO NOT EDIT OR REMOVE THIS LINE
#sectionstart interface_clickÃ, // DO NOT EDIT OR REMOVE THIS LINE
function interface_click(int interface, int button) {
Ã, // This function is obsolete, from 2.62 and earlier versions.
}
#sectionend interface_clickÃ, // DO NOT EDIT OR REMOVE THIS LINE
#sectionstart btnInvUp_ClickÃ, // DO NOT EDIT OR REMOVE THIS LINE
function btnInvUp_Click(GUIControl *control, MouseButton button) {
Ã, invCustomInv.ScrollUp();
}
#sectionend btnInvUp_ClickÃ, // DO NOT EDIT OR REMOVE THIS LINE
#sectionstart btnInvDown_ClickÃ, // DO NOT EDIT OR REMOVE THIS LINE
function btnInvDown_Click(GUIControl *control, MouseButton button) {
Ã, invCustomInv.ScrollDown();
}
#sectionend btnInvDown_ClickÃ, // DO NOT EDIT OR REMOVE THIS LINE
#sectionstart btnInvOK_ClickÃ, // DO NOT EDIT OR REMOVE THIS LINE
function btnInvOK_Click(GUIControl *control, MouseButton button) {
Ã,Â
// They pressed the OK button, close the GUI
gInventory.Visible = false;
mouse.UseDefaultGraphic();
}
#sectionend btnInvOK_ClickÃ, // DO NOT EDIT OR REMOVE THIS LINE
#sectionstart btnInvExit_ClickÃ, // DO NOT EDIT OR REMOVE THIS LINE
function btnInvExit_Click(GUIControl *control, MouseButton button) {
Ã,Â
// They pressed the exit button, close the GUI
gInventory.Visible = false;
mouse.UseDefaultGraphic();
}
#sectionend btnInvExit_ClickÃ, // DO NOT EDIT OR REMOVE THIS LINE
#sectionstart btnInvSelect_ClickÃ, // DO NOT EDIT OR REMOVE THIS LINE
function btnInvSelect_Click(GUIControl *control, MouseButton button) {
Ã,Â
// They pressed SELECT, so switch to the Get cursor
mouse.Mode = eModeInteract;
// But, override the appearance to look like the arrow
mouse.UseModeGraphic(eModePointer);
}
#sectionend btnInvSelect_ClickÃ, // DO NOT EDIT OR REMOVE THIS LINE
#sectionstart btnIconInv_ClickÃ, // DO NOT EDIT OR REMOVE THIS LINE
function btnIconInv_Click(GUIControl *control, MouseButton button) {
Ã,Â
Ã, show_inventory_window();
}
#sectionend btnIconInv_ClickÃ, // DO NOT EDIT OR REMOVE THIS LINE
#sectionstart btnIconCurInv_ClickÃ, // DO NOT EDIT OR REMOVE THIS LINE
function btnIconCurInv_Click(GUIControl *control, MouseButton button) {
Ã,Â
Ã, if (player.ActiveInventory != null)
Ã, Ã, mouse.Mode = eModeUseinv;
}
#sectionend btnIconCurInv_ClickÃ, // DO NOT EDIT OR REMOVE THIS LINE
#sectionstart btnIconSave_ClickÃ, // DO NOT EDIT OR REMOVE THIS LINE
function btnIconSave_Click(GUIControl *control, MouseButton button) {
Ã,Â
Ã, gSave.Visible = true;
Ã, // They pressed SELECT, so switch to the Get cursor
mouse.Mode = eModeInteract;
// But, override the appearance to look like the arrow
mouse.UseModeGraphic(eModePointer);
}
#sectionend btnIconSave_ClickÃ, // DO NOT EDIT OR REMOVE THIS LINE
#sectionstart btnIconLoad_ClickÃ, // DO NOT EDIT OR REMOVE THIS LINE
function btnIconLoad_Click(GUIControl *control, MouseButton button) {
Ã,Â
Ã, gLoad.Visible = true;
Ã, // They pressed SELECT, so switch to the Get cursor
mouse.Mode = eModeInteract;
// But, override the appearance to look like the arrow
mouse.UseModeGraphic(eModePointer);
}
#sectionend btnIconLoad_ClickÃ, // DO NOT EDIT OR REMOVE THIS LINE
#sectionstart btnIconExit_ClickÃ, // DO NOT EDIT OR REMOVE THIS LINE
function btnIconExit_Click(GUIControl *control, MouseButton button) {
Ã,Â
Ã, gQuit.Visible = true;
Ã, // They pressed SELECT, so switch to the Get cursor
mouse.Mode = eModeInteract;
// But, override the appearance to look like the arrow
mouse.UseModeGraphic(eModePointer);
}
#sectionend btnIconExit_ClickÃ, // DO NOT EDIT OR REMOVE THIS LINE
#sectionstart btnIconAbout_ClickÃ, // DO NOT EDIT OR REMOVE THIS LINE
function btnIconAbout_Click(GUIControl *control, MouseButton button) {
Ã,Â
Ã, gMenu.Visible = true;
Ã, // They pressed SELECT, so switch to the Get cursor
mouse.Mode = eModeInteract;
// But, override the appearance to look like the arrow
mouse.UseModeGraphic(eModePointer);
}
#sectionend btnIconAbout_ClickÃ, // DO NOT EDIT OR REMOVE THIS LINE
#sectionstart btnQuitYes_ClickÃ, // DO NOT EDIT OR REMOVE THIS LINE
function btnQuitYes_Click(GUIControl *control, MouseButton button) {
Ã, QuitGame(0);
}
#sectionend btnQuitYes_ClickÃ, // DO NOT EDIT OR REMOVE THIS LINE
#sectionstart btnQuitNo_ClickÃ, // DO NOT EDIT OR REMOVE THIS LINE
function btnQuitNo_Click(GUIControl *control, MouseButton button) {
Ã, gQuit.Visible = false;Ã,Â
}
#sectionend btnQuitNo_ClickÃ, // DO NOT EDIT OR REMOVE THIS LINE
#sectionstart btnMenuExit_ClickÃ, // DO NOT EDIT OR REMOVE THIS LINE
function btnMenuExit_Click(GUIControl *control, MouseButton button) {
Ã, gMenu.Visible = false;
}
#sectionend btnMenuExit_ClickÃ, // DO NOT EDIT OR REMOVE THIS LINE
#sectionstart btnLoadExit_ClickÃ, // DO NOT EDIT OR REMOVE THIS LINE
function btnLoadExit_Click(GUIControl *control, MouseButton button) {
Ã, gLoad.Visible = false;
}
#sectionend btnLoadExit_ClickÃ, // DO NOT EDIT OR REMOVE THIS LINE
#sectionstart btnSaveExit_ClickÃ, // DO NOT EDIT OR REMOVE THIS LINE
function btnSaveExit_Click(GUIControl *control, MouseButton button) {
Ã, gSave.Visible = false;
}
#sectionend btnSaveExit_ClickÃ, // DO NOT EDIT OR REMOVE THIS LINE
#sectionstart sldVolume_ChangeÃ, // DO NOT EDIT OR REMOVE THIS LINE
function sldVolume_Change(GUIControl *control) {
Ã, sldVolume.Max = 100;
Ã, sldVolume.Min = 0;
Ã, SetMusicMasterVolume(sldVolume.Value);
}
#sectionend sldVolume_ChangeÃ, // DO NOT EDIT OR REMOVE THIS LINE
#sectionstart sldSpeed_ChangeÃ, // DO NOT EDIT OR REMOVE THIS LINE
function sldSpeed_Change(GUIControl *control) {
Ã, sldSpeed.Max = 200;
Ã, sldSpeed.Min = 40;
Ã, SetGameSpeed(sldSpeed.Value);
}
#sectionend sldSpeed_ChangeÃ, // DO NOT EDIT OR REMOVE THIS LINE
#sectionstart lboxLoad_SelectionChangedÃ, // DO NOT EDIT OR REMOVE THIS LINE
function lboxLoad_SelectionChanged(GUIControl *control) {
Ã,Â
}
#sectionend lboxLoad_SelectionChangedÃ, // DO NOT EDIT OR REMOVE THIS LINE
#sectionstart btnSaveOk_ClickÃ, // DO NOT EDIT OR REMOVE THIS LINE
function btnSaveOk_Click(GUIControl *control, MouseButton button) {
Ã,Â
}
#sectionend btnSaveOk_ClickÃ, // DO NOT EDIT OR REMOVE THIS LINE
#sectionstart lboxSave_SelectionChangedÃ, // DO NOT EDIT OR REMOVE THIS LINE
function lboxSave_SelectionChanged(GUIControl *control) {
Ã,Â
}
#sectionend lboxSave_SelectionChangedÃ, // DO NOT EDIT OR REMOVE THIS LINE
#sectionstart tboxSave_ActivateÃ, // DO NOT EDIT OR REMOVE THIS LINE
function tboxSave_Activate(GUIControl *control) {
Ã,Â
}
#sectionend tboxSave_ActivateÃ, // DO NOT EDIT OR REMOVE THIS LINE
#sectionstart btnMenuAGS_ClickÃ, // DO NOT EDIT OR REMOVE THIS LINE
function btnMenuAGS_Click(GUIControl *control, MouseButton button) {
Ã, Display("Thanks to Chris Jones for creating the AGS engine");
}
#sectionend btnMenuAGS_ClickÃ, // DO NOT EDIT OR REMOVE THIS LINE
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.054 seconds with 15 queries.