Make Additional .STR files . . . Dr. Dre #1 @1 7-=1Top Administrator7=-0 Mon Feb 22 07:01:42 1993 FILE NAME : MODSTRIN.MOD WRITTEN FOR VERSION: WWIV 4.22 WRITTEN BY : Tolkien 1@3456 (WWIVnet) Snorkel 1@3459 (WWIVnet) DATE WRITTEN : 12-18-92 FILES AFFECTED : VARDEC.H STRINGS.C BBSUTL.C FUNCTION : This mod will allow you to create an external string data file which will contain all the external strings for any modification you add to your source code. REQUIRED COMPANION FILE : ESM204.ZIP (Registration of this program is essential so you can create and add external strings to the modification string data file.) In this version of WWIV (4.22), Wayne Bell has externalized all the strings. This gives you the ability to customize the look of your BBS by editing the strings. However, since WWIV continues to evolve, it is very likely that Wayne will release upgraded versions with additional strings added. For this reason, it is unwise to add strings to Wayne's existing string files. What we have chosen to do is to create an additional string file which will contain any strings which you extract from any mods you place in your code. For this reason, it was necessary to increase the maximum number of available string files by 1 so that in case Wayne wants to use the ones he originally coded for 4.22, they can still be used by later versions. In order to edit/create the necessary additional data file, you will need a program which can do this. To date, the only program that we are aware of is ESM204.ZIP (External Strings Manager v2.04, written by Tolkien 1@3456) To have the necessary function to add strings to the data file(s), it is necessary that you obtain a registered copy of ESM204 from Tolkien. Registration enables the function that can ADD strings to existing data files. A copy of ESM204.ZIP (unregistered) can be obtained at Amber, most SDS sites, and on Tolkien's BBS. For details on how to register ESM204, read the documentation accompanying the unregistered version of ESM204. Wayne has coded the string files he uses as follows: 0 - Default strings for the BBS (what prints to the screen) 1 - Sysop log string (what is written to the sysop log) 2 - File containing random "Yes" strings 3 File containing random "No" strings 4 - Currently unused 5 - Currently unused 6 - Currently unused 7 - MODIFICATION STRING FILE (for strings in mods) Ordinarily, when searching for a string in any of the string data files, except ENGLISH.STR, you would need to use the function get_stringx(n,xxx) where "n" is the number associated with the data file (from the list above) from which you wish the string to be read, and where "xxx" is the actual string number, starting at 1 and going up as high as you want it. However, with THIS function, the call to get the wanted modification string is quite easy. Simply use the line modstring(xxx) where ever you want to read a string out of the modification string file. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- STEP 1 Create a file called MODSTR.H, block copy the lines indicated below into it, and place it in the same directory as the rest of your source code. 4Be sure 4to save this new file along with your modified source files!!!!!! /************************** BEGINNING OF MODSTR.H ***************************/ #define MAX_STRFILES 8 /* this is 1 more string file than Wayne allocated */ #define modstring(i) (get_stringx(MAX_STRFILES,(unsigned short)(i))) /**************************** END OF MODSTR.H *******************************/ =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- STEP 2 In VARDEC.H, add the line indicated #ifndef _VARDEC_H_ #define _VARDEC_H_ /* search for */ #include "modstr.h" /* 2ADD this line0 */ /* DATA FOR EVERY USER */ typedef struct { =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- STEP 3 In STRINGS.C, make the following changes indicated #include /* search for */ #include #include #include "modstr.h" /* 2ADD this line0 */ #define CACHE_LEN 4096 #define WRITE_SUPPORT /* #define MAX_STRFILES 7 /* 2COMMENT OUT or REMOVE this line0 */ */ =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- STEP 4 In BBSUTL.C, add the following line where indicated set_strings_fn(2, languagedir, "YES.STR", 0); set_strings_fn(3, languagedir, "NO.STR", 0); /* search for */ set_strings_fn(MAX_STRFILES, syscfg.gfilesdir, "MOD.STR", 0); /* 2ADD0 */ =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- STEP 5 Now create a string data file in your WWIV GFILES directory called 1MOD.STR This file will contain any additional strings which you create when you add modifications to your source code which are not in ENGLISH.STR. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- STEP 6 Now when you write a mod, and use a string from your MOD.STR file, you simply call that string like the following example: pl(modstring(258)); or npr("%s",modstring(125)); or outstr(modstring(24)); and so on, where the number in parentheses is the number of the string you want printed to the screen or sysop log (depending on what you want do with the string). =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- STEP 7 Recompile the ENTIRE source code. This is necessary since you are making additions to VARDEC.H. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- If you have any questions about this mod, contact Tolkien 1@3456 (WWIVnet) or Snorkel 1@3459 (WWIVnet).