home *** CD-ROM | disk | FTP | other *** search
- # d_0 JawaTalk.cog
- #
- # A simple communiCog ripped off from Doug
- #
- # Desc:
- # Sucker Fool I stole it from Matt, I didn't even change
- # The variable GONK. - Love Ya, Doug
- #
- # Yeah, well I stole it back so bite me. --Matt
- # 12/08/97 DGS Stole from Matt's GonkTalk
- # 12/08/97 MST Stole back from Doug's JawaTalk
- #-----------------------------------------------------------------------------
-
- symbols
- message converse
- message startup
- message arrived
- message pulse
- message timer
-
- thing Gonk
- thing player local
- thing x2callcratedummy
- thing x3angledummy
- thing x4launchdummy
-
- surface block1
- surface block2
- surface block3
-
- int Met=0 local
- int spoken_1=0 local
- int ConversationActive=0 local
- int gonkcurframe=0 local
- int ResponseID local
- int walkthatjawa=0 local
- flex wait_time=1.3 local
- thing teledest
- end
-
-
- code
- startup:
- if (getdifficulty()==2) {
- print("this is difficulty 2");
- setfacegeomode(block1, 0);
- setfacegeomode(block2, 0);
- setfacegeomode(block3, 0);
- teleportthing(gonk, teledest);
- }
- settimer(3);
- x2pos=getthingpos(x2callcratedummy);
- x3pos=getthingpos(x3angledummy);
- x4pos=getthingpos(x4launchdummy);
- walkthatjawa=0;
- hastalked=0;
- // call walkthatjawa;
- player=getlocalplayerthing();
- return;
-
- converse:
- dwplayplayerresponse();
- playerpos=getthingpos(player);
- settimer(0);
- # What response did the player select?
- ResponseID = dwGetPlayerResponse();
-
-
- if (ResponseID == 0 && !ConversationActive) {
- # Response 0 is reserved to indicate that a conversation is starting
- ConversationActive = 1;
- PlaySong(0,0,0);
- dwfreezeplayer();
- ResponseID = 1;
- }
-
- if (ResponseID == 1) { #beginning Node
- print("jawaiswalking=");
- printint(jawaiswalking);
- print("sentbyplayer=");
- printint(sentbyplayer);
- if ((jawaiswalking==1)&&(sentbyplayer==1)) {
- print("hold on!");
- dwplaycharacterspeech("JR8", "t1jc012.wav");
- dwcleardialog();
- ConversationActive=0;
- ShuffleTracks(2, 3, 4, 5);
- dwunfreezeplayer();
- //call walkthatjawa;
- }
- else if ((jawaiswalking==1)&&(sentbyplayer==0)) {
- jawaishere=getthingpos(gonk);
- aisetmovepos(gonk, jawaishere);
- aisetlookpos(gonk, playerpos);
- target=jawaishere;
- setpulse(1);
- print("I'm guessing it would crash here");
- dwplaycharacterspeech("JR0", "t1jc001.wav"); # Hello droid. May I help you?
- dwAddResponse(100, "PDR1", "t1xx001.wav", 71); // What do I do here?
- dwAddResponse(700, "PDR7", "t1xx007.wav", 20); // Goodbye.
- }
- else if ((met == 2)&&(sentbyplayer!=1)) {
- print("meeting again.");
- dwplaycharacterspeech("JR0A", "t1jc002.wav"); # Hello again, droid. Do you have more questions?
- dwAddResponse(100, "PDR1", "t1xx001.wav", 71); // What do I do here?
- dwAddResponse(700, "PDR7", "t1xx007.wav", 20); // Goodbye.
- }
- else if ((met ==0)&&(sentbyplayer!=1)) {
- print("initial meeting");
- dwplaycharacterspeech("JR0", "t1jc001.wav"); # Hello droid. May I help you?
- met = 2;
- dwAddResponse(100, "PDR1", "t1xx001.wav", 71); // What do I do here?
- dwAddResponse(700, "PDR7", "t1xx007.wav", 20); // Goodbye.
- }
- else if (sentbyplayer==1) {
- sentbyplayer=0;
- print("sent by player");
- if (jawaisat<=2) {
- dwplaycharacterspeech("JR2", "t1jc006.wav");
- dwAddResponse(150, "JAP000", "t7xx001.wav", 60);
- }
- else if (jawaisat<=3) {
- dwplaycharacterspeech("JR3", "t1jc007.wav");
- dwAddResponse(150, "JAP000", "t7xx001.wav", 60);
- }
- else if (jawaisat<=4) {
- dwplaycharacterspeech("JR4", "t1jc008.wav");
- dwAddResponse(150, "JAP000", "t7xx001.wav", 60);
- }
- else if (jawaisat<=5) {
- print("i'm begging you.");
- setpulse(0);
- aisetlookpos(gonk ,getthingpos(player));
- aisetmode(gonk, 0x4);
- settimer(3);
- }
- }
- else {
- print("the catchall");
- stopthing(jawa);
- setpulse(0);
- aisetmovepos(gonk, getthingpos(player));
- aisetlookpos(gonk, getthingpos(player));
- dwplaycharacterspeech("JR0", "t1jc001.wav");
- dwAddResponse(100, "PDR1", "t1xx001.wav", 72); // What do I do here?
- dwAddResponse(700, "PDR7", "t1xx007.wav", 20); // Goodbye.
- }
- }
- if (ResponseID == 100) // # Security
- {
- dwplaycharacterspeech("JR1", "t1jc005.wav");
- dwAddResponse(150, "JAP000", "t7xx001.wav", 60); // Back to root node (ID 1);
- }
-
- if (ResponseID == 150) {
- dwplaycharacterspeech("JR01", "t1jc003.wav"); // Do you have any questions?
- dwAddResponse(900, "PDR9", "t6xx012.wav", 72); // What are you doing here?
- dwAddresponse(200, "PDR2", "t1xx002.wav", 71); // How do I call a crate?
- dwAddResponse(300, "PDR3", "t1xx003.wav", 72); // How do I adjust the angle?
- dwAddResponse(400, "PDR4", "t1xx004.wav", 73); // How do I launch a crate?
- // dwAddResponse(500, "PDR5", "t1xx005.wav", 71); // Why do you Jawas wear cloaks?
- dwAddResponse(1000, "PDR10", "t1xx010.wav", 73);
- dwAddResponse(700, "PDR6", "t1xx006.wav", 71); // Goodbye
- }
- if (ResponseID == 200) { // # How do I call a crate?
- if ((jawaisat>=2)&&(jawaisat>0)) {
- dwplaycharacterspeech("JR02", "t1jc004.wav");
- dwAddResponse(7, "JAP000", "t7xx001.wav", 60); // Back to Root node (ID 1);
- jawawantstogoto=2;
- sentbyplayer=1;
- }
- else {
- dwplaycharacterspeech("JR2", "t1jc006.wav");
- dwAddResponse(150, "JAP000", "t7xx001.wav", 60);
- }
- }
- if (ResponseID == 300) { // # How do I adjust the angle?
- if ((jawaisat>3)||(jawaisat<=2)) {
- dwplaycharacterspeech("JR02", "t1jc004.wav");
- dwAddResponse(7, "JAP000", "t7xx001.wav", 60); // Back to Root node (ID 1);
- jawawantstogoto=3;
- sentbyplayer=1;
- }
- else {
- dwplaycharacterspeech("JR3", "t1jc007.wav");
- dwAddResponse(150, "JAP000", "t7xx001.wav", 60);
- }
- }
- if (ResponseID == 400) { // # How do I launch crate?
- if ((jawaisat>4)||(jawaisat<=3)) {
- dwplaycharacterspeech("JR02", "t1jc004.wav");
- dwAddResponse(7, "JAP000", "t7xx001.wav", 60); // Back to Root node (ID 1);
- jawawantstogoto=4;
- sentbyplayer=1;
- }
- else {
- dwplaycharacterspeech("JR4", "t1jc008.wav");
- dwAddResponse(150, "JAP000", "t7xx001.wav", 60);
- }
- }
- if (ResponseID == 900) {
- dwplaycharacterspeech("JR7", "t1jc011.wav");
- dwAddResponse(150, "JAP000", "t7xx001.wav", 60);
- }
- if (ResponseID == 1000) {
- dwplaycharacterspeech("JR9", "t1jc013.wav");
- dwAddResponse(150, "JAP000", "t7xx001.wav", 60);
- }
- if (ResponseID == 500) // // Why wear cloaks?
- {
- dwplaycharacterspeech("JR5", "t1jc009.wav");
- dwAddResponse(150, "EDP024", "t1xx014.wav", 70); // Back to Root node (ID 1);
- walkthatjawa=5;
- }
- if (ResponseID == 700) // # bye
- {
- #PLAYER: Gotta go!
- # Terminate the conversation
- dwplaycharacterspeech("JR6", "t1jc010.wav");
- dwcleardialog();
- ConversationActive=0;
- ShuffleTracks(2, 3, 4, 5);
- # Enable the player
- dwunfreezeplayer();
- settimer(3);
- }
- if (ResponseID == 7)
- {
- #PLAYER: Gotta go!
- # Terminate the conversation
- dwcleardialog();
- ConversationActive=0;
- ShuffleTracks(2, 3, 4, 5);
- # Enable the player
- dwunfreezeplayer();
- call walkthatjawa;
- }
- return;
-
- walkthatjawa:
- // print ("walk that jawa called");
- if (ConversationActive==1) return;
-
- settimer(0);
- aiclearmode(gonk, 0xa06);
- aisetmovespeed(gonk, 0.7);
- setpulse(1);
- jawaiswalking=1;
- if (jawawantstogoto<=2) {
- aisetlookpos(gonk, x2pos);
- aisetmovepos(gonk, x2pos);
- target=x2pos;
- }
- else if (jawawantstogoto<=3) {
- aisetlookpos(gonk, x3pos);
- aisetmovepos(gonk, x3pos);
- target=x3pos;
- }
- else if (jawawantstogoto<=4) {
- aisetlookpos(gonk, x4pos);
- aisetmovepos(gonk, x4pos);
- target=x4pos;
- }
- else if (jawawantstogoto<=5) {
- setpulse(0);
- aisetlookpos(gonk ,getthingpos(player));
- aisetmode(gonk, 0x4);
- settimer(3);
- }
- return;
-
- pulse:
- if (vectordist(getthingpos(gonk), target) < .25) {
- setpulse(0);
- sleep(1.5);
- aisetlookpos(gonk ,getthingpos(player));
- aisetmode(gonk, 0x4);
- settimer(3);
- jawaiswalking=0;
- jawaisat=jawawantstogoto;
- jawawantstogoto=0;
- }
- return;
-
- timer:
- xRandom=rand();
- if (xRandom>=.5) {
- aisetlookpos(gonk, getthingpos(player));
- settimer(3);
- }
- else {
- sentbyplayer=0;
- // print("there he goes.");
- jawawantstogoto=xRandom*10;
- // printint(jawawantstogoto);
- call walkthatjawa;
- }
- return;
-
- end
-
-
-
-
-
-
-