|
Archetype (.arch) filesArchetype files are very important in Wyvern. If you want to make a custom item or monster, the easiest way to do it is to make an archetype file for it. You can ask someone else to make the file, but that takes a lot longer than learning to make .arch files would. Archetype files are written in a special, wyvern-specific version of XML. XML, like HTML, is a markup language, and the syntax is similar in each. If you know HTML, learning to do the Wyvern XML is simple. If you don't, its still simple, but not as simple. Archetype files are made up of properties. Properties each have a type, a name, and a value. The format for a property is: <property type name="property name" value="property value"/>where property type is the type of the property, property name is the name of the property, and property value is the value of the property. There are several types of properties used in wyvern archetypes. They fit into two broad categories: primitive and composite. Primitive properties store a single value. Composite properties can have multiple named sub properties (also called "child properties"). Most of the properties are primitive, but composite properties are used (usually) for "intelligent" properties that have their own code. Primitive properties can be further broken down into "numeric" properties and "other" properties. Numeric properties are for numbers. Other properties are for other stuff. Primitive PropertiesInt PropertiesInt (integer) properties store signed whole number values in archetypes, with a range of about +/-2 billion . They are used for monster skill points, reagent quantities, weapon damage amounts, and hit points, among other things. Int is a numeric primitive property type. There are several int properties which can determine the damage that a monster deals. All monsters will deal damage based on their strength, but some also deal damage based on various wc (weapon class) properties set to them. Some wc properties will be augmented by a monster's strength, some will stand independent of it. The demon lord, for instance, has both wc-fire and wc-smash. The fire attack stands independent of the monster's strength, but the smash attack deals damage based on the combined strength and wc-smash properties. The possible wcs are fire, cold, acid, shock, smash, cut, and stab. A monster's level is also controlled by an int property. All monsters, by default, have a wc-smash automatically set to them based on their level. You can change this to a different wc by setting <string name="default-wc" value="cut"/>, where cut is the wc that you want the monster to use. Be sure, also, to give a monster other special abilities so that it is challenging enough to be worth the xp that it gives, which is also controlled by the monster's level. Several int names and their uses are listed below, along with a usually appropriate range for the integer.
Long PropertiesLong properties are like int properties, but with a much larger range. They're useful for storing things like player bank accounts (sadly, because nobody should ever have that much gold). There aren't really any "common" long properties, and you'll usually never set one to anything. Long is a primitive numeric property type. Double PropertiesDouble properties store decimal values in archetypes, such as 3.1415 or 2.718. They, like long properties, are rarely used. However, it is important to remember that you can't simply use "int" for every number value that an archetype needs. String PropertiesString properties store information represented by text in archetypes. They are used for things like the names of monsters, the contents of books and signs, and monster random inventory lists. A string-type property is typed as follows: <string name="short" value="Demon Lord"/> If a string value is especially long, the usage is: <string name="desc">Hi there, I'm an extremely long description of a game object that says something big. I'd look quite ugly, were I between quotes in a standard string tag, so I'm put in kind of a "tag sandwich" for looks. You don't have to do longer strings this way, but it makes them look nicer, and makes it easier for others to read the .arch file, don't you think?</string> Of course, not every string prop names the archetype's object or monster named Demon Lord. Short is the property name for an object's "short" description, which is what the player sees when standing on or clicking an object, or when hit by a monster. String properties fit into the "other" category of primitive types. Some common string names and their functions follow. The names (in, believe it or not, the Property Name column), go after <string name="" and are followed by the little quotation marks and the value of the property.
Boolean PropertiesBoolean properties can store 2 values: true or false. The format for a boolean property is different than that of a normal property: <boolean name="unique"/> Booleans can be set as normal, with values of true and false, but this way is easier. If an archetype has a boolean present, it is true; if the boolean is not present, then it is false. Booleans are usually used in monsters for identification purposes, such as marking a monster as a Demon, Dragon, or Goblin. The unique boolean sets a monster to output messages as if it were one of a kind, so that instead of "killed by an Archus" we have "Killed by Archus." Booleans, like strings, are "other primitive properties." Some common booleans and their usage follow:
Composite PropertiesThere are only two composite property types: bean and arch. Bean PropertiesA bean is a property that brings a java class into the archetype. The naming conventions for bean properties is a bit different than that for normal properties, for technical reasons: HiImALongBeanPropertyName hi-im-a-long-property-name Bean properties can use the "tag sandwich" method, like string properties, or the normal method. Like any other property, the best way to learn bean properties is to copy and paste from other archetypes. However, some common beans follow:
Since it can be long and awkward to type out entire bean names, there are what you might call "aliases" for the most common ones. These are not listed in the table above.
In addition to the properties in .arch files, there are special sets of characters that represent other characters, not normally allowed in XML. For instance, you can't use an ampersand ("&"). Instead, they have special substitutions, so for an ampersand character, you'd put in "&" instead. The map editor does this for you automatically, and the game converts them back into regular characters. The full list is:
Latin and international characters have a special syntax that's beyond the scope of this document. The map editor converts them automatically for you. |