Posted January 21, 2020 by SharkHendrix
#tutorial
There is some general concepts to understand. If you just want a quick view, jump to the chapter "Open and explore the Vanilla content pack".
Every players and creatures have stats to define how strong, fast and powerful they are. These stats can change with item bonuses or with alterations, using value modifier (e.g. an ice spike can slows down for X seconds using a value modifier of speed). Some elements can use them individually, or in a mixed way, to define for example how much damage a sword hit will do.
Here, clothes make the man. Items can give bonus stats and are the way to have abilities. Weapons have a base ability (left click), and sometimes special ability (space bar), accessories can also have an ability (Q and E). Items can be obtained by harvesting, killing creatures, or crafting.
You will have to create various kind of elements, and link elements to each other to set the shape of your content pack. Here is the exhaustive list, with a short description:
Alterations are central. They are not "root" elements, but elements use them at many places. Alterations are the way to perform modification to an entity, or do something, of any kind: Apply damage, heal, modify stat, generate an effect or a creature, "bump", stun, modify its SpriteSheet, silence, play a sound, etc...
An alteration has an origin, which inherit from its stats if required, and is applied to a target ("apply to" property). Source and target are implicit depending on the situation. For an ability's alteration, target, self and origin is the same: its user.
Let's take an example with the image below, we take the point of view of the wood bow effect, focusing on the alteration of the "Targets" tab.
Note that the target is not exactly the target at this moment, but it will be when the arrow will collide with it.
The drop-down list "target" is set to "All ennemies", meaning "any enemy colliding with this effect".
The "Apply to" drop-down list is set to Target, sometimes you will want to set it to the origin, for example for a "life stealing" effect.
The type of the alteration is "Instant damage", it will deal damage to the target, according to the "Amount" formula, which depends of the origin's agility stat.
The "Destroy when collide" checkbox is checked, the arrow will be destroyed when colliding with an enemy, if not, it would apply damage every frame of the game, instant damage is not made for that.
Launch the content-pack-editor.jar file to run the editor. The first thing you can do, is to explore the Vanilla content pack itself, on the top left, click on File -> Open, then go to the directory "contentPacks" in the installation directory of the game and open the "Vanilla_1.0.zip" file.
The contentPacks directory is the place for installed and playable content packs, the file name operates as the identification of the content pack, and must respect the format [name]_[major version number].[minor version number].zip, with no special character. For example, "Improved-Vanilla_1.0.zip" is a valid name, but "My Super Pack.zip" is not a valid name, and thus, will not be shown in the content pack selection menu in the game.
It is highly recommended to do not modify and replace the default Vanilla itself, or you will have to re-download the original, or connect to a server with the good version. To avoid mistakes before exploring, first go to File -> Save as... and save it with a different name, for example: "Improved-Vanilla_1.0.zip".
You can now explore the Vanilla content, you may be SPOILED of everything that makes the Vanilla content, if you don't want to, play it first, NOW!
On the left side, you can explore all the elements of the content pack, organized by folders, a right click to this left side allows you to add / remove / rename elements. Open folders, and click on an element to see its content appears in the center panel.
You think that the Iron armor is too expensive? On the left side, Go to Items -> Clothing and click on the element (Item Craft) iron_armor. On the recipes list, you can see that it actually requires 20 irons, you can reduce this number, or change the required item, by clicking on it, and typing on the search popup for example "wood". You now have an iron armor made with wood, weird.
You think that the iron armor should boost your movement speed? On the same folder, click on the element (Item) iron_armor, on the "Stats modifiers" list, click on the "Add" button, in the new row, choose the stat "Speed", the operation "additive", and the value you want, 10 for example, which means the character equipped with this armor will move 10 meters per second faster, where one meter is one tile. You now have an iron armor made of wood which boost your speed, super weird.
The wood sword doesn't do enough damage for you? Go to Items -> Weapons -> Wood sword and click on the element (Item) wood_sword. On the "Base ability" part, you can see in the alteration list that the ability produces the effect "wood_sword_hit", so open it, it is placed in the same folder on the left side (smart, right?). Effect's definition is separated into different tabs (at the top), open the "Targets" tab, this tab defines which alteration is applied to which type of target when the effect collides with this target (usually a creature, or another player). There is only one alteration here, which deals damage to any enemy hit, click on the value of the "amount" and change the base value, for example "100". Now the wood sword is the strongest weapon, ultra weird.
Fire dragons are too hard to kill? Go to Creatures -> Bosses -> Fire dragon and click on the element (Creature) fire_dragon, and in the "Stats" part, reduce the Strength value to zero, which will fix his maximum health to 100 and his armor to 0. negative values are allowed to give less than 100 health points.
Bored of running after these vanishing pixies ? Go to Creatures -> Pixie and click on the element (Behavior Set) pixie, this is the behavior, the "AI", of the creature. It is made of a list of behavior, that the creature will follow. When just spawned, the creature will follow the first behavior of the list (at the top of the list), so for the example of the pixie, the default behavior is "Wander". these behaviors have a list of "Change condition", when a change condition is respected, the creature will switch to the behavior selected in this change condition. You can see in the "Wander" behavior that, if the closest enemy is at a distance less than 12, then the creature will switch to the "Get away" behavior. Remove this boring condition by clicking on the big red cross on the condition area. Now he will only get away when you are already dealing damage to him, cruel.
Note : There is actually a bug if you change the "Type" of the behavior, you will have to re-select it from every change conditions where it is referenced into. The red colorization on the left side will help you to see if the element is valid or not. This kind of bug also applies to items and structures.
This document will be finished soon!