home *** CD-ROM | disk | FTP | other *** search
/ ftp.wwiv.com / ftp.wwiv.com.zip / ftp.wwiv.com / pub / BBS / LUNAT20E.ZIP / STRUCTS.DOC < prev    next >
Text File  |  1995-05-22  |  16KB  |  309 lines

  1. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  2. STRUCTS.DOC:  The purpose of this file is to explain the workings of the
  3.               player files, and IGM inclusion, for 3rd Party IGM development.
  4. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  5. This file will be modified for ease of use later.  For now, all the info
  6. you should need will be presented here.  If you have any suggestions for
  7. simplifying this document, please let me know... I know it's probably a
  8. bit too technical, but I simplified as much as I could... :)
  9. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  10.  
  11.  
  12. To begin, here is a summary of the format of the two master player files.
  13.  
  14.  
  15. NAMELIST.DAT has a line-entry format of Real Name ~Alias Name.
  16. So when reading a person's name from the drop file, it should be compared
  17. to the Real Name portion (Left of the ~) to match up and retrieve the
  18. Alias Name (right of the ~).  Players will have a 1-line entry in the
  19. NAMELIST.DAT file.  This is a sequential access text file, which will be
  20. located in the MASTER LUNATIX directory.
  21.  
  22.  
  23.  
  24. The Alias name is then used in PLAYERS.DAT, which is a random-access file
  25. with 240 characters per record.  The 240 characters must be broken down
  26. by the program and interpreted.  This will be in the MASTER LUNATIX
  27. directory.  Here is a list of the data in each record:
  28.  
  29. COUNT      MEANING             NOTES
  30. ----------------------------------------------------------------------------
  31.    15      Alias$              Used to look up the person's record
  32.     8      Money$              How many Crazy Bucks are on-hand
  33.     8      Stash$              How many Crazy Bucks are in the stash
  34.     1      Sex$                M for Male and F for Female
  35.     4      CurCode$            Current Escape Code, I.E. 0110
  36.    20      NotAgain$           This will be explained below
  37.     1      Weapon$             A to L... which weapon is in hand
  38.     1      Defense$            A to L... which defense is in hand
  39.     8      Hit$                How many Hit Points a player has
  40.     8      Exp$                How many experience points a player has
  41.     2      Level               1 to 12, Player's skill level
  42.     8      LastPlay$           Date of last play, in the form MM/DD/YY
  43.     2      ClosFig$            Closet fights remaining
  44.     1      PlayFig$            Player Fights Remaining
  45.     3      PlayKill$           Count of Player Kills
  46.    10      GuardNam$           The name of the Player's guard
  47.     8      PayGuard$           How much the guard accepted as a bribe
  48.   132      Rest$               Remaining padding characters in record
  49. ----------------------------------------------------------------------------
  50.  
  51.  
  52.  
  53. The NotAgain$ can be broken down into its composite components also:
  54.  
  55. COUNT  MEANING                   NOTES
  56. ----------------------------------------------------------------------------
  57.     1  Can Attempt Escape        Space=Yes, Non-Space = no
  58.     1  Is player Alive           Space=Yes, ^=No, #=Will be alive tomorrow
  59.     1  Can "Do something Crazy"  Space=Yes, Non-Space = no
  60.     1  Has Unfair Advantage      Space=Yes, Non-Space = no
  61.     1  Can Flirt with Nurse      Space=Yes, Non-Space = no
  62.     1  Next Available Flirt      1 to 6
  63.     3  Times Laid                Three-Digit Bedpost Notches
  64.     1  Days since Last Play      0 to 9 days since last play
  65.     1  Times Escaped             How many times at level-12 (won)
  66.     1  Can Play Prank            Space=Yes, Non-Space = no
  67.     1  Is "Awake" on a node      Space=No,  Non-Space = Yes
  68.     1  Can "Be a Nuisance"       Space=Yes, Non-Space = no
  69.     1  Has looked at map         Space=No,  Non-Space = Yes
  70.     3  Guessed codes count       How many times to guess the right passcode
  71.     1  Unused                    Not in use right now
  72.     1  Reserved                  always a "|" ending symbol
  73.  
  74.  
  75.  
  76. When creating an IGM, your program may read and write to these files, however
  77. be SURE you know what you're doing, otherwise you can corrupt these files.
  78. You may choose to create your own datafiles with variables specific to
  79. Your module.
  80.  
  81.  
  82.  
  83. Your IGM will need to begin by reading three files in addition to these
  84. player files.  The LINKTO.BBS points to the drop file, and the third file
  85. is LUNATIX.CFG for configuration info.
  86.  
  87.  
  88.  
  89. LINKTO.BBS is sequential access.  For an example, install Lunatix as
  90. usual, then look at the LINKTO.BBS file.  It will be located in the NODE
  91. directory, which won't necessarily be the MASTER LUNATIX directory.
  92. The format of this file, line by line, is:
  93.  
  94. Format     Meaning
  95. ----------------------------------------------------------------------------
  96. String     Full Path & Name of Door Drop file
  97. ## ## ##   Line Number, Starting Character, and Length of User Name
  98. ## ## ##   Line Number, Starting Char, and Length of Com Port
  99. ## ## ##   -- Minutes... but an IGM will read the time from a different file
  100. ## ## ##   -- Ignore this also, because if the game runs, ANSI is enabled
  101. ## ## ##   Line Number, Starting Char, and Length of Baud Rate
  102. N81        Or another modem setup string
  103. ##         IRQ.... 0=Default for the port, or other number is other IRQ
  104. #          Handshake type. 0=None, 1=XON/XOFF, 2=RTS/CTS, 3=Both
  105. #          Port is Locked?  0=No, 1=Yes
  106.  
  107. Use the first line, which is the Drop File, in your own OPEN statement.
  108. Sorry, you must read from the drop file that is given, using the data
  109. formats that are listed in the lines under it.  For example, if the top
  110. line says C:\RENEGADE\CALLINFO.BBS, and the second line says 01 01 30, then
  111. your will be resposible for opening Callinfo.BBS, then grabbing the player's
  112. BBS user-name (as it will appear in NAMELIST.DAT) which will be at
  113. line 1, column one, 30 characters long.  If the third line in LINKTO.BBS says
  114. 12 03 05, then you will read the COM port from CALLINFO.BBS, starting at line
  115. 12, column (or character) 3, with a length of 5 characters.  It seems
  116. complicated, but I chose not to send this information to another file for
  117. and IGM to read.  If a programmer is willing to do this, then I hope that
  118. the quality of the IGM will be good, also. :)
  119.  
  120.  
  121.  
  122.  
  123. LUNATIX.CFG is Random Access, 80 characters per record (1 line).  It will
  124. be in each NODE directory, which isn't necessarily the MASTER LUNATIX
  125. directory.  It has the following Format, line (or record) by line:
  126.  
  127. Format     Meaning
  128. ----------------------------------------------------------------------------
  129. String     Key line 1, Not needed for IGM
  130. String     Key line 2, also not needed for IGM
  131. String     Name of the Clinic (Imenz Aine was the default)
  132. String     Full Path and Name of Todays News file
  133. String     Full Path and Name of Yesterday's News file
  134. ##         Max Closet fights allowed per day
  135. #          Max Player fights allowed per day
  136. String     Full Path to Lunatix's master node (I.E. C:\LUNATIX\)
  137.  
  138. Note: All the data in these files may be read in as strings.  Just take note
  139. if the file is sequential (read 1 whole line at a time) or random (read
  140. record #x which is y-characters long).
  141.  
  142.  
  143. Your IGM will read the Todays News file name from LUNATIX.CFG (line 4).
  144. You may append news information to this file (it's sequential) by opening
  145. it in append mode and adding news info.  This way, your IGM can be a working
  146. part of the whole game. :)
  147.  
  148.  
  149.  
  150. Your IGM may also write to the mail file.  The mail files are named
  151. MAIL.X where X is the record number of a user, as it appears in order in
  152. PLAYERS.DAT.  Whoever is Record 1 in PLAYERS.DAT has MAIL.1... whoever is
  153. record 15 has MAIL.15, for instance.  By searching for a player in the
  154. PLAYERS.DAT and noting the record number, you may add to that player's mail.
  155. Take note, a special line may be put in a player's mail file, which tells
  156. the Mail Reader that the player may respond to someone.  the format is:
  157. |A####Alias Name   where #### is the Record Number of the user that would be
  158. written back to, and the Alias Name is that player's name.  An Example is:
  159. |A2   Mr. Rogers    This means write back to player 2, who is Mr. Rogers.
  160. |A42  Santa Clause  This means write back to player 42, who is Santa Clause.
  161. The "|A" will always begin the "do you wish to respond" info line, it's
  162. important that the Alias Name begin at character 7, if you plan to write
  163. mail that gives the option of writing back to the author.  Note:  Be SURE
  164. you understand this, and that the line is a valid record number, otherwise
  165. you might cause the game to crash when a user reads the mail!
  166.  
  167.  
  168.  
  169. Assume this when writing an IGM:
  170.  
  171. Lunatix is being run from a NODE directory, which may only contain
  172. LINKTO.BBS and LUNATIX.CFG.  An entry in the LUNATIX.CFG contains the path
  173. name to the MASTER LUNATIX directory.  Since a batch file is probably calling
  174. Lunatix, it will call the LUNATIX.EXE from within the NODE directory.  Since
  175. the current directory is the NODE directory, Lunatix reads the 2 required
  176. data files, and finds the MASTER path, which it uses for its own data files.
  177. In this manner, Lunatix is easily multi-node, with one main copy in a MASTER
  178. directory (Usually \LUNATIX\ directory, but not necessarily).
  179.  
  180. When your IGM gets control, the DEFAULT directory should be the NODE
  181. directory.  Your IGM will need to install any of its own NODE files into
  182. each NODE directory... handle this in your own way.  Anyway, as your IGM
  183. starts, it should open "LINKTO.BBS" for instance, with no path specified,
  184. to read info for the current node.  It should read the MASTER path from
  185. the node files, and access the datafiles by using the data path plus the
  186. file name, such as: DatPath$ + "NAMELIST.DAT"
  187.  
  188. A file called TIMELEFT.DAT will also be placed into the NODE directory.
  189. When your IGM gets control, it should read Minutes from the top line and
  190. Seconds from the second line.  When your program ends, be sure to write
  191. back to this file with the Minutes (top line) and Seconds (second line)
  192. remaining, so Lunatix can maintain a semi-accurate time remaining.
  193.  
  194.  
  195.  
  196.  
  197. Your IGM should follow this general logic flow:
  198. ----------------------------------------------------------------------------
  199. Open LINKTO.BBS
  200.      Process this file, using it to open and process the Drop File
  201.      Which is specified by the top line, retreiving COM port,
  202.      User name (User$) and so on.
  203. Open COM
  204.      Setup of the communications parameters based on info from LINKTO and
  205.      the DropFile it references.
  206. Open LUNATIX.CFG
  207.      Input the info from this file, including the MASTER path (DatPath$)
  208. Open YOUR.CFG 
  209.      If your IGM includes its own configuration file, open and read from it.
  210. Open DatPath$ + NAMELIST.DAT
  211.      Look-up the Alias name for the User Name in the line format of
  212.      User$ ~Alias$
  213. Open DatPath$ + PLAYERS.DAT
  214.      Search this random-access file, record by record, for Alias$, then
  215.      read in the information for Alias$ (user).  You may also take note
  216.      of the record number, and use this when saving progress.. put #1, NUM
  217.      for instance, where NUM=Player record number.
  218. Open TIMELEFT.DAT (in the NODE directory, no DatPath$ needed)
  219.      Input Minutes and Seconds remaining, for use in your IGM.
  220. Game Play
  221.      Your game begins at this point, after everything is set up.
  222.      Be sure to save the player record frequently (I do at each game
  223.      prompt) so if it crashes, the player won't loose any progress.
  224. Save TIMELEFT.DAT
  225.      Do this before your IGM releases control back to Lunatix
  226. Exit Game
  227.      any wrap-up things should happen before the IGM ends.
  228.  
  229.  
  230.  
  231. Take note, that Lunatix "Shells" out to your IGM.  It doesn't create a
  232. batch file that controls the program-to-program flow, it literally drops
  233. out to your IGM.  Take note of this, because this lowers the amount of
  234. RAM you'll have to play with, since Lunatix should still be sitting there
  235. in Memory (I think).
  236.  
  237.  
  238. Your IGM should be easy to INSTALL since it gets all its info from
  239. existing data files.  Basically, you'll need to install your own setup
  240. file into each node that the user specifies.  Your setup file should contain
  241. the Path and Name of your .EXE file, stored in the NODE directory, so when
  242. your IGM gets control, it uses this much like the DatPath$ to find your
  243. path.  Ideally, your IGM should not install into the MASTER directory, it
  244. should reside by itself.
  245.  
  246.  
  247. Your INSTALL program should ask for the MASTER LUNATIX directory, where it
  248. will find all the player files, including a file called IGM.DAT.  Your
  249. Install should add 2 lines to the DatPath$ + IGM.DAT file, the top line
  250. is your IGM name as it will appear to users, and the second line is the
  251. executable command line.  For instance, you may have these lines added:
  252. ;This is my IGM.  Any line beginning with a ; will be a comment line.
  253. `@My `0NEW `@IGM
  254. C:\MYNEW\NEWIGM.EXE
  255. Remember, control must remain in the NODE directory, so give the full path
  256. to your IGM... then your IGM will be in the NODE directory still, to read
  257. information concerning that node's setup, as explained above.
  258.  
  259.  
  260. Your IGM should also include an option to UNINSTALL.  Many sysops could
  261. probably EDIT the IGM.DAT, but we don't want to assume that everyone can.
  262. Your Install should include the option to search for your IGM in the IGM.DAT
  263. and remove it... this is required, no IGM should be released without this
  264. ability!
  265.  
  266.  
  267.  
  268. =-=-=-=-=-=-=-=-=-=-=-=-=-=  SPECIAL NOTICE  =-=-=-=-=-=-=-=-=-=-=-=-=-=
  269. Your IGM must meet these requirements to be released as a Lunatix IGM:
  270. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=
  271. 1)  It must be structed (reading setup) as described above
  272. 2)  It must read from TIMELEFT.DAT and maintain the time remaining
  273. 3)  It must write to TIMELEFT.DAT upon completion
  274. 4)  It must be relatively easy to install
  275. 5)  It must include an UNINSTALL option
  276. 6)  If you charge for your IGM, please don't charge more than $15, which
  277.     is the cost of Lunatix itself.
  278. 7)  You MUST (and this is the most important part) upload a copy of your
  279.     IGM to us (405-924-7939) BEFORE you release it, and it must be
  280.     approved by us.  This is an attempt at quality control, and any IGM's
  281.     released without our prior approval will be considered Illegal IGM's.
  282.     We will try not to veto an IGM, although if it seriously sucks we might
  283.     have to suggest some changes before we okay its release.
  284. 8)  It should ONLY be called from the Elevator in Lunatix, not as a
  285.     pre-play module.  Anything not fitting the requirements of an IGM
  286.     should be called "Add-Ons" and also must be approved by us.
  287. 9)  Your IGM must in some way give credit to me, Mike Snyder, for writing
  288.     Lunatix.  However, I expect absolutely NO payment whatsoever from any
  289.     money your IGM earns.  Good luck, your profit is yours.
  290. 10) Your IGM must, to some extent, be humorous.  You don't have the follow
  291.     the menu-driven format that Lunatix presents, you are free to be
  292.     original.  Just... try to create something that people will LIKE!
  293. 11) Your IGM must NOT bypass the built-in registration check in Lunatix,
  294.     or offer any of the unregister-blocked features.  This means your IGM
  295.     may NOT allow a player to go past level 5, although it may add to his
  296.     experience. (If the game isn't registered, level 5 is the top, no matter
  297.     how much experience).  Your IGM may NOT allow name changes.  Also, your
  298.     IGM may NOT add interest to the stash, although you can create your own
  299.     means of earning Crazy Bucks.  Sorry, this is to insure that IGM's don't
  300.     do away with the "incentive" to register Lunatix.
  301.  
  302. If your IGM meets these requirements, and we approve it, we will add it
  303. to an IGM list which will be available with new releases of Lunatix,
  304. Time Port, and other doors we will release.
  305.  
  306.  
  307. If you have any questions, or discover that this document is incomplete,
  308. please let me know right away.  Thanks.
  309.