text_editing.html 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. <html>
  2. <head>
  3. <link href="../tutorial.css" rel="stylesheet" type="text/css">
  4. </head>
  5. <body>
  6. <div class="header">
  7. The NakedMud Tutorial :: Text editing
  8. </div>
  9. <!-- content starts here -->
  10. <div class="content-wrap"><div class="content-body-wrap"><div class="content">
  11. <div class="head">Text editing</div>
  12. <div class="info">
  13. NakedMud has a built-in text editor that can be used for editing long pieces
  14. of text -- such as room or object descriptions. Any time a large text field is
  15. edited, the built-in text editor will pop up. As a point, every player has
  16. access to a notepad, where they can write. This is intended to support the
  17. future implemention of, for instance, a mail and postoffice system. Text editing
  18. can be demonstrated with the notepad. Your notepad can be opened with the
  19. <i>write</i> command.
  20. <pre class="mud">
  21. > <font class="cmd">write</font>
  22. ==========================================================================
  23. Begin editing. /q on a new line to quit, /a to abort. /h for help
  24. ==========================================================================
  25. ]
  26. </pre>
  27. NakedMud's text editor is a line editor. That is to say, you can only edit line
  28. by line, and not character by character, like would be possible with a modern
  29. word processor. It is simple, but it is sufficient for most mud building. Once
  30. within a text editor, you can simply start writing. Here is an example:
  31. <pre class="mud">
  32. ==========================================================================
  33. Begin editing. /q on a new line to quit, /a to abort. /h for help
  34. ==========================================================================
  35. ] <font class="cmd">The nice cobblestones of Mainstreet are not as well kept, here.</font>
  36. ] <font class="cmd">A bit further to the west and south, they fade </font>
  37. ] <font class="cmd">completely to dirt roads. This is definitely not a well upkept area of town.</font>
  38. ] <font class="cmd">The city gates can be seen further to the west, along with the city walls. </font>
  39. ]
  40. </pre>
  41. Notice the uneven spacing of the text. The text editor has a formatting command
  42. to nicely align awkwardly spaced text. You can use /f to format a body of text,
  43. and /l to list the result.
  44. <pre class="mud">
  45. ] <font class="cmd">/f</font>
  46. Buffer formatted.
  47. ] <font class="cmd">/l</font>
  48. The nice cobblestones of Mainstreet are not as well kept, here. A bit further
  49. to the west and south, they fade completely to dirt roads. This is definitely
  50. not a well upkept area of town. The city gates can be seen further to the
  51. west, along with the city walls.
  52. ]
  53. </pre>
  54. The text editor supports a range of functions, including string
  55. replacement, line editing, deleting, and inserting, and buffer clearing. To
  56. obtain a list of all functions the editor has, the /h command can be used.
  57. <pre class="mud">
  58. ] <font class="cmd">/h</font>
  59. /i # txt Insert new text at the specified line number
  60. /d # Delete line with the specified number
  61. /e # txt Sets the text at the specified line to the new text
  62. /f Formats your text into a paragraph
  63. /a Quit editor and don't save
  64. /ra 'a' 'b' repalce all occurences of 'a' with 'b'
  65. /q Quit editor and save changes
  66. /l List the current buffer contents
  67. /c Clear the contents of the buffer
  68. /r 'a' 'b' replace first occurence of 'a' with 'b'
  69. /h Display editor commands
  70. ]
  71. </pre>
  72. Suppose you are dissatisfied with a description you have entered. For instance,
  73. you do not want the cobblestones to be nice but, instead worn. You can search
  74. for and replace one or all occurence of a word with the /r and /ra commands,
  75. respectively. Each command takes two arguments that must each be contained
  76. within a ' and a '. The first argument is a word to replace, and the second
  77. argument is a word to replace it with. So, let's say we want to replace all
  78. occurences of the word, nice:
  79. <pre class="mud">
  80. ] <font class="cmd">/ra 'nice' 'worn'</font>
  81. 1 occurence of 'nice' replaced with 'worn'.
  82. ] <font class="cmd">/l</font>
  83. The <font class="highlight">worn</font> cobblestones of Mainstreet are not as well kept, here. A bit further
  84. to the west and south, they fade completely to dirt roads. This is definitely
  85. not a well upkept area of town. The city gates can be seen further to the
  86. west, along with the city walls. Buildings line the street to the north up to
  87. the city wall, except for a narrow alley you spot right at the edge of the
  88. ]
  89. </pre>
  90. </div>
  91. <!-- content ends here-->
  92. </div></div></div>
  93. <!-- navigation starts here -->
  94. <div class="nav-wrap"><div class="nav">
  95. <iframe src="nav.html" height="100%" width="100%" scrolling=no frameborder=0>
  96. </iframe>
  97. <!-- navigation ends here -->
  98. </div></div>
  99. <!--div class="footer">Edit Date: Nov 15, 2008. By Geoff Hollis</div-->
  100. </body>
  101. </html>