Ultima Underworld/technical/conversations/5

From Ultima Codex
Jump to navigation Jump to search

Technical Details Warning

While the encyclopedic nature of the codex means that many articles will have information that could spoil some minor aspects of the game for newer players, this article is known to contain technical information about the game, game engine, data files, logic, etc. This information is not generally useful to the typical game players.

Continue reading at your own discretion.

This page contains decompiled conversation code from Ultima Underworld. The original files came from Paul Carr and are currently archived here.

This file has been modified from that source (by Sir Robin) in the following ways:

  • local variables holding pointers to string text have had that string text specified in a comment on that same line. This should make the conversation code easier to read.
  • strings (both dereferenced ones in the code and also the ones added to comments as specified above) have been highlighted for easier reading
  • function definitions have been anchored and function calls have been linked, to make it easier to follow the flow of the code

Start viewing the flow at main

// cnvdasm - ultima underworld conversation script disassembler / decompiler // // loading game strings // // conversation #5 // string block 0x0e05 (3589), name Eyesnack // // converting to graph // searching functions // replacing expression opcodes // folding expressions // adding control structures // fixing up functions extern int private[31]; void main() { private[1] = 0; func_029d(); func_0012(); } // end func void func_0012() { private[0] = 1; } // end func void func_0020() { int locals[1]; if ( (((npc_goal == 5 || npc_goal == 6) || npc_goal == 9) && npc_gtarg == 1 || npc_attitude == 0) ) { locals[1] = 0; } else { locals[1] = 1; } // end if return locals[1]; } // end func void func_0063() { npc_gtarg = 1; npc_attitude = 1; npc_goal = 6; func_0012(); } // end func void func_007c() { npc_goal = 1; func_0012(); } // end func void func_008b() { npc_gtarg = 1; npc_goal = 5; npc_attitude = 1; func_0012(); } // end func void func_00a4() { npc_attitude = 6; } // end func void func_00b1() { npc_attitude = param1[0]play_hunger; func_0012(); } // end func void func_00c2() { npc_attitude = 2; func_0012(); } // end func void func_00d1() { npc_attitude = 1; func_0012(); } // end func void func_00e0() { func_0012(); } // end func void func_00ea() { param1[1] = game_days; param1[2] = game_mins; } // end func void func_0106() { int locals[4]; locals[2] = game_days - param2[1]; locals[3] = game_mins - param2[2]; if ( locals[3] < 0 ) { locals[3] = locals[3] + 1440; locals[2] = locals[2] - 1; } // end if if ( locals[2] >= param1[1] && locals[3] >= param1[2] ) { locals[1] = 1; } else { locals[1] = 0; } // end if return locals[1]; } // end func void func_018f() { param1[1] = game_days - param3[1]; param1[2] = game_mins - param3[2]; if ( param1[2] < 0 ) { param1[2] = param1[2] + 1440; param1[1] = param1[1] - 1; } // end if param1[1] = param2[1] - param1[1]; param1[2] = param2[2] - param1[2]; if ( param1[2] < 0 ) { param1[2] = param1[2] + 1440; param1[1] = param1[1] - 1; } // end if } // end func void func_0243() { param1[1] = game_days - param2[1]; param1[2] = game_mins - param2[2]; if ( param1[2] < 0 ) { param1[2] = param1[2] + 1440; param1[1] = param1[1] - 1; } // end if } // end func void func_029d() { int locals[382]; if ( private[0] ) { } else { private[2] = 0; private[3] = 0; private[4] = 0; } // end if locals[3] = npc_attitude; (if dislikes Avatar) func_07ca(); (else) (if talked before) say( "Is you again." ); (if talked before and likes) say( "I glad to see you." ); say( "What@SS2 can me help you with?" ); (if know about playing for Cabirus) What didst thou play for Cabirus? Canst thou tell me of the Ghouls? goto label_0668; Canst thou tell me of the collapse? goto label_0668; Canst thou tell me of the song again? say( "Notes of tune are 3 5 4 2 3 7 8 7 5." ); Pardon me, but I must leave. func_00b1( 21 ); (if hasn't met before) say( "Who you? Me no see live human here in long time." ); I am %PCNAME. Who art thou? goto label_03e4; When didst thou last see a live human here? goto label_0779; None of thy business! goto label_07b9; label_03e4:; say( "Me Eyesnack. What you doing here?" ); I am exploring the Abyss. goto label_0424; Eyesnack. That is a peculiar name. goto label_06f1; label_0424:; say( "You strange person, wander around exploring. Since collapse 'most no one come here." ); Why did people come here before the collapse? goto label_0464; Why don't people come here anymore? goto label_0628; label_0464:; say( "This place was catacombs. People come to state hall for funeral, then march through catacombs and make tomb for dead guy. Me play flute at funerals. Long time ago." ); Thou didst play the flute? goto label_04a4; I would not expect thee to be a musician. goto label_04a4; label_04a4:; say( "Yeah, me musician. You surprised Ghoul can be musician? Me musician before me Ghoul. Me play in state hall for Cabirus all the time." ); What didst thou play for Cabirus? goto label_04e4; I'm sure thou didst play wonderfully. goto label_04e4; label_04e4:; say( "It was great. Me play all kinds stuff. Me play "Mardin's Song of Wonder" lot of times. Was Cabirus' favorite spiritual. Said that you play it in the right place, wondrous thing happen. But no one know place." ); private[2] = 1; Really? How did it go? goto label_0529; I'd like to try to play it. goto label_0529; label_0529:; private[3] = 1; say( "You got flute? Me teach song to you." ); Yes, in fact I do. goto label_056e; No, I do not. goto label_061a; label_056e:; say( "Okay, let me see flute." ); Oh, sorry. I don't have one. goto label_061a; Here it is. (if flute) say( "Hey, me no see flute." ); (if no flute) say( "This flute should work fine. Notes of tune are 3 5 4 2 3 7 8 7 5." ); private[4] = 1; private[3] = 0; I shall be sure to practice it. Thank thee, Eyesnack. label_061a:; say( "Okay, get flute and me teach you song." ); label_0628:; say( "Whole floor of Abyss was used for meetings. Was state hall, tombs, meeting rooms. No one lived here, just came for meetings. After collapse, meetings stop and people no come here." ); What was this particular area? goto label_0464; Why do the ghouls live here now? goto label_0668; label_0668:; say( "When collapse happen, food get scarce fast. Bunch of us who work here before collapse live off bodies in tombs. Start to like them better than other food. Other humans call us ghouls. Pretty soon we call selves Ghouls. Later we kicked out of tombs, move here." ); What was thy job here before the collapse? goto label_0464; Who kicked thee out of the tombs? goto label_06a8; label_06a8:; say( "Some wizard. Me no remember for sure. Shanklick, leader of Ghouls, know about wizard. Ask her." ); What was thy job here before the collapse? goto label_0464; I shall ask her, then. Farewell. label_06f1:; (if player's name Eyesnack) say( "Hey, you should talk. Your name same as mine." ); (else) say( "Not peculiar as %PCNAME." ); say( "Get name from favorite food. Is tradition. Me like eyes. They small and tasty, easy to carry around, good to eat." ); Er...I see. Didst thou say something about humans? goto label_0779; Sounds delicious. goto label_074d; label_074d:; say( "Hey, you okay for human! Most complain about Ghouls, say they evil for eating guys. Me think they just jealous because we no hungry all time like them." ); What were things like here before the collapse? goto label_0779; label_0779:; say( "Me see humans here long time ago before collapse. Before Ghouls even exist. We all just humans then." ); What did humans do here before the collapse? goto label_0464; What dost thou mean, before Ghouls exist? goto label_0668; label_07b9:; say( "You rotten live human. Me no talk to you." ); void func_07ca() { say( "Me no want to talk to you. You make me mad." ); I'm sorry, I did not mean to upset thee. npc_attitude = npc_attitude + 1; Then I choose not to speak with thee either. say( "Good!" );