FANDOM


Another relatively simple element to add to the game are pack animals. These usually serve two roles, either increasing the carrying capacity or allowing players to mount them to gain advantages in combat and traveling. Let's create a Yakkul, based on the animal from Princess Mononoke. While it will be possible to use it as a pack animal, the main usage will be mounted, because we'll hand out a special perk when mounting it to climb hills, make it super fast and add some nice combat dice. As with our other examples, let's create this character step by step:

Yakul 08

Basic SetupEdit

First you should set up your new mod as described on the Getting Started page(everything up to the Adding a language file 'section).

Next, write the basic defintion of the Yakkul into the mod.hjson. You can check out the existing pack animal defintions to get an idea what is required or can be done in general. Feel free to use them as a basis for your pack animals when starting out. Your first step could look like this:

modEntries: [
  {
    id: anm-yakkul
    title: txt-anm-yakkul-title
    description: txt-anm-yakkul
    health: 8
    capacity: 3
    flags: +animal +packAnimal +mammal
  }
]

Adding localized textsEdit

The title and description entry still need to have proper texts hooked up to it. Go to the lang_en.csv file in your modding langs folder and enter it. This is how your lang_en.csv file should look like for now:

"anm-yakkul-title", "Yakkul"
"anm-yakkul", "A trusty deer-like creature. When mounted it is very fast and capable of easily climbing any hill."

Create sprite imagesEdit

With the basics laid out I'd recommend to now jump right into creating the graphics for your animal. I recommend you start by taking a look at all the existing aninmal sprites on gitHub . While there is no size limitation for animals, it is always beneficial to have an image of a normal unit (e.g. british soldier) placed in the same file for size reference. Different from normal character sprites, the orientation of your animal within the image is important (they are not constantly mirrored during gameplay to simulate an idle animation). For the normal sprite, the animal has to look towards the right side. 

Yakul 01
Here's an image of my yakul sprite together with some other units for size comparison.

You'll need to create 3 images from your original sprite:

Yakul 03
1. sprite_yakul_01.png - The original sprite that will be used throughout the game in locations and combat situations. The shadow on the ground is black with 25% transparency. The size of the file is exactly the outside dimensions of the image. It needs to be exported with a transparent background. The image displayed here is scaled 300% and has a green background for visibility reasons.
Yakul 03b
2. face_yakul_01.png - A cropped version of the original sprite that will be used in the unit frame on the right hand side of the screen or in infoboxes). The scale of this image should be exactly 32x32 pixels, so I slightly cropped the image on the right and bottom. Also, I would recommend to mirror it horizontally so it looks better when placed in the frame on the right side of the screen. Note: Optional image, if missing sprite image will be used instead.
Yakul 03c
3. face_small_yakul_01.png - Remove everything but the head of your creature for this minimal sized image. This is going to be used when hovering over dice in combat or in feedback notifications. Again the size of the file is exactly the outside dimensions of the image. Note: Optional image, if missing sprite image will be used instead.

And last but not least, you'll need to create a minisprite for your animal. Again, take a look at the existing minisprites as well as the provided template images for minisprites . Since your minisprite will be animated the image has to follow a clear size guideline. Use the template_minisprite.png to understand the orientations and animation stages of the file.  In the end, your finished image should look like this: 

Yakul 04

Hook up graphicsEdit

Now that we have the images prepared we can hook them up in the animal definition.  First, make sure to save them as .png into your mod folder and then add them to your mod.hjson inside the imageData section like this:

imageData:[
  {
    id: sprite_01
    file: yakul/sprite_yakul_01.png
  }
  {
    id: face_01
    file: yakul/face_yakul_01.png
  }
  {
    id: face_small_01
    file: yakul/face_small_yakul_01.png
  {
    id: minisprite_01
    file: yakul/minisprite_yakul_01.png
  }
]

This only references the images, we still need to hook them up to your animal in it's modEntries definition by adding a variations section. Let's do it like this:

{
  id: anm-yakul
  title: txt-anm-yakul-title
  description: txt-anm-yakul
  health: 8
  capacity: 3
  flags: +animal +packAnimal +mammal
  debugCategory: Modding

  variations: [
    {
      gender: female
      name: animalFemale
      sprite: sprite_01
      portrait: face_01
      miniSprite: minisprite_01
    }
  ]
}

As you can see we added the id's for sprite, portrait and minisprite as defined in the imageData section. For simplicity I suggest to use one of the existing name pools, in thise case the animalFemale. Feel free to create your own name pools and add them with the mod if you feel like adding a more custom feeling to your character. 

Testing first version in gameEdit

It's time to test your animal in the game. Start the game and make sure to activate your mod in the Mod Menu. Jump into a test game and use the debugBar to spawn your Yakul. It should be located under the Characters section (2nd column from left) inside the Modding category (we added this debugCategory in Step 1). You should see it's minisprite on the map and the portait on the right hand side of the screen. However, there are still two image sprites missing, so let's proceed.

Yakul 06

Adding saddle and cratesEdit

There are still two essential images missing from your animal: the saddle and crate. These two images will be placed ontop of the image of your animal to show the animal is carrying crates or a saddle when mounted. You can find template images for both here: template_anm_crates_artwork.png and template_anm_saddle_artwork.png. Both of these images files should have the exact same size as your sprite file. Do not remove or recolor the pink pixel in the saddle template.

Yakul 09
Adjust the images to fit to your animal, and make sure to position them within the file so they are aligned with the sprite. Then, remove the animal sprite and save the images background. In this case we're naming them crates_yakul.png and saddle_yakul.png.

Now we just need to add them the imageData section. Be aware that you'll need to add type:slotted to the saddle. I'll explain this in a moment:

{
  id: crates
  file: yakul/crates_yakul.png
}
{
  id: saddle
  type: slotted
  file: yakul/saddle_yakul.png
}

Then, add these lines to your modEntries to hook up the images with your animal definition:

extraSprites: 
{
  crates: crates
  saddle: saddle
}

Concerning the type:slotted entry of your saddle image; you probably noticed a pink pixel in the saddle template image. This pixel needs to have exactly the color value #ff009c. By setting type:slotted you will tell the game to scan the image for slots. We use specific colored pixels the define the positions of slots within images, this is usually done for location images to place npcs, characters or many other things. In the case of the saddle, it is used to place the riding explorer on the correct position. Don't worry, once the game runs the brightly colored pixel will be painted over by the color of the left neighbor pixel. To understand how the riding explorers look like, you can take a look at the image _res_explorer.png.

Yakul 10
Just like the saddle, the riding explorer image will be placed ontop of the two combined sprites of the animal and it's saddle. And the pink pixel is used to align the riding explorer to the saddle.

Make it mountableEdit

Now that we have added the saddle and crates we can adjust your animal so it can be mounted by your main explorer. First, add these lines to your modEntries section:

isMountable: true
mountedStatuses: st-mount-3 st-climber
bonus: {capacity: -1, reqMounted: true}

The isMountable will make it mountable in general. We'll add the existing statuses Fast Mount (st-mount-3) and Climber (st-climber) to the animal with mountedStatuses. This means that the animal will only have these statuses while being mounted. Last, we'll add a negative bonus to reduce capacity by 1 when the animal is mounted.

Adjusting these values is cruical to balancing your animal, so try to think about these values as they can really make the difference between an interesting or plain animal. For this example, you can see that we add two rather strong effects (Fast Mount and Climber) to the mount, but this is balanced with the very reduced capabilities of the animal to carry things (with 3 capacity as a base, mounted leaves the animal capable of only carrying two crates, which is essentially the standard for normal humanoid units). It is still possible to work against this drawback by increasing the capacity in the harbor or adding an animal handler to the trek, which offers interesting strategies to players. 

Add dice and levelsEdit

Another benefit of mounting pack animals is that they will typically grant additional dice in combat when mounted. All standard dice and their symbols are defined in the challenge.hjson , make sure to take a look at it if you are interested to learn more about how dice and their symbols are set up. For this example we'll just reuse and modify what already exists, so you don't need to understand the basics just yet. Let's first create a new die specifically for the Yakul by adding this to your modEntries section:

{
  id: dc-yakul-1
  sprite: hud_dice_bg_animal_1.png
  faces: hoof ram ram horns horns horns 
}
Yakul 12

Make the animal recruitable in villagesEdit

Now let's hook up your animal into the generic village recruiting hubEvent so it will appear as a normal part of a game while playing. To do this, you should first take a look at the villageRecruit.hjson. This event in particular is important:

  id: evt-village-recruit-select-animal
  select: [
    {ref: "evt-village-recruit-donkey"}
    {ref: "evt-village-recruit-buffalo"}
    {ref: "evt-village-recruit-camel"}
    {ref: "evt-village-recruit-husky"}
    {ref: "evt-village-recruit-parasaurolophus"}
    {ref: "evt-village-recruit-chasmosaurus"}
  ]
}

This event is a list of all possible animals that can be recruited when visting a village. They have additional requirements in their own events for in which village they can appear, for example a husky will only be offered in the inuit village or the dinosaurs only in lizard villages. You'll want to hook up your animal into this list. In order to do this, create this targetId event in your modEntries:

{
  targetId: +evt-village-recruit-select-animal::select
  ref: evt-village-recruit-yakul
}

This will merge the evt-village-recruit-yakul into the list event evt-village-recruit-select-animal. Now we need to create the actual recruiting event that will potentially be triggered from the list event. I'd recommend to take an existing recruit event as a starting point, for example the event evt-village-recruit-donkey in villageRecruit.hjson. Put it right after your targetId event and adjust it to look like this:

{
  id: evt-village-recruit-yakul
  reqLocationFlags: +tribeWarriors | +tribeScouts | +tribeShamans | +tribeInuit
  npc: anm-yakul
  npcEvents: {
    actions: {
      actionText: txt-anm-yakul-title
      text: txt-evt-village-recruit-animal-generic
      setPartyFlags: +recruitedSomebody
      addNPC: true
      select: evt-village-main-update
    }
  }
}

The reqLocationFlags will make sure to only potentially spawn the animal in villages with the listed flags (which are all generic villages, including the inuit villages, but not the lizard villages).

The npc command will generate one version of your animal and place it as an npc into the scene. 

The npcEvents will allow you to add events with the context of the before placed npc. In this case, it will add a button to recruit the animal to the village recruit event. If clicked, the placed npc will be added to the trek by the addNPC command. The final select event will return to the normal village and close the loop. Your recruit event was successfully injected into the generic village loop.

Keep in mind that your animal will only have a chance to be offered for recruitement. In normal villages, it has a 1 / 3 chance (with buffalo and donkey in the selection) and in inuit villages a 1 / 2 chance (with husky in the selection). I you want to make it more likely for your animal to appear you'll have to add more slots to your targetId event.

Yakul 07

Finishing touchesEdit

Ok, basically your pack animal is finished now. There are a couple of things you can do to make your mod even more appealing:

Add a nice preview image. The image size should be 268x268 pixels. Add it to your imageData section:

{
  id: mod_preview
  file: yakul/mod_preview.png
}

Then, just add the reference to the image in your modInfo section:

preview: mod_preview

It's not necessary, but adds a nice touch to your mod.

Also, you can now make some alternatives of your sprite to create variations of the animal. This way your animal will look slightly different each time players encounter it, which will be a nice touch. Also, it's really just fun to create the variations and then see them appearing in game. Here I created some very simple, mostly color variations of the sprite:

Yakul 11

Don't foget that you'll need to create these variations also for the face and minisprite images. Just add the additional images to your imageData and then create additional variations in your modEntries:

variations: [
  ...
  {
    gender: female
    name: animalFemale
    sprite: sprite_02
    portrait: face_02
    miniSprite: minisprite_02
  }
  {
    gender: male
    name: animalMale
    sprite: sprite_03
    portrait: face_03
    miniSprite: minisprite_03
  }
  ...
]

Last but not least, don't forget to add more information to the modInfo section, such as a brief description of your mod or a link to your email, twitter account or the link to your Steam Workshop page for the mod. This way people will be able to see the rating of you mod in the modding menu.

Community content is available under CC-BY-SA unless otherwise noted.