Skip to content

Adding or using Custom sprites

Loobinex edited this page Oct 30, 2021 · 32 revisions

Introduction

It's possible for users to add custom sprites (animations made from pictures) to KeeperFX. Currently this is an unreleased feature and only available on development/alpha builds. They can be set to Objects only.

Overview

Dungeon Keeper and KeeperFX use sprites from .dat files for all things in game, like Creatures, Objects, Traps and Projectiles. These are PNG images for every frame of animation, and when available, for each view direction too.

The custom sprites do not need to be merged into these .dat files, but can be bundled in .zip files, along with a json file that describe how these .png files make up the sprites.

Creating a Custom Sprite

Finding or Creating a Model

Exporting the PNG files

Creating the JSON file

Using a Custom sprite on a map

Modifying an Object for a campaign or mappack

Objects in KeeperFX by default use sprites from the .dat file, defined on the AnimationID field for every object in objects.cfg. The default objects.cfg file can be found in the \fxdata folder, but if the campaign or map pack you want to use it on has custom configuration files defined, the settings in the campaign/pack specific objects.cfg will overwrite the default ones.

The objects.cfg file - like all .cfg bundled with KeeperFX can be edited with any text editor, like notepad++.

When for example you want to make the placeholder statue look like a banner, look for the object in object.cfg:

[object132]
Name = STATUE5
Genre = DECORATION
AnimationID = 958

Then update the AnimationID with the name of the Custom Sprite. If this name is not known to you, open the zip file of the custom sprite, open the json file inside with a text editor, and take the value after "name". It should look something like this:

[object132]
Name = STATUE5
Genre = DECORATION
AnimationID = BANNER

When the sprite is rotatable, you could also set the wind direction of the object. Possible values here are: NORTH, NORTHEAST, EAST, SOUTHEAST, SOUTH, SOUTHWEST, WEST and NORTHWEST. Add this direction with a colon attached to the AnimationID. This would look like this:

[object132]
Name = STATUE5
Genre = DECORATION
AnimationID = BANNER:SOUTHWEST

Changing an object with the Level Script on a single map

Using the SET_OBJECT_CONFIGURATION script command it is possible to change the AnimationID as well. You can make this conditional on map progress. Define the AnimationID as described in the previous chapter.

An example level script:

REM We should have banners facing south
SET_OBJECT_CONFIGURATION(STATUE5, AnimationID, BANNER:SOUTH)
REM If the heroes are defeated, the banner should face north.
IF(PLAYER1,DUNGEON_DESTROYED >= 1)
  SET_OBJECT_CONFIGURATION(STATUE5, AnimationID, BANNER:NORTH)
ENDIF

You can change between different Custom and default sprites, and wind directions as often as you want, provided you remain within the regular script limits.

Bundled custom sprites

name file thumbnail rotatable animated
BANNER
BANNER_NR
banner.zip banner thumbnail 5 sides
No
No
GIMLY
GIMLY_NR
gimly.zip gimly thumbnail 5 sides
No
No
GOLDEN_ARMOR
GOLDEN_ARMOR_NR
goldenarmor.zip goldenarmor thumbnail 5 sides
No
No
WHITE_FLAG whiteflag.zip whiteflag thumbnail No Yes
WIND_BANNER
WIND_BANNER_NR
windbanner.zip windbanner thumbnail 5 sides
No
Yes