Advertisement
Guest User

Untitled

a guest
Jan 25th, 2020
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.90 KB | None | 0 0
  1. int DataPads[30][4] =
  2. {
  3. {"", 0, "", 0},
  4. {"", 0, "", 0},
  5. {"", 0, "", 0},
  6. {"", 0, "", 0},
  7. {"", 0, "", 0}
  8. };
  9.  
  10. script "CheckDataPads" open {
  11. delay(1);
  12. int datapadIterator = 0;
  13. while (datapadIterator < DataPadsInLevel) {
  14. DataPads[datapadIterator][1] = 0;
  15. datapadIterator++;
  16. }
  17. }
  18.  
  19.  
  20. function void printMail (void){
  21. //int emailMsgX = 1920 * 0.5;
  22. //int emailMsgY = 1080 * 0.8;
  23. // if (middle == 1) {
  24. // emailMsgY = 0.1;
  25. // }
  26. ACS_NamedExecutewITHrESULT("pickupMail", 0);
  27. memoCount();
  28. setHudSize(640, 480, 0);
  29. setfont("ICONPAD");
  30. HudMessage(s:"a"; HUDMSG_FADEINOUT, 105, CR_UNTRANSLATED, -40.1, 310.0, 3.0);
  31. setfont("SMALLFONT");
  32. HudMessage(s:"\c[omniblue]DATAPAD ACQUIRED"; HUDMSG_FADEINOUT, 99, CR_UNTRANSLATED, 12.1, 301.0, 3.0);
  33. setHudSize(800, 600, 0);
  34. HudMessage(s:"\c[omniblue]SUBJECT: \c[WHITE]", s:DataPads[DatapadsFound][2]; HUDMSG_FADEINOUT, 100, CR_UNTRANSLATED, 15.1, 392.0, 3.0);;
  35. setfont("SMALLFONT");
  36. HudMessage(s:"\c[DarkGray]Open the codex to read datapads"; HUDMSG_FADEINOUT, 101, CR_UNTRANSLATED, 15.1, 402.0, 3.0);
  37. }
  38.  
  39. int mostrecentEmail = -1;
  40. script "pickupMail" (void) {
  41. displayPickup2("Datapad downloaded", "P_MAIL", 1, "CR_WHITE");
  42. mostrecentEmail = Datapadsfound;
  43. delay(35*5);
  44. mostrecentEmail = 0;
  45. }
  46.  
  47.  
  48. #define CURSOR 200
  49.  
  50. #define id_cursor 9970
  51. #define id_choices 9980
  52. bool CodexActivated = false;
  53. int ThisScript = 0;
  54. int menu = OFF;
  55. int currentchoice = -1;
  56. int maxchoices = 0;
  57. str upgradedWeapon = "";
  58. str upgradeString = "";
  59.  
  60. function void ClearMsg ( int id )
  61. {
  62. HudMessage(s:""; 0,id,-1,0,0,0);
  63. }
  64.  
  65. function void Choice ( int number, int name ) // A ''Choice'' object are the buttons you see on screen.
  66. {
  67. SetHudSize(320, 240, 0);
  68. SetFont("SMALLFONT");
  69. SetHudSize(640, 480, 0);
  70. SetFont("mail");
  71. HudMessage(s:"a: "; HUDMSG_PLAIN, 90001, CR_UNTRANSLATED, -35.5, 90.1, 0.1, 0.2);
  72. SetHudSize(800, 600, 0);
  73. SetFont("SMALLFONT");
  74. str levelname = GetLevelInfo(PRINTNAME_LEVELNAME);
  75. HudMessage(s:"\c[OMNIBLUE]DATAPADS FOR ", s:levelname; HUDMSG_PLAIN, 90000, CR_UNTRANSLATED, -10.5, 155.1, 0.1, 0.2);
  76. SetHudSize(640, 480, 0);
  77. HudMessage(s:name;
  78. HUDMSG_PLAIN,id_choices+number,CR_WHITE,-5.5,135.1+(number*15.0),9999.0);
  79. ACS_Execute(CURSOR,0);
  80. maxchoices = number;
  81. menu = ON;
  82.  
  83. for(int x=1; x<=100; x++)
  84. ClearMsg(id_choices+number+x);
  85. }
  86. bool ChangeSelection = false;
  87. function void ClearCursor ( void ) // The following commands are executed when the player presses ''Exit Menu''
  88. {
  89. ACS_Terminate(CURSOR,0);
  90. playsound(800, "ui/clcodex", CHAN_AUTO);
  91. currentChoice = 0;
  92. changeselection = false;
  93. CodexActivated = false;
  94. playsound(800, "ui/clcodex", CHAN_AUTO);
  95. currentChoice = 0;
  96. //ACS_NamedExecute("Equipvisor", 0);
  97. ClearMsg(id_cursor);
  98. for(int x=0; x<=100; x++)
  99. ClearMsg(id_choices+x);
  100. ClearMsg(90000);
  101. ClearMsg(90001);
  102. ClearMsg(89999);
  103. menuActive = false; gameActive = true;
  104. TakeActorInventory(0, "upgradeMenu", 999);
  105. SetPlayerProperty(TRUE, OFF, PROP_TOTALLYFROZEN);
  106. //LocalAmbientSound("menu/clear",127); //Get rid of this (or any other LocalAmbientSounds) if it annoys you. :P
  107. menu = OFF;
  108. MenuActive = off;
  109. }
  110.  
  111. // The following four scripts are best kept as scripts due to:
  112. // (a) functions being unable to handle delays
  113. // (b) "puke" being unable to grab the number of a script as defined in the scripts lump.
  114. script CURSOR ( void )
  115. {
  116. SetHudSize(640, 480, 0);
  117. SetFont("codexM");
  118. HudMessage(s:"a";
  119. HUDMSG_PLAIN,89999, CR_WHITE,-20.5,131.1+(currentchoice*15.0),0.12);
  120. ACS_Execute(ThisScript,0);
  121. delay(1);
  122. restart;
  123. }
  124.  
  125. script 201 ( void ) NET
  126. {
  127. int buttons = GetPlayerInput(-1, INPUT_BUTTONS);
  128. while (menu == on)
  129. {
  130. if (buttons & BT_FORWARD)
  131. {
  132. if(currentchoice>0) currentchoice--;
  133. //LocalAmbientSound("menu/cursor",127);
  134. }
  135. delay(1);
  136. }
  137. }
  138. bool WaitForUse = false;
  139.  
  140. script 202 ( void ) NET // MENU DOWN.
  141. {
  142. // Checks to see if a button is not held down.
  143. bool ButtonIsPressed;
  144.  
  145. // Has a datapad been recently picked up? If so, instantly jump to the most recent codec
  146. if (mostrecentEmail < 0) { currentChoice = 0;
  147. } else {
  148. currentChoice = mostrecentEmail;
  149. }
  150. ButtonIsPressed = false;
  151. delay(1);
  152. while (menu == on) // WAIT FOR PLAYER INPUT
  153. {
  154. int buttons = GetPlayerInput(-1, INPUT_BUTTONS);
  155. if (buttons != BT_USE & buttons != BT_FORWARD & buttons != BT_BACK)
  156. {
  157. ButtonIsPressed = false;
  158. }
  159. if (buttons & BT_BACK) //PLAYER PRESSES THE 'Move backward' button
  160. {
  161. if (!ButtonIsPressed) {
  162. buttonIsPressed = true;
  163. changeselection = true;
  164. playsound(800, "ui/CasRoll", CHAN_AUTO);
  165. if(currentchoice<=maxchoices-1) currentchoice++;
  166. LocalAmbientSound("menu/cursor",127);
  167. }
  168. }
  169. if (buttons & BT_FORWARD) //PLAYER PRESSES THE 'Move Forward' button
  170. {
  171. if (!ButtonIsPressed) {
  172. changeselection = true;
  173. buttonIsPressed = true;
  174. playsound(800, "ui/CasRoll", CHAN_AUTO);
  175. if(currentchoice>0) currentchoice--;
  176. LocalAmbientSound("menu/cursor",127);
  177. }
  178. }
  179.  
  180. if (buttons & BT_USE)
  181. {
  182. if (!ButtonIsPressed) {
  183. WaitForUse = true;
  184. ClearMsg(id_cursor);
  185. ACS_Execute(ThisScript,0);
  186. delay(1);
  187. WaitForUse = false;
  188. }
  189. }
  190. delay(1);
  191. }
  192. //print(s:"Workshop menu closed");
  193. SetLineSpecial(1005, ACS_Execute, 52);
  194. }
  195.  
  196. script 203 ( void ) NET // MENU SELECT.
  197. {
  198. if(menu==ON)
  199. {
  200. ClearMsg(id_cursor);
  201. ACS_Execute(ThisScript,0);
  202. delay(1); // Don't ask me why this needs to be here; it just... does.
  203. }
  204. }
  205.  
  206. script "backgroundColor" (void) {
  207. while (menuActive == true) {
  208. GiveActorInventory(0, "upgradeMenu", 1);
  209. delay(1);
  210. }
  211. terminate;
  212. }
  213.  
  214. bool paymentFailed;
  215. script "OpenMenu" (void) {
  216. if (!CodexActivated) {
  217. changeselection = true;
  218. playsound(800, "ui/mapunlock", CHAN_AUTO);
  219. ACS_Execute(52, 0);
  220. } else {
  221. HudMessage(s:""; HUDMSG_FADEINOUT, 99, CR_UNTRANSLATED, 0.1, 0.1, 0.1, 0.2, 0.2);
  222. CodexActivated = false;
  223. ClearCursor();
  224. ACS_Terminate(52, 0);
  225. }
  226. }
  227.  
  228. script 52 ( void )
  229. {
  230. CodexActivated = true;
  231. ACS_Execute(202, 0);
  232. keepGameplay = true;
  233. SetPlayerProperty(TRUE, ON, PROP_TOTALLYFROZEN);
  234. menuactive = true;
  235. ACS_NamedExecute("backgroundColor", 0);
  236. ThisScript = 52;
  237.  
  238.  
  239. // Time to set up the choices menu. Choices must be in order and start from 0
  240. int DataPadsToIterate = 0;
  241. while(DataPadsInLevel >= DataPadsToIterate) {
  242. if (DataPads[DataPadsToIterate][1] == 0) { Choice(DataPadsToIterate, "\c[DARKGREY]--- NOT FOUND ---");
  243. } else {
  244. // CHECK TO SEE IF THE DATAPAD HAS BEEN READ OR NOT BY COMPARING THE 4TH VALUE
  245. if (DataPads[DataPadsToIterate][3] == 0) {
  246. //ADDS AN ''UNREAD'' INDICATOR BEHIND THE SUBJECT
  247. Choice(DataPadsToIterate, StrParam(s:"\c[GREEN]UNREAD\c[WHITE] ", s:DataPads[DataPadsToIterate][2]));
  248. } else {
  249. Choice(DataPadsToIterate, DataPads[DataPadsToIterate][2]);
  250. }
  251. }
  252. DataPadsToIterate++;
  253. }
  254. int FinalID = DataPadsToIterate;
  255. Choice(FinalID - 1, "\c[DARKGREY]Exit Menu");
  256. DataPadsToIterate = 0;
  257. while(DataPadsInLevel >= DataPadsToIterate) {
  258. if (currentChoice == DataPadsToIterate) {
  259. if (ChangeSelection) {
  260. printMailOptions2(datapads[DataPadsToiterate][0]); // PRINT CURRENTLY SELECTED MEMO TO THE SCREEN
  261. changeselection = false;
  262. }
  263. datapads[DataPadsToiterate][3] = 1; // IF THE PLAYER HOVERS OVER AN EMAIL IT IS CONSIDERED TO BE READ
  264. }
  265. DataPadsToIterate++;
  266. }
  267. if (currentchoice == FinalID - 1) {
  268. while(WaitForUse) {
  269. ClearCursor();
  270. CodexActivated = false;
  271. playsound(800, "ui/clcodex", CHAN_AUTO);
  272. currentChoice = 0;
  273. delay(1);
  274. }
  275. }
  276. }
  277.  
  278.  
  279. function void printMailOptions2(str mail)
  280. {
  281. int emailMsgX = 800 * 0.36;
  282. int emailMsgY = 600 * 0.34;
  283. setHudSize(800, 600, 0);
  284. SetHUDClipRect(-100, -100, 800, 600, 290);
  285. SetFont("SMALLFONT");
  286. HudMessage(s:mail; HUDMSG_FADEINOUT, 99, CR_UNTRANSLATED, emailMsgX + 0.1, emailMsgY + 0.1, 9999.0, 0.2, 0.2);
  287. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement