Want more features on Pastebin? Sign Up, it's FREE!
Guest

tutogame.hlsl

By: drthingums on Aug 11th, 2011  |  syntax: None  |  size: 15.38 KB  |  views: 60  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #include(pwlib/pwlib.hlsl)
  2. //Sample function documentation
  3. [game]//drthingums is awesome!
  4. runscript("pw_initpwlib");
  5. runscript("pw_initpwbgs");
  6. changetitle("Loading characters...");
  7. runscript("pw_crosizesalternative");
  8. runscript("pw_createema");
  9. runscript("pw_createtrucy");
  10. runscript("pw_createphoenix");
  11. runscript("pw_createjudge");
  12. runscript("pw_createfranziska");
  13. loadtexture(70010,"PW/misc/pwdefaulttitle.png");
  14. loadtexture(-7000,"PW/CRO/CROWtYoungEma.png");
  15. loadtexture(-7001,"PW/CRO/CROJudge.png");
  16. loadtexture(-7002,"PW/CRO/CROPrFranziska.png");
  17. loadtexture(-7003,"PW/CRO/CRODfPhoenix.png");
  18. changetitle("Loading Psyche-Locks...");
  19. runscript("pw_initpsychelockgfx");
  20. changetitle("PWLib Tutorial Game");
  21. setbg(70010);
  22. runscript("pw_showmain");
  23. waitresponse();
  24. runscript("pw_hidemain");
  25. jumptoscript("case1");
  26.  
  27. [case1]
  28. runscript("evidenceprofilecreation");
  29. setvar([evidencenumber],900);
  30. runscript("addevidence");
  31. setvar([evidencenumber],901);
  32. runscript("addevidence");
  33. setvar([profilenumber],800);
  34. runscript("addprofile");
  35. setvar([profilenumber],801);
  36. runscript("addprofile");
  37. jumptoscript("scn1");
  38.  
  39. [evidenceprofilecreation]
  40. setvar([evidencenumber],900);
  41. setvar([evidencegfs],80901);
  42. setvar([evidencegfl],80901);
  43. setvar([evidencesup],0);
  44. setvar([evidencename],"Attorney's Badge");
  45. setvar([evidencesdesc],"Type: Other\n One of my possessions.");
  46. setvar([evidenceldesc],"It's my all important badge.\nIt shows that I'm a defense attorney.");
  47. runscript("createevidence");
  48. setvar([evidencenumber],901);
  49. setvar([evidencegfs],80900);
  50. setvar([evidencegfl],80900);
  51. setvar([evidencesup],0);
  52. setvar([evidencename],"Gun");
  53. setvar([evidencesdesc],"Type: Weapons\n Submitted as evidence\n by Prosecutor Von Karma.");
  54. setvar([evidenceldesc],"The murder weapon.\nIt was shot once.");
  55. runscript("createevidence");
  56. setvar([evidencenumber],902);
  57. setvar([evidencegfs],80902);
  58. setvar([evidencegfl],80902);
  59. setvar([evidencesup],1);
  60. setvar([evidencename],"Trucy GS4 Promo");
  61. setvar([evidencesdesc],"Type: Photo\nReceived from Trucy Wright.");
  62. setvar([evidenceldesc],"A promo photo of Gyakuten Saiban \n4.");
  63. runscript("createevidence");
  64. setvar([evidencestex],7000);
  65. runscript("setevidencepagesimple");
  66. setvar([profilenumber],800);
  67. setvar([profilegfs],90900);
  68. setvar([profilegfl],90900);
  69. setvar([profilename],"Ema Skye");
  70. setvar([profilesdesc],"Age: 19\nGender: Female");
  71. setvar([profileldesc],"An energetic girl that wants to be a \nforensic detective.");
  72. runscript("createprofile");
  73. setvar([profilenumber],801);
  74. setvar([profilegfs],90901);
  75. setvar([profilegfl],90901);
  76. setvar([profilename],"Trucy Wright");
  77. setvar([profilesdesc],"Age: 15\nGender: Female");
  78. setvar([profileldesc],"A cheerful magician girl.");
  79. runscript("createprofile");
  80. loadtexture(80900,"PW/evidence/gun.png");
  81. loadtexture(80901,"PW/evidence/lawyer badge.png");
  82. loadtexture(80902,"PW/evidence/phota.png");
  83. loadtexture(90900,"PW/profile/ema.png");
  84. loadtexture(90901,"PW/profile/minuki.png");
  85. setvar([evidencestex],7000);
  86. runscript("setevidencepagesimple");
  87.  
  88. [scn1]
  89. runscript("showpwchar");
  90. runscript("pw_usepwbgcourthall");
  91. loadandplaymp3("music/02 - Courtroom Lobby ~ New Prelude.ogg",0,"N");
  92. runscript("pw_setnameboxtoema");
  93. runscript("setlipsynctochar");
  94. runscript("pw_enableemanormal");
  95. pw_showmsgbox();
  96. placefade("pw_char","char",60,"I");
  97. runscript("pw_showadvarrowmenu");
  98. message("Oh,hello!");
  99. message("My name is Ema Skye");
  100. runscript("pw_setnameboxtotrucy");
  101. runscript("pw_enabletrucynormal");
  102. message("Hello,I'm Trucy!\nI'm a magician!");
  103. message("This photo proves it.");
  104. runscript("pw_hidemessagebox");
  105. runscript("pw_raisetakethat");
  106. pw_showmsgbox();
  107. setvar([evidencenumber],902);
  108. runscript("addevidence");
  109. setvar([pw_headeviaddmsg],"");
  110. setvar([pw_taileviaddmsg]," was added\nto the Court Record.");
  111. runscript("pw_startevidenceadd");
  112. jumptoscript("scn2");
  113. runscript("pw_setnameboxtoema");
  114. runscript("pw_enableemanormal");
  115. runscript("setlipsynctochar");
  116. message("That's cool! But scientifically \nspeaking...");
  117. message("Magic doesn't exist.");
  118. runscript("pw_setnameboxtotrucy");
  119. runscript("pw_enabletrucynormal");
  120. message("Scientifically speaking...? \nHmmm...");
  121. message("But does magic needs to be \nproven?");
  122. runscript("setlipsynctonoone");
  123. runscript("pw_setnameboxtophoenix");
  124. message("(I better not try to argue \nin this one.)");
  125. runscript("setlipsynctochar");
  126. runscript("pw_enableemanormal");
  127. runscript("pw_setnameboxtoema");
  128. message("What do you think, Mr. \nWright?");
  129. runscript("setlipsynctonoone");
  130. runscript("pw_setnameboxtophoenix");
  131. message("Ah?");
  132. message("Well... Ah...");
  133. jumptoscript("presenttrucyevidence");
  134.  
  135. [presenttrucyevidence]
  136. definevar([signal],"int");
  137. runscript("pw_setnameboxtonoone");
  138. messageauto("(Show what proves that Trucy is \na magician!)");
  139. runscript("pw_forcepresent");
  140. waitsignal("advance",[signal]);
  141. runscript("pw_hidemessagebox");
  142. loadandplaysfx("01_Phoenix - takethat.wav",0);
  143. runscript("pw_raisetakethat");
  144. wait(6);
  145. if(<compare([currentitemcode],"equal",902)>,<jumptoscript("presenttrucyevidencecorrect")>,<jumptoscript("presenttrucyevidencewrong")>);
  146.  
  147. [presenttrucyevidencecorrect]
  148. pw_showmsgbox();
  149. runscript("pw_setnameboxtophoenix");
  150. message("What about this?");
  151. runscript("setlipsynctochar");
  152. runscript("pw_setnameboxtoema");
  153. runscript("pw_enableemanormal");
  154. message("You may be right.");
  155. message("But who gave you this?");
  156. jumptoscript("presenttrucyprofile");
  157.  
  158. [presenttrucyevidencewrong]
  159. pw_showmsgbox();
  160. runscript("pw_setnameboxtophoenix");
  161. message("What about this?");
  162. runscript("setlipsynctochar");
  163. runscript("pw_setnameboxtoema");
  164. runscript("pw_enableemanormal");
  165. message("What is this supposed to mean \nanyway?");
  166. jumptoscript("presenttrucyevidence");
  167.  
  168. [presenttrucyprofile]
  169. definevar([signal],"int");
  170. runscript("pw_setnameboxtonoone");
  171. runscript("setlipsynctonoone");
  172. messageauto("(Show who gave you this \nphoto!)");
  173. setvar([pwonetypepresent],2);
  174. runscript("pw_forcepresent");
  175. waitsignal("advance",[signal]);
  176. runscript("pw_hidemessagebox");
  177. runscript("pw_raisetakethat");
  178. wait(6);
  179. if(<compare([currentitemcode],"equal",801)>,<jumptoscript("presenttrucyprofilecorrect")>,<jumptoscript("presenttrucyprofilewrong")>);
  180.  
  181. [presenttrucyprofilecorrect]
  182. pw_showmsgbox();
  183. runscript("pw_setnameboxtophoenix");
  184. message("What about this?");
  185. runscript("setlipsynctochar");
  186. runscript("pw_setnameboxtoema");
  187. runscript("pw_enableemanormal");
  188. runscript("setlipsynctochar");
  189. message("Hmmm, that is interesting...");
  190. jumptoscript("questionexample");
  191.  
  192. [presenttrucyprofilewrong]
  193. pw_showmsgbox();
  194. runscript("pw_setnameboxtophoenix");
  195. message("What about this?");
  196. runscript("setlipsynctochar");
  197. runscript("pw_setnameboxtoema");
  198. runscript("pw_enableemanormal");
  199. runscript("setlipsynctochar");
  200. message("I'm not sure about this, you \nknow...!");
  201. jumptoscript("presenttrucyprofile");
  202.  
  203. [simpleexamine]
  204. pw_showmsgbox();
  205. setbuttonarea("pw_examinearea1",157,302,81,23);
  206. setvar([pw_examinemaxplaces],1);
  207. runscript("pw_showtouchananswer");
  208. messageauto("So, what is wrong in this place?");
  209. runscript("hidepwmenu");
  210. runscript("pw_showspecialexamine");
  211. runscript("pw_waitexaminetouch");
  212. runscript("hidepwmenu");
  213. runscript("pw_showadvarrowmenu");
  214. runscript("pw_hidetouchananswer");
  215. if(<compare([pw_examinearea],"equal",1)>,<jumptoscript("simpleexaminecorrect")>,<jumptoscript("simpleexaminewrong")>);
  216.  
  217. [simpleexaminecorrect]
  218. pw_showmsgbox();
  219. runscript("pw_setnameboxtophoenix");
  220. runscript("pw_setnameboxtonoone");
  221. message("Here!");
  222. runscript("setlipsynctochar");
  223. runscript("pw_setnameboxtoema");
  224. runscript("pw_enableemanormal");
  225. runscript("setlipsynctochar");
  226. message("Hmm, yeah, it looks \ninteresting...!");
  227. jumptoscript("questionexample");
  228.  
  229. [simpleexaminewrong]
  230. pw_showmsgbox();
  231. runscript("pw_setnameboxtophoenix");
  232. runscript("pw_setnameboxtonoone");
  233. message("This is what proves... er...");
  234. runscript("setlipsynctochar");
  235. runscript("pw_setnameboxtoema");
  236. runscript("pw_enableemanormal");
  237. runscript("setlipsynctochar");
  238. message("I'm not sure about this, you \nknow...!");
  239. jumptoscript("simpleexamine");
  240.  
  241. [questionexample]
  242. definevar([qreplysignal],"int");
  243. messageauto("But, what was Trucy's \nlast name again?");
  244. runscript("pw_showselectananswer");
  245. setvar([pw_maxquestions],4);
  246. setvar([pw_q1gfx],91000);
  247. setvar([pw_q2gfx],91010);
  248. setvar([pw_q3gfx],91020);
  249. setvar([pw_q4gfx],91030);
  250. runscript("hidepwmenu");
  251. runscript("pw_setupquestions");
  252. runscript("pw_showquestion");
  253. waitsignal("qreply",[qreplysignal]);
  254. runscript("pw_hideselectananswer");
  255. runscript("hidepwmenu");
  256. runscript("pw_showadvarrowmenu");
  257. if(<compare([qreplysignal],"equal",3)>,<jumptoscript("questionexamplecorrect")>,<jumptoscript("questionexamplewrong")>);
  258.  
  259. [questionexamplewrong]
  260. message("That doesn't seem right...");
  261. jumptoscript("questionexample");
  262.  
  263. [questionexamplecorrect]
  264. message("You're correct!");
  265. message("Now,to the court!");
  266. jumptoscript("scn2");
  267.  
  268. [scn2]
  269. setgenobjgraphic("pw_crowitness",-7000);
  270. setgenobjgraphic("pw_crojudge",-7001);
  271. setgenobjgraphic("pw_croprosecutor",-7002);
  272. setgenobjgraphic("pw_croattorney",-7003);
  273. runscript("pw_showcourtroomoverview");
  274. wait(240);
  275. runscript("pw_hidecourtroomoverview");
  276. runscript("pw_showgavelhit");
  277. runscript("pw_showjudgetable");
  278. runscript("pw_enablejudgenormal");
  279. runscript("setlipsynctochar");
  280. runscript("showpwchar");
  281. runscript("pw_setnameboxtojudge");
  282. message("Court is now in session.\nThe trial of Ema Skye shall commence.");
  283. runscript("pw_showattorneystand");
  284. runscript("pw_setnameboxtophoenix");
  285. runscript("pw_enablephoenixnormal");
  286. message("The defense is ready,Your Honor.");
  287. setvar([sld_targetcharanim],"pw_enablefranziskanormal");
  288. runscript("pw_slideattoneytoprosecutor");
  289. runscript("pw_setnameboxtofranziska");
  290. message("The prosecution is ready,Your Honor.");
  291. jumptoscript("ematest1");
  292. [ematest1]
  293. stopmp3(0);
  294. runscript("showpwchar");
  295. runscript("pw_showwitnessstand");
  296. setvar([pw_crossmessage],"\n --The Knife--");
  297. setmsgboxtextcolor(255,0,255,0);
  298. pw_showmsgbox();
  299. runscript("pw_setnameboxtonoone");
  300. runscript("pw_enableemadown");
  301. messageinstantauto("\n --The Knife--");
  302. setmsgboxtextcolor(255,255,255,255);
  303. runscript("pw_showwitnesstestimony");
  304. runscript("pw_showtestimony");
  305. runscript("pw_setnameboxtoema");
  306. runscript("pw_enableemanormal");
  307. pw_showmsgbox();
  308. runscript("setlipsynctochar");
  309. loadandplaymp3("music/04 - Questioning ~ Moderato 2007.ogg",0,"N");
  310. message("I bought the knife from a local seller.");
  311. message("It cost me about $4.59.");
  312. runscript("pw_enableemadown");
  313. message("But the handle broke\nwhen I used it the first time.");
  314. runscript("pw_enableemanormal");
  315. message("I didn't throw it away\nbecause the blade was very good.");
  316. message("Shame they don't make the\nhandles to the same standard.");
  317. wait(10);
  318. jumptoscript("pctalk");
  319.  
  320. [pctalk]
  321. setvar([sld_targetcharanim],"pw_enablefranziskanormal");
  322. runscript("pw_slidewitnesstoprosecutor");
  323. runscript("pw_setnameboxtofranziska");
  324. message("My hair is natural.");
  325. runscript("pw_usepsychelock1lock");
  326. messageappend("");
  327. runscript("pw_removepsychelock1lock");
  328. runscript("pw_hidepsychelock");
  329. wait(10);
  330. setvar([sld_targetcharanim],"pw_enableemanormal");
  331. runscript("pw_slideprosecutortowitness");
  332. jumptoscript("crossstart");
  333. [crossstart]
  334. setvar([pw_crossexamattorneycode],36);
  335. setvar([pw_crossexamprosecutorcode],31);
  336. pw_showmsgbox();
  337. runscript("pw_setnameboxtonoone");
  338. messageinstantauto("\n --The Knife--");
  339. runscript("pw_showcrossexaminationvs");
  340. runscript("pw_showpwmenubasicrec");
  341. runscript("hidepwmenu");
  342. runscript("begincrossexamination");
  343. setvar([pwcrossexamstages],4);
  344. pw_showmsgbox();
  345. jumptoscript("cross1-1");
  346.  
  347. [cross1-1]
  348. definevar([signal],"int");
  349. setmsgboxtextcolor(255,0,255,0);
  350. runscript("pw_enableemaunsure");
  351. runscript("pw_setnameboxtoema");
  352. message("I bought the knife from a local seller");
  353. waitsignal("advance",[signal]);
  354. if(<compare([signal],"equal",1)>,<jumptoscript("cross1present")>,<null()>);//present
  355. if(<compare([signal],"equal",2)>,<jumptoscript("cross11press")>,<null()>);//press
  356. if(<compare([signal],"equal",4)>,<jumptoscript("cross1-2")>,<null()>);//next
  357.  
  358. [cross11press]
  359. runscript("nextpwcrossexamsimple");
  360. jumptoscript("cross1-2");
  361.  
  362. [cross1-2]
  363. definevar([signal],"int");
  364. setmsgboxtextcolor(255,0,255,0);
  365. runscript("pw_enableemaunsure");
  366. runscript("pw_setnameboxtoema");
  367. message("It cost me about $4.59.");
  368. waitsignal("advance",[signal]);
  369. if(<compare([signal],"equal",1)>,<jumptoscript("cross1present")>,<null()>);//present
  370. if(<compare([signal],"equal",2)>,<jumptoscript("cross12press")>,<null()>);//press
  371. if(<compare([signal],"equal",3)>,<jumptoscript("cross1-1")>,<null()>);//prev
  372. if(<compare([signal],"equal",4)>,<jumptoscript("cross1-3")>,<null()>);//next
  373.  
  374. [cross12press]
  375. runscript("nextpwcrossexamsimple");
  376. jumptoscript("cross1-3");
  377.  
  378. [cross1-3]
  379. definevar([signal],"int");
  380. setmsgboxtextcolor(255,0,255,0);
  381. runscript("pw_enableemaunsure");
  382. runscript("pw_setnameboxtoema");
  383. message("But the handle broke\nwhen I used it the first time.");
  384. waitsignal("advance",[signal]);
  385. if(<compare([signal],"equal",1)>,<jumptoscript("cross1present")>,<null()>);//present
  386. if(<compare([signal],"equal",2)>,<jumptoscript("cross13press")>,<null()>);//press
  387. if(<compare([signal],"equal",3)>,<jumptoscript("cross1-2")>,<null()>);//prev
  388. if(<compare([signal],"equal",4)>,<jumptoscript("cross1-4")>,<null()>);//next
  389.  
  390. [cross13press]
  391. runscript("nextpwcrossexamsimple");
  392. jumptoscript("cross1-4");
  393.  
  394. [cross1-4]
  395. definevar([signal],"int");
  396. setmsgboxtextcolor(255,0,255,0);
  397. runscript("pw_enableemaunsure");
  398. runscript("pw_setnameboxtoema");
  399. message("I didn't throw it away\nbecause the blade was very good.");
  400. waitsignal("advance",[signal]);
  401. if(<compare([signal],"equal",1)>,<jumptoscript("cross1present")>,<null()>);//present
  402. if(<compare([signal],"equal",2)>,<jumptoscript("cross14press")>,<null()>);//press
  403. if(<compare([signal],"equal",3)>,<jumptoscript("cross1-3")>,<null()>);//prev
  404. if(<compare([signal],"equal",4)>,<jumptoscript("crossend")>,<null()>);//next
  405.  
  406. [cross14press]
  407. runscript("resumepwcrossexamsimple");
  408. jumptoscript("cross1-1");
  409.  
  410. [cross1present]
  411. runscript("hidepwmenu");
  412. loadandplaysfx("phoenix-obj.wav",0);
  413. runscript("pw_raiseobjection");
  414. setvar([sld_targetcharanim],"pw_enablephoenixnormal");
  415. runscript("pw_slidewitnesstoattorney");
  416. runscript("pw_setnameboxtophoenix");
  417. runscript("pw_showadvarrowmenu");
  418. setvar([pw_lifeflash],20.0);
  419. runscript("pw_showlifebar");
  420. setmsgboxtextcolor(255,240,240,240);
  421. message("Your Honour,that statement\ncontradicts this evidence!");
  422. runscript("pw_showjudgetable");
  423. runscript("pw_enablejudgenormal");
  424. runscript("pw_setnameboxtojudge");
  425. message("How does it contradict\nthe evidence exactly?");
  426. runscript("pw_showattorneystand");
  427. runscript("pw_setnameboxtophoenix");
  428. runscript("pw_enablephoenixsweating");
  429. message("It doesn't,does it?");
  430. runscript("pw_showjudgetable");
  431. runscript("pw_enablejudgemad");
  432. runscript("pw_setnameboxtojudge");
  433. message("I'm sorry Mr Wright,\nbut I'm going to have to penalise you!");
  434. modifyvar([pw_lifecurrent],"subtract",20.0);
  435. setvar([pw_lifeflash],0.0);
  436. loadandplaysfx("sfx-damage2.wav",0);
  437. runscript("pw_hidelifebar");
  438. runscript("pw_showlifebar");
  439. runscript("hidepwmenu");
  440. runscript("pw_showwitnessstand");
  441. runscript("pw_enableemaunsure");
  442. runscript("showpwcrossexamination");
  443. jumptoscript("cross1-4");
  444.  
  445. [crossend]
  446. runscript("resumepwcrossexamsimple");
  447. jumptoscript("cross1-1");
  448.  
  449. [random] expands(hidepwmenu)
  450. loadandplaysfx("sfx-alitawings.wav",1);
clone this paste RAW Paste Data