Much appreciated Pumaman. As most pc users today are using 2000/XP I beleive it is more than worth exploring.
Take care.
Take care.
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 Menufunction DefineMode(int mode, const string name, int AGSmode, char extension){
Ã, //Define non-inventory template modes. Call it in game_start for each mode to
Ã, //set up them all.
Ã, StrCopy(Tmode[mode].name, name);
Ã, Tmode[mode].AGSmode = AGSmode;
Ã, if (extension!=0) Tmode[mode].extension = extension;
}
function DefineInvMode(int mode, const string name, const string preposition, int onlyinv, int caninteractwithinv, char extension){
Ã, //Define inventory template modes. Call it in game_start for each mode to
Ã, //set up them all.
Ã, DefineMode(mode, name, 2, extension);
Ã, StrCopy(Tmode[mode].preposition, preposition);
Ã, Tmode[mode].onlyinv = onlyinv;
Ã, Tmode[mode].caninteractwithinv = caninteractwithinv;
}
import function Translation(const string language);
///////////////////////////////////////////////////////////////////////////////////
//////////////////SLIDER CONTROL///////////////////////////////////////////////////
#define KEY_PAGEUPÃ, Ã, 380
#define KEY_PAGEDOWN 381
#define KEY_HOMEÃ, Ã, Ã, 371
#define KEY_ENDÃ, Ã, Ã, 379
#define KEY_INSÃ, Ã, Ã, 382
#define KEY_DELÃ, Ã, Ã, 383
#define TIMEOUT 120
int timer = -1;
#define SLIDER 0
#define VOLUME 0
function GetKeyPressed() {
Ã, Ã, if (IsKeyPressed(KEY_PAGEUP)) return KEY_PAGEUP;
Ã, Ã, else if (IsKeyPressed(KEY_PAGEDOWN)) return KEY_PAGEDOWN;
Ã, Ã, else if (IsKeyPressed(KEY_HOME)) return KEY_HOME;
Ã, Ã, else if (IsKeyPressed(KEY_END)) return KEY_END;
Ã, Ã, else if (IsKeyPressed(KEY_INS)) return KEY_INS;
Ã, Ã, else if (IsKeyPressed(KEY_DEL)) return KEY_DEL;
Ã, Ã, else return 0;
}
function on_key_press_always(int keycode) {
Ã,Â
Ã, Ã, if (keycode == KEY_PAGEUP) {
Ã, Ã, Ã, timer = TIMEOUT;
Ã, Ã, Ã, GUIOn(3);
Ã, Ã, Ã, SetSliderValue(3, 6, GetSliderValue(3, 6)+1);
Ã, Ã, Ã, game.text_speed = GetSliderValue(3, 6);
Ã, Ã, }
Ã, Ã, if (keycode == KEY_PAGEDOWN) {
Ã, Ã, Ã, timer = TIMEOUT;
Ã, Ã, Ã, GUIOn(3);
Ã, Ã, Ã, SetSliderValue(3, 6, GetSliderValue(3, 6)-1);
Ã, Ã, Ã, game.text_speed = GetSliderValue(3, 6);
Ã, Ã, }
Ã, Ã, if (keycode == KEY_HOME) {
Ã, Ã, Ã, timer = TIMEOUT;
Ã, Ã, Ã, GUIOn(3);
Ã, Ã, Ã, SetSliderValue(3, 8, GetSliderValue(3, 8)+1);
Ã, Ã, Ã, SetSoundVolume(GetSliderValue(3, 8));
Ã, Ã, }
Ã, Ã, if (keycode == KEY_END) {
Ã, Ã, Ã, timer = TIMEOUT;
Ã, Ã, Ã, GUIOn(3);
Ã, Ã, Ã, SetSliderValue(3, 8, GetSliderValue(3, 8)-1);
Ã, Ã, Ã, SetSoundVolume(GetSliderValue(3, 8));
}
Ã, Ã, if (keycode == KEY_INS) {
Ã, Ã, Ã, timer = TIMEOUT;
Ã, Ã, Ã, GUIOn(3);
Ã, Ã, Ã, SetSliderValue(3, 10, GetSliderValue(3, 10)+1);
Ã, Ã, Ã, SetMusicMasterVolume(GetSliderValue(3, 10));
Ã, Ã, }
Ã, Ã, if (keycode == KEY_DEL) {
Ã, Ã, Ã, timer = TIMEOUT;
Ã, Ã, Ã, GUIOn(3);
Ã, Ã, Ã, SetSliderValue(3, 10, GetSliderValue(3, 10)-1);
Ã, Ã, Ã, SetMusicMasterVolume(GetSliderValue(3, 10));
Ã, Ã, }
Ã,Â
}
#sectionstart repeatedly_execute
function repeatedly_execute() {//////////////////////////////////////Repeatedly Execute///////////Repeatedly Execute
Ã, Ã, // put anything you want to happen every game cycle here
////////PUT YOUR SCRIPTS HERE IF POSSIBLE///////////
////////////////////////////////////////////////////
// If the timer reaches zero, turns the GUI off.Ã,Â
if (timer > 0) timer--;
Ã, else if (timer==0) {
Ã, Ã, Ã, GUIOff(3);
Ã, Ã, Ã, GUIOff(3);
Ã, Ã, Ã, timer = -1;
//-----------------------------------------------------
}
#sectionend repeatedly_execute
#sectionstart repeatedly_execute_always
function repeatedly_execute_always() {
Ã, Ã, if (IsGamePaused()==0) on_key_press_always(GetKeyPressed());
}
#sectionend repeatedly_execute_always
// the button sprites probably deppend on the language being used
Ã, if (Translation("default")){ // if no translation file is being used
// mode button normal highlighted
// number sprite sprite
Ã, Ã, DefineButton( GIVE, 0, 13, 22);
Ã, Ã, DefineButton( PICKUP, 1, 14, 23);
Ã, Ã, DefineButton( USE, 2, 15, 24);
Ã, Ã, DefineButton( OPEN, 3, 16, 25);
Ã, Ã, DefineButton( LOOK, 4, 17, 26);
Ã, Ã, DefineButton( PUSH, 5, 18, 27);
Ã, Ã, DefineButton( CLOSE, 6, 19, 28);
Ã, Ã, DefineButton( TALK, 7, 20, 29);
Ã, Ã, DefineButton( PULL, 8, 21, 30);
Ã, }
//////////////////////////////////////////////////////////
function Translation(const string language){
Ã, // checks if the translation passed as parameter is being used. To check if no translation is being used, pass "none" or "default" as parameter.
Ã, string currentlang;
Ã, GetTranslationName(currentlang);
if ((IsTranslationAvailable()==1 && StrCaseComp(currentlang, language)==0) ||
Ã, Ã, Ã, (IsTranslationAvailable()==0 && (StrCaseComp("none", language)==0 || StrCaseComp("default", language)==0)))
Ã, Ã, Ã, return 1;
else return 0;
}
function DefineButton(int mode, int button, int normalbuttonpic, int overbuttonpic){
Ã, //Define the buttons for a template mode. Call it in game_start for each mode to
Ã, //set up them all.
Ã, Tmode[mode].button=button;
Ã, Tmode[mode].highlightedbutton=overbuttonpic;
Ã, Tmode[mode].normalbutton=normalbuttonpic;
}
function Translation(const string language){
import function Translation(const string language);
DefineMode( WALK, "const Walk to", 9, 0);//Line 631. The template uses AGS mode 9 for walk modes, instead of 0.
////////////////////// MODES SETUP ///////////////////////
//////////////////////////////////////////////////////////
//Normal modes: MODE "name" AGS Extension
// cursor
// mode
Ã, DefineMode( WALK, "Walk to", 9, 0);//Line 631. The template uses AGS mode 9 for walk modes, instead of 0.
Ã, DefineMode( LOOK, "Look at", 1, 'l');
Ã, DefineMode( TALK, "Talk to", 3, 't');
Ã, DefineMode( PICKUP, "Pick up", 5, 'p');
Ã, DefineMode( OPEN, "Open", 8, 'o');
Ã, DefineMode( CLOSE, "Close", 8, 'c');
Ã, DefineMode( PUSH, "Push", 8, 's');
Ã, DefineMode( PULL, "Pull", 8, 'y');
//Inventory modes: MODE "name" Prepo- Only Can Extension
// sition inv. interact
// w/ inv
Ã, DefineInvMode( USE, "Use", "with", 0, 1, 'u');
Ã, DefineInvMode( GIVE, "Give", "to", 1, 0, 'g');
//*Only inv: Means that you can only use that mode followed by an inventory item:
//Ã, Ã, Ã, Ã, Ã, Ã, USE has 0, because you can USE a hotspot also. However, you can't
//Ã, Ã, Ã, Ã, Ã, Ã, GIVE a hotspot, you must GIVE an inv. item you already have, therefore
// GIVE has 1.
//*Can interact USE has 1, because you could have an inventory item like the
//Ã, Ã, with inv: "navigator's head" in Monkey Island 1, on which if you click 'USE item'
// then the item performs some action, instead of putting 'USE item WITH'
// and waiting for the player to select someting to USE the item WITH.
// An interaction like "GIVE item" on its own, doesn't make sense,
// (because you must GIVE something _TO someone_) so GIVE has 0.
// the button sprites probably deppend on the language being used
Ã, if (Translation("default")){ // if no translation file is being used
// mode button normal highlighted
// number sprite sprite
Ã, Ã, DefineButton( GIVE, 0, 13, 22);
Ã, Ã, DefineButton( PICKUP, 1, 14, 23);
Ã, Ã, DefineButton( USE, 2, 15, 24);
Ã, Ã, DefineButton( OPEN, 3, 16, 25);
Ã, Ã, DefineButton( LOOK, 4, 17, 26);
Ã, Ã, DefineButton( PUSH, 5, 18, 27);
Ã, Ã, DefineButton( CLOSE, 6, 19, 28);
Ã, Ã, DefineButton( TALK, 7, 20, 29);
Ã, Ã, DefineButton( PULL, 8, 21, 30);
Ã, }
//////////////////////////////////////////////////////////
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.083 seconds with 17 queries.