Creating and Modifying Archetype Files

Archetype (.arch) files

Archetype 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 Properties

Int Properties

Int (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.

Property Name Function Appropriate Range
flying makes a monster fly 1
uses-spells a percentile chance for a monster to cast spells when it moves 1-100
level sets a monster's level usually 1-30
quantity the quantity of items in a stack, if plural anything. Don't make ten million pixie dusts, please.
move-speed the time, in milliseconds, between each move a monster makes. Lower is faster. any positive value. Negative values will cause the monster to move instantly from one spot to another.
attack-speed sets the speed of a monster's attacks. Again, lower is faster any positive number
resist-(wc name) sets a monsters resistance to a type of damage 1-100. 1000 is used if you want the monster to be completely immune to the damage type.
bonus-ac-(wc name) sets the extra ac bonus that an armor gives against a particular wc. 1-100. Please, don't make players immune to damage.

Long Properties

Long 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 Properties

Double 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 Properties

String 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.

Property Name Function Possible Values
short sets the short description of an object just about anything
ai-temper sets the ai of a monster hostile, neutral, or peaceful
desc sets the long description of an object just about anything
id-desc sets the description of an item, which overrides desc after the object is identified again, almost anything
auto-inv sets the random inventory list for a monster DemonInv, LichInv, EyeInv, KoboldInv, OgreInv, OrcInv, TrogInv, DragonInv, ElfInv, others (check other .arch files for more)
sex sets a monster's gender male, female

Boolean Properties

Boolean 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:

Boolean name Usage
unique makes a monster unique
demon, dragon, goblin, elf, etc. sets a monster to the appropriate race for purposes of slayer artifacts.
uses-weapons lets a monster use weapons that it picks up

Composite Properties

There are only two composite property types: bean and arch.

Bean Properties

A 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:

Bean name Usage Appropriate Values
body-parts sets a monster's body parts, such as arms and legs wyvern.kernel.combat.shapes.NoParts, wyvern.kernel.combat.shapes.Serpentine, wyvern.kernel.combat.shapes.Humanoid, others.
counterattack gives a monster a counterattack. You must specify the counterattack type, and an int value for its level (using the tag sadnwich method). wyvern.lib.monsters.AcidSplash, wyvern.lib.monsters.FireAttack, wyvern.lib.monsters.ColdAttack, wyvern.lib.monsters.ShockAttack
spell-list Gives the monster spells to cast. Again, you have to use the tag sandwich method. wyvern.kernel.player.SpellListImpl, followed by the "sandwich filling" of the spells (LightningBolt, DragonBreath, etc. YouMustUseThisFormatForSpellNames!)

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.

Bean name Usage Appropriate Values
weight shortcut for the wyvern.lib.properties.Weight bean. Sets the weight of an object. a positive number, with optional decimal, an optional space, and then "oz" (ounces), "lb" (pounds), "g" (grams) or "kg" (kilograms). Internally all weights are represented in grams. (10.3 kg, 1kg, etc.)
image A shortcut for wyvern.lib.properties.Appearance. Sets a monster's image. Accepts the sub-properties path, layer, and dir. <image layer="500" path="monsters/demon/shoggoth"/> or others that fit the same format
point A shortcut for wyvern.lib.Point, with sub-properties x and y, both of which must be int values na
music a shortcut for a wyvern.lib.properties.Soundtrack, with sub-properties "path", "gain", "repeats" and "repeatDelay". This will be described in detail in the upcoming Wyvern Sound and Music manual. na

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 "&amp;" instead. The map editor does this for you automatically, and the game converts them back into regular characters. The full list is:

character substitution
& &amp;
< &lt;
> &gt;
' &apos;
" &quot;

Latin and international characters have a special syntax that's beyond the scope of this document. The map editor converts them automatically for you.

Next: Miscellany &gt;&gt;