home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-387-Vol-3of3.iso / d / d-linux.zip / dm-dist / doc / actions.doc next >
Text File  |  1991-03-01  |  3KB  |  67 lines

  1. /* ************************************************************************
  2. *  Copyright (C) 1990, 1991 - see 'license.doc' for complete information. *
  3. ************************************************************************* */
  4.  
  5.  
  6.            --- On the handling facilities for 'social actions'---
  7.  
  8.  
  9. A general system exists to handle the 'social' commands, ie. commands that
  10. have no game-related purpose save to convey emotions between players. These
  11. are handled by the procedure
  12.  
  13.     void do_action(struct char_data *ch, char *argument, int cmd);
  14.  
  15. This procedure reacts in accordance with the contents of lib/actions, which
  16. is a text file with information arranged after the following format:
  17.  
  18. --------------------------------------------
  19. <command number> <hide-flag> <minimum position of victim>
  20. <messg to character if no argument>
  21. <messg to others if no arg>                
  22. <messg to char if victim found>           <---If this field is empty,
  23. <messg to others if victim found>          <- 
  24. <messg to victim>                            | then these fields must be
  25. <messg to char if victim not found>          | skipped, and the action will
  26. <messg to char if vict is char>              | ignore arguments.
  27. <messg to others if vict is char>          <-
  28.  
  29. <command number> <hide-flag> <minimum position of victim>
  30. .
  31. .
  32. .
  33. .
  34. .
  35.  
  36.  
  37. -1
  38. -------------------------------------------------
  39.  
  40. A message must be contained in one line.
  41.  
  42. The hide-flag, if nonzero, makes the procedure hide the action from OTHERS,
  43. if they cannot see the character. The action won't be hidden from the VICTIM,
  44. even if he/she cannot see the character (the character's name will, of course,
  45. be replaced with "someone").
  46.  
  47. Where it makes sense to do so, text fields may be left empty. This is done by
  48. putting a '#' in the first column on the line. 
  49.    This is permissible for the following fields:
  50.  
  51. a: messg to others if no arg
  52. b: messg to others if victim found
  53. c: messg to others if vict is char
  54.  
  55. NOTE again that if the field _messg to char if victim found_ is empty, then
  56. the following fields must be omitted entirely (not even the '~'), and the
  57. action will ignore any arguments supplied.
  58.  
  59. The procedure sends the text strings through act(), and they may contain
  60. control codes (see the documentation for act() in comm.doc. Note that not all
  61. of act()'s control codes may be used.
  62.  
  63. In order to improve execution speed, no tests are made on the consistency of
  64. the usage of these codes. Hence, grave disorder may be the result if, say,
  65. the code '$N' occurs in a text field that doesn't naturally refer to a victim;
  66. like _messg to others if no arg_. 
  67.