Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int DataPads[30][4] =
- {
- {"", 0, "", 0},
- {"", 0, "", 0},
- {"", 0, "", 0},
- {"", 0, "", 0},
- {"", 0, "", 0}
- };
- script "CheckDataPads" open {
- delay(1);
- int datapadIterator = 0;
- while (datapadIterator < DataPadsInLevel) {
- DataPads[datapadIterator][1] = 0;
- datapadIterator++;
- }
- }
- function void printMail (void){
- //int emailMsgX = 1920 * 0.5;
- //int emailMsgY = 1080 * 0.8;
- // if (middle == 1) {
- // emailMsgY = 0.1;
- // }
- ACS_NamedExecutewITHrESULT("pickupMail", 0);
- memoCount();
- setHudSize(640, 480, 0);
- setfont("ICONPAD");
- HudMessage(s:"a"; HUDMSG_FADEINOUT, 105, CR_UNTRANSLATED, -40.1, 310.0, 3.0);
- setfont("SMALLFONT");
- HudMessage(s:"\c[omniblue]DATAPAD ACQUIRED"; HUDMSG_FADEINOUT, 99, CR_UNTRANSLATED, 12.1, 301.0, 3.0);
- setHudSize(800, 600, 0);
- HudMessage(s:"\c[omniblue]SUBJECT: \c[WHITE]", s:DataPads[DatapadsFound][2]; HUDMSG_FADEINOUT, 100, CR_UNTRANSLATED, 15.1, 392.0, 3.0);;
- setfont("SMALLFONT");
- HudMessage(s:"\c[DarkGray]Open the codex to read datapads"; HUDMSG_FADEINOUT, 101, CR_UNTRANSLATED, 15.1, 402.0, 3.0);
- }
- int mostrecentEmail = -1;
- script "pickupMail" (void) {
- displayPickup2("Datapad downloaded", "P_MAIL", 1, "CR_WHITE");
- mostrecentEmail = Datapadsfound;
- delay(35*5);
- mostrecentEmail = 0;
- }
- #define CURSOR 200
- #define id_cursor 9970
- #define id_choices 9980
- bool CodexActivated = false;
- int ThisScript = 0;
- int menu = OFF;
- int currentchoice = -1;
- int maxchoices = 0;
- str upgradedWeapon = "";
- str upgradeString = "";
- function void ClearMsg ( int id )
- {
- HudMessage(s:""; 0,id,-1,0,0,0);
- }
- function void Choice ( int number, int name ) // A ''Choice'' object are the buttons you see on screen.
- {
- SetHudSize(320, 240, 0);
- SetFont("SMALLFONT");
- SetHudSize(640, 480, 0);
- SetFont("mail");
- HudMessage(s:"a: "; HUDMSG_PLAIN, 90001, CR_UNTRANSLATED, -35.5, 90.1, 0.1, 0.2);
- SetHudSize(800, 600, 0);
- SetFont("SMALLFONT");
- str levelname = GetLevelInfo(PRINTNAME_LEVELNAME);
- HudMessage(s:"\c[OMNIBLUE]DATAPADS FOR ", s:levelname; HUDMSG_PLAIN, 90000, CR_UNTRANSLATED, -10.5, 155.1, 0.1, 0.2);
- SetHudSize(640, 480, 0);
- HudMessage(s:name;
- HUDMSG_PLAIN,id_choices+number,CR_WHITE,-5.5,135.1+(number*15.0),9999.0);
- ACS_Execute(CURSOR,0);
- maxchoices = number;
- menu = ON;
- for(int x=1; x<=100; x++)
- ClearMsg(id_choices+number+x);
- }
- bool ChangeSelection = false;
- function void ClearCursor ( void ) // The following commands are executed when the player presses ''Exit Menu''
- {
- ACS_Terminate(CURSOR,0);
- playsound(800, "ui/clcodex", CHAN_AUTO);
- currentChoice = 0;
- changeselection = false;
- CodexActivated = false;
- playsound(800, "ui/clcodex", CHAN_AUTO);
- currentChoice = 0;
- //ACS_NamedExecute("Equipvisor", 0);
- ClearMsg(id_cursor);
- for(int x=0; x<=100; x++)
- ClearMsg(id_choices+x);
- ClearMsg(90000);
- ClearMsg(90001);
- ClearMsg(89999);
- menuActive = false; gameActive = true;
- TakeActorInventory(0, "upgradeMenu", 999);
- SetPlayerProperty(TRUE, OFF, PROP_TOTALLYFROZEN);
- //LocalAmbientSound("menu/clear",127); //Get rid of this (or any other LocalAmbientSounds) if it annoys you. :P
- menu = OFF;
- MenuActive = off;
- }
- // The following four scripts are best kept as scripts due to:
- // (a) functions being unable to handle delays
- // (b) "puke" being unable to grab the number of a script as defined in the scripts lump.
- script CURSOR ( void )
- {
- SetHudSize(640, 480, 0);
- SetFont("codexM");
- HudMessage(s:"a";
- HUDMSG_PLAIN,89999, CR_WHITE,-20.5,131.1+(currentchoice*15.0),0.12);
- ACS_Execute(ThisScript,0);
- delay(1);
- restart;
- }
- script 201 ( void ) NET
- {
- int buttons = GetPlayerInput(-1, INPUT_BUTTONS);
- while (menu == on)
- {
- if (buttons & BT_FORWARD)
- {
- if(currentchoice>0) currentchoice--;
- //LocalAmbientSound("menu/cursor",127);
- }
- delay(1);
- }
- }
- bool WaitForUse = false;
- script 202 ( void ) NET // MENU DOWN.
- {
- // Checks to see if a button is not held down.
- bool ButtonIsPressed;
- // Has a datapad been recently picked up? If so, instantly jump to the most recent codec
- if (mostrecentEmail < 0) { currentChoice = 0;
- } else {
- currentChoice = mostrecentEmail;
- }
- ButtonIsPressed = false;
- delay(1);
- while (menu == on) // WAIT FOR PLAYER INPUT
- {
- int buttons = GetPlayerInput(-1, INPUT_BUTTONS);
- if (buttons != BT_USE & buttons != BT_FORWARD & buttons != BT_BACK)
- {
- ButtonIsPressed = false;
- }
- if (buttons & BT_BACK) //PLAYER PRESSES THE 'Move backward' button
- {
- if (!ButtonIsPressed) {
- buttonIsPressed = true;
- changeselection = true;
- playsound(800, "ui/CasRoll", CHAN_AUTO);
- if(currentchoice<=maxchoices-1) currentchoice++;
- LocalAmbientSound("menu/cursor",127);
- }
- }
- if (buttons & BT_FORWARD) //PLAYER PRESSES THE 'Move Forward' button
- {
- if (!ButtonIsPressed) {
- changeselection = true;
- buttonIsPressed = true;
- playsound(800, "ui/CasRoll", CHAN_AUTO);
- if(currentchoice>0) currentchoice--;
- LocalAmbientSound("menu/cursor",127);
- }
- }
- if (buttons & BT_USE)
- {
- if (!ButtonIsPressed) {
- WaitForUse = true;
- ClearMsg(id_cursor);
- ACS_Execute(ThisScript,0);
- delay(1);
- WaitForUse = false;
- }
- }
- delay(1);
- }
- //print(s:"Workshop menu closed");
- SetLineSpecial(1005, ACS_Execute, 52);
- }
- script 203 ( void ) NET // MENU SELECT.
- {
- if(menu==ON)
- {
- ClearMsg(id_cursor);
- ACS_Execute(ThisScript,0);
- delay(1); // Don't ask me why this needs to be here; it just... does.
- }
- }
- script "backgroundColor" (void) {
- while (menuActive == true) {
- GiveActorInventory(0, "upgradeMenu", 1);
- delay(1);
- }
- terminate;
- }
- bool paymentFailed;
- script "OpenMenu" (void) {
- if (!CodexActivated) {
- changeselection = true;
- playsound(800, "ui/mapunlock", CHAN_AUTO);
- ACS_Execute(52, 0);
- } else {
- HudMessage(s:""; HUDMSG_FADEINOUT, 99, CR_UNTRANSLATED, 0.1, 0.1, 0.1, 0.2, 0.2);
- CodexActivated = false;
- ClearCursor();
- ACS_Terminate(52, 0);
- }
- }
- script 52 ( void )
- {
- CodexActivated = true;
- ACS_Execute(202, 0);
- keepGameplay = true;
- SetPlayerProperty(TRUE, ON, PROP_TOTALLYFROZEN);
- menuactive = true;
- ACS_NamedExecute("backgroundColor", 0);
- ThisScript = 52;
- // Time to set up the choices menu. Choices must be in order and start from 0
- int DataPadsToIterate = 0;
- while(DataPadsInLevel >= DataPadsToIterate) {
- if (DataPads[DataPadsToIterate][1] == 0) { Choice(DataPadsToIterate, "\c[DARKGREY]--- NOT FOUND ---");
- } else {
- // CHECK TO SEE IF THE DATAPAD HAS BEEN READ OR NOT BY COMPARING THE 4TH VALUE
- if (DataPads[DataPadsToIterate][3] == 0) {
- //ADDS AN ''UNREAD'' INDICATOR BEHIND THE SUBJECT
- Choice(DataPadsToIterate, StrParam(s:"\c[GREEN]UNREAD\c[WHITE] ", s:DataPads[DataPadsToIterate][2]));
- } else {
- Choice(DataPadsToIterate, DataPads[DataPadsToIterate][2]);
- }
- }
- DataPadsToIterate++;
- }
- int FinalID = DataPadsToIterate;
- Choice(FinalID - 1, "\c[DARKGREY]Exit Menu");
- DataPadsToIterate = 0;
- while(DataPadsInLevel >= DataPadsToIterate) {
- if (currentChoice == DataPadsToIterate) {
- if (ChangeSelection) {
- printMailOptions2(datapads[DataPadsToiterate][0]); // PRINT CURRENTLY SELECTED MEMO TO THE SCREEN
- changeselection = false;
- }
- datapads[DataPadsToiterate][3] = 1; // IF THE PLAYER HOVERS OVER AN EMAIL IT IS CONSIDERED TO BE READ
- }
- DataPadsToIterate++;
- }
- if (currentchoice == FinalID - 1) {
- while(WaitForUse) {
- ClearCursor();
- CodexActivated = false;
- playsound(800, "ui/clcodex", CHAN_AUTO);
- currentChoice = 0;
- delay(1);
- }
- }
- }
- function void printMailOptions2(str mail)
- {
- int emailMsgX = 800 * 0.36;
- int emailMsgY = 600 * 0.34;
- setHudSize(800, 600, 0);
- SetHUDClipRect(-100, -100, 800, 600, 290);
- SetFont("SMALLFONT");
- HudMessage(s:mail; HUDMSG_FADEINOUT, 99, CR_UNTRANSLATED, emailMsgX + 0.1, emailMsgY + 0.1, 9999.0, 0.2, 0.2);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement