---
description: Section 7.J.1
---

# Intros: Trainer Sprites

The trainer sprites used by this plugin are long strips which contain each frame of the trainer's entire intro animation. The dimensions for these strips must always be broken up into squares. So for example, if you have a sprite 96 pixels tall that has 10 frames of animation, then the final dimensions for this sprite strip must be 960x96 so that each "frame" of this strip is a perfect square (96x96).

As long as your strips produce perfect squares for each frame, there is no set sizes that are required for your sprites. They can be as large or as small as you'd like, as long as they follow the square rule.

***

<mark style="background-color:orange;">**Sprite Scaling**</mark>

As mentioned above, there are no limitations on how small or how large your sprites may be. The reason for this is because this plugin includes sprite scaling features that allow you to scale up or scale down any trainer sprite to your liking. This means that no matter what size your sprites are, they can be modified to fit within your game without having to manually edit the individual sprite itself.

There are two ways to affect sprite scaling. I'll cover both methods below.

<details>

<summary>Sprite Scaling through Settings</summary>

In the plugin Settings file, you will see the `TRAINER_SPRITE_SCALE`  setting. This controls the overall sprite scaling for all trainer sprites, and acts as the default scaling value. Note that this scaling property only affects front sprites for trainers; any back sprites that a trainer may have is completely unaffected by this and will just display normally.

By changing the scaling value, you can change the overall sprite scaling for all trainer sprites in the game. Note that this does affect _all_ trainer sprites at once, so this setting should only be used if you want to affect the overall scaling of sprites globally, as opposed to individual sprites. If you only want to affect the sprite scaling of a particular sprite, refer to the PBS method of scaling sprites.

By default, `TRAINER_SPRITE_SCALE` is set to 2, which means all trainer sprites will be displayed twice as large in-game. This is the default setting because all trainer sprites provided by this pack are much smaller in size than the ones included within Essentials by default.

</details>

<details>

<summary>Sprite Scaling through PBS</summary>

Sometimes you may only want to change the scaling applied to a specific sprite. This can easily be accomplished by editing the values of the sprite of that particular Trainer Type in the various `trainer_types.txt` PBS files.

In these files, a new line of data may be added to a trainer type called `SpriteScale`. This can be set to a number to set the level of sprite scaling applied to this trainer type's sprite. If set to 1, the trainer will display without any scaling. If set to 2, the trainer's sprite will be doubled in size. If set to 3, it will be tripled in size, etc.

The level of scaling set here for a particular trainer type will override whatever the default value set with `TRAINER_SPRITE_SCALE` would normally be.

Note that if you set the sprite scaling for a sprite that is already equal to the default value set in `TRAINER_SPRITE_SCALE`, it will be treated as if you entered nothing, and the number you entered here will not be saved whenever your PBS files are forced to update.

Also note that these sprite scaling metrics may also be applied via debug mode through a special trainer sprite editor. But I'll go over more on that in its own subsection.

</details>

***

<mark style="background-color:orange;">**Animation Speed**</mark>

There are no minimum requirements for how long your sprite strips may be for each trainer. Some trainers may have only 3 or 4 frames of animation, while others may have dozens. This means that some trainers may have really long animations, while others may have really short ones.

However, regardless of the number of frames in a trainer's animation, all trainer sprites will complete their intro animations within the same amount of time. This is to keep all trainer intros consistent with one another, so that they always take up the same amount of time at the start of a battle regardless of how long their sprite strips are.

The exact amount of time trainer intros take is controlled with the plugin Setting `TRAINER_ANIMATION_SPEED`. This sets the number of seconds a trainer's intro animation should last before completing. By default, this is set to 1.5, meaning all trainers will complete their entire intro in one and a half seconds at the start of the battle. You can adjust this to your liking if you'd prefer trainers to take longer or shorter to animate at the start of battle.

Note that the number set here should always be a float number, meaning it should always include a decimal place. For example, if you would like to set the trainer intros to last 2 seconds, you would set this value to `2.0`, _not_ just `2`.

***

<mark style="background-color:orange;">**Shadow Sprites**</mark>

In vanilla Essentials, trainers do not cast any shadows on the battlefield, unlike Pokemon sprites. However, this plugin makes it so that trainers will cast shadows when they appear in battle, and these shadows will even animate along with the trainer.

This is implemented by creating a copy of the trainer's sprite and modifying it to appear greyed out, stretched, and transparent. However, it will still animate exactly as the normal sprite does, following the trainer's actions exactly.

The shadow sprite for each trainer type can be tweaked to set the coordinates in which they appear, as well as their visibility. This can easily be accomplished by adding new lines of data for that particular Trainer Type in the various `trainer_types.txt` PBS files.

<details>

<summary>Shadow Sprite Metrics</summary>

There are two parameters which can control elements of a trainer's shadow sprite. These are the `ShadowXY` and the `HideShadow` parameters. Note that both of these parameters are completely optional.

***

<mark style="background-color:orange;">**ShadowXY**</mark>

This is a new parameter introduced by this plugin that adjusts the X and Y values of a trainer's shadow sprite. By default, a trainer's shadow will be set to appear in the same coordinates as the trainer sprite itself is displayed. For many trainer sprites, this is usually "close enough", and doesn't require major tweaks. However, some trainer shadows may need to be adjusted a bit to look right, so that's where this setting comes in.

The first number in this array corresponds to how many pixels to shift the trainer's shadow sprite on the X-axis. The second number in this array corresponds to how many pixels the trainer's shadow sprite will be shifted on the Y-axis. If no shifting is required on one of these axis, you can simply set that value to 0.

***

<mark style="background-color:orange;">**HideShadow**</mark>

This is a new parameter introduced by this plugin that adjusts the visibility of a trainer's shadow sprite. This can simply be set to `true` or `false`. However, it is always assumed by default that a trainer will display its shadow, so setting this to `false` is never necessary. The only time you would need to set this parameter is if you _don't_ want a particular trainer type to display a shadow in battle. In which case, you would set the line `HideShadow = true`.

</details>

***

<mark style="background-color:orange;">**Sprite Hues**</mark>

This plugin allows you to modify the hue of a trainer's sprites so that you can tweak their coloration. This can give you a way of making a variety of different trainer types that all share the same sprite, but utilize different colors. This can help you cut down on having to make duplicate sprites.

Note that setting a hue for a particular trainer type will affect all sprites for that trainer, including their front sprite, back sprite (if any), and their mugshots (if any). Their overworld sprite, however, will not be affected.

You can easily set a hue for a trainer by adding new lines of data for that particular Trainer Type in the various `trainer_types.txt` PBS files. To so so, you can simply add the line `SpriteHue` and set it to a number between -255 to 255. By default, all trainers are assumed to have a hue of 0.
