d GUILD DEFINITION PRIMER Sat Dec 12 23:06:58 EST 1998 Written by Saor (Morgan Schafer) saor@valhalla.com **************************************************************************** Foreword This document is intended primarily for those interested in running a VME system or those who are constructing guilds for a VME system. Guild teacher definitions are actually less complex than people think they are. There really are no big, mysterious secrets. The key is simply to understand the numbers and how the balance is achieved. I hope you find this primer helpful and easy to comprehend. Saor Zone Administrator, Valhalla-USA (From here on in, GTD will refer to "guild teacher definition", and "entity" will be used to refer to the ability/spell/skill/weapon being offered by the GTD.) **************************************************************************** A Word of Warning Using TAB characters in GTDs is a very bad idea! It will have extremely adverse effects, including causing the mud to crash. **************************************************************************** The SFUN_TEACH_INIT Header Information In the first part of an SFUN_TEACH_INIT definition, there are several pieces of important information which allow the mud to know what you are trying to provide to players. After the opening double quote ("), the first thing that is necessary is the text formatting code &l, which tells the compiler to ignore the standard text formatting protocols for the rest of the string or until the &f code is given. Immediately following the &l code, with no spaces at all, the type of entity the function will teach is defined. It is one of the following types: 1. abilities 2. spells 3. skills 4. weapons The first two lines of the SFUN_TEACH_INIT looks like this: special SFUN_TEACH_INIT "&labilities;0; The "0;" at the end of the second line above is one of those things which seems to serve no other purpose other than to terminate the line, more of which will be explained later in this document. Experimentation with differing values in its place seem to have no affect at all so it is probably best to leave it "0;". There follows several strings (called acts) which are messages the teacher displays to a player while practicing. An example of a set of messages for an ability teacher: $1n tells you, 'I have never heard of such an ability.'; $1n tells you, 'I do not know how to teach this ability.'; $1n tells you, 'You haven't got %s for me.'; $1n tells you, 'You haven't got %d ability points.'; $1n tells you, 'I can not teach you any more.'; $1n tells you, 'You must be unaffected by magic, else I can't teach you.'; $1n tells you, 'Remove all equipment, please.'; A little explanation of the less evident portions of the example above is warranted here: $1n is the substitution variable for the teacher's title (see the acts or dil document for more details). %s is the amount of money the teacher requires to teach the entity in question. %d is the amount of ability or skill practice points required to practice the given entity. **************************************************************************** The Teacher Acts in More Detail 1: $1n tells you, 'I have never heard of such an ability.'; 2: $1n tells you, 'I do not know how to teach this ability.'; 3: $1n tells you, 'You haven't got %s for me.'; 4: $1n tells you, 'You haven't got %d ability points.'; 5: $1n tells you, 'I can not teach you any more.'; 6: $1n tells you, 'You must be unaffected by magic, else I can't teach you.'; 7: $1n tells you, 'Remove all equipment, please.'; For reference, I have added line numbers. The acts are more or less straightforward and should present few problems to the experience DIL coder. The actual content would depend on the needs of the mud in general and do not necessarily have to follow the above format. The standard GTD termination character, a semicolon (;) ends each act, and standard C notation is used to display money and practice points within the acts (explained above). An explanation of each line's function: Line 1: This line is displayed when the player makes a mistake in typing the name of an entity, whether or not it is actually offered at the teacher. Line 2: This line is similar to the first, but is usually evident of attempting to practice an entity not offered at this particular teacher. Line 3: This is the act displayed when the player has insufficient funds to practice the desired entity. Line 4: This is displayed when the player has not got enough ability or skill practice points to learn the desired entity. Line 5: Simply put, the player has exceeded the teacher's expertise in the offered entity and must go elsewhere to learn more, if at all possible. Line 6: This line is displayed when the player is either wearing magical, stat-modifying equipment or is affected by spells/skills which modify stats. Line 7: Interestingly, I do not think i have even seen this line displayed. It would be a good idea to include it in some form, because you never know. The next sections will talk about the actual GTDs, the code fragments which make it all work. **************************************************************************** What Does a GTD Look Like? A GTD is a single line, composed of several fields. The data contained in these fields determines how a particular entity is practiced. Here is an example of a GTD: 0; 100; scan ; 9; 9000; 7; 0; Note that it has a lot of whitespace in it. It is really not necessary, as the field terminators are the semicolons. This means that you could just as easily write: 0;100;scan;9;9000;7;0; ...and it would still work. It is preferred with extra whitespace for the following reasons: 1. To make it easier to read. 2. To format the GTDs so that they are all the same line length down the screen: 0; 100; scan ; 9; 9000; 7; 0; 0; 90; consider ; 4; 4000; 5; 10; 0; 0; 100; appraisal ; 9; 4000; 5; 0; 0; 100; fleeing ; 9; 9000; 6; 12; 0; **************************************************************************** Explanation of Fields There are several fields, which I am assigning numbers to: Field 1: Guild Level Field 2: Practice Percentage Maximum Field 3: Name of Entity Field 4: Minimum Practice Cost (Old Gold Pieces) Field 5: Maximum Practice Cost (Old Gold Pieces) Field 6: First Practice Points Field Field 7-??: Additional Practice Points Fields Field X: The Termination Field In a GTD, the fields are laid out as follows: 1 | 2 | ------------- 3 ------------- | 4 | 5 | 6 | 7-?? |X| 0; 100; scan ; 9; 9000; 7; 0; **************************************************************************** Field 1 Field 1 is the guild level. It is simply the level at which one is allowed to practice the particular entity in the guild. A level of 0 indicates that one can practice it from the beginning. **************************************************************************** Field 2 Field 2 is the maximum percentage one is allowed to practice the particular entity. It can be anywhere from 1 to 200. For abilities, it should be in increments of 2 (or divisible by 2), and for spells, skills, or weapons, in increments of 5 (or divisible by 5). This means that the effective minimum depends on whether the entity is an ability or a spell, skill or weapon. Therefore, the minimums for abilities is 2, and the minimum for spells, skills or weapons is 5. Anything less will be automatically practiced to the effective minimum. This also means that putting an odd number for abilities will result in the player practicing an additional point, and for spells, skills or weapons, practicing up to the nearest 5. Example: Percentage maximum for an ability is set for 95%. Player practices the ability, which then becomes 96%. Player then decides to practice a weapon skill. It is set to 77% maximum. After practicing, the player has 80% in the weapon. It is better to simply make the ability 96% and the weapon 80% maximum instead. **************************************************************************** Field 3 Field 3 is pretty self-explanatory. It contains the name of the entity to be practiced. The only caveat that I should mention is that it should match the name field in the appropriate definition file for that entity's type (spells.def, skills.def or weapons.def), or the entity will not show up when the player types "info" at a teacher. **************************************************************************** Fields 4 and 5 These fields are often difficult to understand and even explain. So, by way of demonstration and a little outline of economics (applicable to Valhalla-USA and other VME muds using similar economies), I will show how to define these fields. When I refer to "old gold pieces" (OGP), it means the original currency of DikuMUD, 10 of which are equivalent to 1 iron piece in the contemporary economic system. 10 OGP == 1 ip (iron) 8 ip == 1 cp (copper) 8 cp == 1 sp (silver) 8 sp == 1 gp (gold) 8 gp == 1 pp (platinum) Field 4 is the practice cost minimum in OGP. Anything less than 10 here will simply be translated as 1 ip. Anything other than a number divisible by 10 is rounded up to the nearest iron piece. Field 5 is the practice cost maximum in OGP. It is generally defined as being 1000 times what Field 4 is defined as: 4; 4000; 8; 8000; 16; 16000; The reason for this is because there is a scale related to the current practice percentage of the entity. The practice minimum is what the entity costs when it is at 0%, and the practice maximum is what it costs to practice it to maximum percentage. It is not necessary to multiply the minimum by 1000 to define the maximum. It can be any number, as long as the maximum exceeds the minimum. Failure to do so will result in the mud crashing. It is unknown what will happen if the fields have 0 entered in them. I warn that it could be rather unpredictable, due to Papi's (original creator of VME) quirky code. Setting the maximum too high will only serve to dissuade players from practicing and indeed even playing. This is not to say you cannot make a truly powerful entity very expensive. Just make sure that the entity is worth the cost. **************************************************************************** Field 6 This is the only necessary practice points field. It allows one to use their skill or ability practice points to increase their character's powers. This number is generally determined by the desire of the builder to make the entity easier or harder to practice, based upon the logical consideration of how this class would learn/use the entity. For instance, a Fighter class would find practicing "fist" to be exceedingly easy, so they may only need 4 points to practice this skill, but on the other hand, a Mage class would not have such an experience so it may cost them 15 points to practice. Don't go overboard, making this field an outrageous number will mean that no one is likely to practice the entity, mainly because of lack of points. However, like in the cost fields, it can be made expensive to reflect the power of the entity. **************************************************************************** Fields 7-?? This is the part which is more difficult to explain. Fields 7 through ?? are simply extra practice point fields to allow the practicing of an entity more than once per level. It is unclear how many additional ones can be added, but I have personally seen up to 4 or 5 in the really ancient days of Valhalla (when it was still in Europe). For the most part, additional practice point fields are defined as being more expensive, point-wise than Field 6. An example: 0; 90; consider ; 4; 4000; 5; 10; 0; This exmaple has consider being practiced at guild level 0 up to 90%, costing 4 OGP minimum, 4000 OGP maximum (approx. 3 sp), 5 practice points for the first practice per level and 10 for the second. For 15 points a level, the player can practice consider twice. It is actually quite nice to be able to do this, and generally easier entities take advantage of this more often. Each of these additional fields are terminated with the normal semicolon (;). **************************************************************************** Field X Field X is the termination field for the GTD. It tells the compiler that the GTD is finished. In fact, if you set a practice point field to 0, it would consider that Field X, and end the GTD. This field is a necessity. **************************************************************************** In Closing Of course, to finish up the entire SFUN_TEACH_INIT, you must include a closing double quotation mark ("). Failure to do so will cause no end of problems for you. **************************************************************************** Afterword I hope I have answered all the important questions about GTDs. I expect that I may have missed something, but I don't think it is anything major. However, this file will probably be updated or even outdated as the VME code evolves and changes. Sao