The Infinity Animations mod patches Baldur's Gate II: Throne of Bhaal engine to support additional creature and character animations (referred to as 'animation slots'). Thus, it acts as a central hub, usable by anyone who would like to add animation entries to the game without being bogged down by issues of mod conflicts and incompatibilities
This guide is intended for modders who wish to make their mods compatible with Infinity Animations. Is is organized using a tutorial approach, in which you are guided through each step of accomplishing particular modding tasks without breaking compatibility.
Infinity Animations: Note for modders > About •BACK TO TOP
ANIMATE.ids file
In a perfect world, Infinity Animations would be installed at the very top of an installation as a data base that would be usable by anyone who would like to add new animation entries to the game or use them in a mod. Unfortunately, since it was designed a long time after the first mega-mods generation that were overwriting game files, in particular to resolve animation conflicts and restore standard animations that mega-mods have overwritten; it needs to be installed after those mega-mods, at least until their authors will update them to benefit from Infinity Animations content...
While waiting for this marvelous day, here is the perfect way to make sure that the new animations you are going to use or install won't cause any incompatibility issues with other mods.
➽ The first thing to do is to check that you have the right ANIMATE.ids file. Unfortunately, this is not as easy as it sounds. 🙁
Indeed, many mods modify, or even worse, overwrite the existing ANIMATE.ids file. As a result, a umber rock may end up with a cyclops or a goblin animation. It's rather messy, isn't it?
Another perverse effect of successive modifications of the ANIMATE.ids file is the stacking of identical animations listed with a different name or/and index. These new entries are not only redundant and useless, but they can cause serious or critical glitches during installation of mods that use the IDS_OF_SYMBOL (animate ~animation name~) command to ensure their compatibility with both classic and EE games.
That is why you have to follow instructions below if you want to use animations not present in the basic games:
☛ 1. Install Infinity Animations main component before your mod. It harmonizes ANIMATE.ids file to make it usable by all mods and all games.
☛ 2. Never overwrite ANIMATE.ids file.
☛ 3. Rather use the procedure described in the following chapters to add your new animations.
⚠️ Note that these instructions are also available for ANISND.ids file.
Infinity Animations: Note for modders > ANIMATE.ids file •BACK TO TOP
Claiming and Adding new Animation slots (classic game)
If you'd like to add your own animation to the game, please take the time to read and follow the guidelines outlined in the Adding an Animation Entry section of the IA Reference Picker documentation. The process is very simple and should not take more than a few minutes. If everyone (that includes you) can stick to these guidelines, moderation or approval of claims will not be required.
If you've read and understood these guidelines and feel your claim qualifies, read on in the next section.
Infinity Animations: Note for modders > Claiming and Adding new Animation slots (classic game) •BACK TO TOP
Adding new Animation slots in EE Games
Adding new animations in EE games is a little bit easier than the process described above. And most importantly, it does not require Infinity Animations to be installed. 😉
⚠️ If your mod is also designed to be installed in a classic game, start by registering your animation with the IA Reference Picker tool as described in the section above.
1. Choose the appropriate animation slot type
At this point you should be absolutely certain of the type of slot you need for your animation. Consult the Animations reference chart if in doubt.
Once your bam files are built, go to next step.
2. Implement your slot in the game
The easiest way is to use the procedure developed to install Infinity Animations in a EE game. To do this, you will need the following functions libraries:
a7_functions.tpa: Argent77's functions library to install new animations slots into ANIMATE.ids (big thanks to him!)
gw_functions_ee.tpa: list of macros and functions dealing with installing animation slots in EE games.
gw_ee_compat_arrays.tph: library of arrays used to add and install new creature animations (slots, bam, wav files...).
How does it work?
It is pretty simple. IA WeiDU function GW_FIND_FREE_ANIM_SLOT looks for the first available animation slot matching a given animation type, defined in "GW_anim_slots_ee" array.
► Function GW_FIND_FREE_ANIM_SLOT (defined in gw_functions_ee.tpa library) and GW_anim_slots_ee array (defined in gw_ee_compat_arrays.tph library):
/* ================================================================================================================================================ *
* FUNCTION GW_FIND_FREE_ANIM_SLOT : LOOKS for the first available animation slot matching a given animation type. *
* RECHERCHE le premier slot d'animation disponible selon le format de l'animation. *
* ------------------------------------------------------------------------------------------------------------------------------------------------ *
* Returns the first available creature animation slot in the range matching its type defined by %GWFormatAnim%. *
* Original function courtesy of Argent77 - Modified by Gwendolyne to make Infinity Animations installation compatible with EE games. *
* ------------------------------------------------------------------------------------------------------------------------------------------------ *
* INT_VAR GWSlotFound = Used internally to stop the function when a slot is found (DON'T MODIFY IT!). *
* STR_VAR GWFormatAnim = A slots range defined in GW_anim_slots_ee array (built in gw_ee_compat_arrays.tph). *
* Each slots range is defined with the lowest and highest available creature animation slots matching its animation type. *
* The array also defines how many slots to skip after each iteration, starting from the lowest one. *
* RET slot = Free animation slot found. Returns -1 if none found. *
* ================================================================================================================================================ */
DEFINE_ACTION_FUNCTION~GW_FIND_FREE_ANIM_SLOT~INT_VAR GWSlotFound = 0STR_VAR GWFormatAnim =""RET slot
BEGINACTION_IF("%GWFormatAnim%"STR_CMP"")BEGINACTION_PHP_EACH GW_anim_slots_ee AS slots => GW_slot BEGINACTION_IF(GWSlotFound = 0)BEGINACTION_IF("%slots_0%"STR_EQ"%GWFormatAnim%") OR ("%GW_slot%"STR_EQ"%GWFormatAnim%")BEGINOUTER_SET GW_slotMin = %slots_1%OUTER_SET GW_slotMax = %slots_4%ACTION_IF(%slots_3% > 0)BEGINOUTER_SET GW_iter = (GW_slotMax - GW_slotMin) / %slots_3%
// Looping through iterations between GW_slotMin and GW_slotMax
OUTER_FOR(i = 0 ; i <= GW_iter ; ++i)BEGINACTION_IF(GWSlotFound = 0)BEGINOUTER_SET slotMin = GW_slotMin + (i * %slots_3%)
OUTER_SET slotMax = slotMin + %slots_2%LAF~FIND_FREE_ANIM_SLOT~INT_VAR slotMin slotMax RET slot ENDACTION_IF("%slot%" >= 0)BEGINOUTER_SET GWSlotFound = 1ENDENDEND // of Looping through iterations between GW_slotMin and GW_slotMax
END ELSE BEGINACTION_IF(GWSlotFound = 0)BEGINLAF~FIND_FREE_ANIM_SLOT~INT_VAR slotMin = GW_slotMin slotMax = GW_slotMax RET slot ENDACTION_IF("%slot%" >= 0)BEGINOUTER_SET GWSlotFound = 1ENDENDENDEND // ACTION_IF ("%slots_0%" STR_EQ "%GWFormatAnim%") OR ("%GW_slot%" STR_EQ "%GWFormatAnim%")
END // of ACTION_IF (GWSlotFound = 0)
END // of ACTION_PHP_EACH
END // of ACTION_IF ("%GWFormatAnim%" STR_CMP "")
END // of DEFINE_ACTION_FUNCTION
/* =========================================================================================== *
* ARRAY GW_anim_slots_ee : DEFINES available slots ranges matching each animation type. *
* ------------------------------------------------------------------------------------------- *
* Used by function GW_FIND_FREE_ANIM_SLOT to install new animation slots in EE games. *
* ------------------------------------------------------------------------------------------- *
* 1st value = animation type. *
* 2nd value = lowest available creature animation slot for this animation type. *
* 3rd value = how many slots to search inside each step. *
* 4th value = how many slots to skip after each iteration, starting from the lowest one. *
* 5th value = highest available creature animation slot for this animation type. *
* 6th value = specific range to customize where to install new slots. *
* ------------------------------------------------------------------------------------------- *
* Use: to install a BG1 SIMPLE MONSTER animation, you can *
* - Either choose the general 1st value label: BG1SM. *
* - Or choose a specific range: 1SM7100 will look for the first free available slot from *
* 0x7110 to 0x7200, reading 2 slots every 0x10 step (0x7110, 0x7111, 0x7120, 0x7121...). *
* =========================================================================================== */
When a slot is found, it is converted into hex value (function TO_HEX_NUMBER) to append ANIMATE.ids file. This value is stored into $GWNewIni(~%GWNewAnim%~) array used to rename its relative .ini files.
What better than an example to transcribe this code in the tp2 installer? 😉
/* --------------------------------------------------------- *
* BGII SPLIT (EE: monster, split_bams=1): 0x7300 - 0x7f00 *
* --------------------------------------------------------- */
ACTION_FOR_EACH GWNewAnim IN~DAO~ ~DAO_LEGS~ ~EFREETI_LEGS~ ~JANNI~ ~JANNI_LEGS~ ~MARID~ ~MARID_LEGS~BEGINSILENTLAF~GW_FIND_FREE_ANIM_SLOT~STR_VAR GWFormatAnim = BG2SPLIT RET slot ENDACTION_IF(slot < 0)BEGINWARN@1141// ~!!! WARNING : No free creature animation slot found for %GWNewAnim% !!!~END ELSE BEGINLAF~TO_HEX_NUMBER~INT_VAR value = slot minDigits = 4RET hexNumber ENDAPPEND~animate.ids~ ~0x%hexNumber% %GWNewAnim%~UNLESS~%GWNewAnim%~OUTER_SPRINT$GWNewIni(~%GWNewAnim%~)EVAL"%hexNumber%"CLEAR_IDS_MAPENDEND
/* -------------------------------------------- *
* IWD (EE monster_icewind): 0xe000 --> 0xefff *
* -------------------------------------------- */
ACTION_FOR_EACH GWNewAnim IN~BOVINE_AXE_THING~BEGINSILENT// 1. First, we try to install it closer to 0xe070 MINOTAURLAF~FIND_FREE_ANIM_SLOT~INT_VAR slotMin = 0xe070 slotMax = 0xe080RET slot END// 2. If no free slot found, we install it in the first free available slotACTION_IF(slot < 0)BEGINLAF~GW_FIND_FREE_ANIM_SLOT~STR_VAR GWFormatAnim = IWD RET slot ENDACTION_IF(slot < 0)BEGINWARN@1141// ~!!! WARNING : No free creature animation slot found for %GWNewAnim% !!!~ENDENDACTION_IF(slot > 0)BEGINLAF~TO_HEX_NUMBER~INT_VAR value = slot minDigits = 4RET hexNumber ENDAPPEND~animate.ids~ ~0x%hexNumber% %GWNewAnim%~UNLESS~%GWNewAnim%~OUTER_SPRINT$GWNewIni(~%GWNewAnim%~)EVAL"%hexNumber%"CLEAR_IDS_MAPENDENDACTION_FOR_EACH GWNewAnim IN~MARILITH_DARK~BEGINSILENT// 1. First, we try to install it closer to 0xe090 MARILITHLAF~FIND_FREE_ANIM_SLOT~INT_VAR slotMin = 0xe090 slotMax = 0xe0a0RET slot END// 2. If no free slot found, we install it in the first free available slotACTION_IF(slot < 0)BEGINLAF~GW_FIND_FREE_ANIM_SLOT~STR_VAR GWFormatAnim = IWD RET slot ENDACTION_IF(slot < 0)BEGINWARN@1141ENDENDACTION_IF(slot > 0)BEGINLAF~TO_HEX_NUMBER~INT_VAR value = slot minDigits = 4RET hexNumber ENDAPPEND~animate.ids~ ~0x%hexNumber% %GWNewAnim%~UNLESS~%GWNewAnim%~OUTER_SPRINT$GWNewIni(~%GWNewAnim%~)EVAL"%hexNumber%"CLEAR_IDS_MAPENDENDACTION_FOR_EACH GWNewAnim IN~BEETLE_BOMBARDIER_NWN~BEGINSILENT// 1. First, we try to install it closer to 0xe220 BEETLE_BOMBARDIERLAF~FIND_FREE_ANIM_SLOT~INT_VAR slotMin = 0xe220 slotMax = 0xe230RET slot END// 2. If no free slot found, we install it in the first free available slotACTION_IF(slot < 0)BEGINLAF~GW_FIND_FREE_ANIM_SLOT~STR_VAR GWFormatAnim = IWD RET slot ENDACTION_IF(slot < 0)BEGINWARN@1141ENDENDACTION_IF(slot > 0)BEGINLAF~TO_HEX_NUMBER~INT_VAR value = slot minDigits = 4RET hexNumber ENDAPPEND~animate.ids~ ~0x%hexNumber% %GWNewAnim%~UNLESS~%GWNewAnim%~OUTER_SPRINT$GWNewIni(~%GWNewAnim%~)EVAL"%hexNumber%"CLEAR_IDS_MAPENDEND
If you don't know how to set up the .INI file defining the parameters with which the engine will display your animation, please see the next chapter. Otherwise, next step is installing all files related to your animation(s), as explained in this chapter.
Infinity Animations: Note for modders > Adding new Animation slots in EE Games •BACK TO TOP
Ini files Description
All settings relative to the way the engine displays creature animations in-game are stores in .INI files (one for each animation slot) whose names are the same as the animation slot ID (for example 1100.ini for the slot 0x1100).
Each .INI file contains three sections, described below: [general], [animation] and [sounds] sections.
[general]General animation settings
This section lists all global settings needed to display the animation, regardless of its type. Most are common to all available animation types. However, a few are restricted to specific animation types.
Variable
Description
Available values
animation_type
As its name suggests, this is the animation type that will be displayed by the engine.
Below are their matching type names in IA for classic games:
1000 = BGI MONSTER LONG 4 PARTS without extend directions, BGII SPLIT 4 PARTS (0x13nn slots).
1100 = BGI MONSTER LONG 4 PARTS with extend directions.
Animation base movement speed. Default speed for humanoid creatures is 9.
Note: PST:EE uses floating point notation.
Integer or Float
ellipse
Creature selection circle radius. Default size for humanoid creatures is 16.
Integer
color_blood
Just what it means. 😉
However, blood always uses the left-most color of each Color palette lookup index, so most of them end up being indistinguishable in-game.
Most of the good ones for blood are in the 45-60 and 115-150 ranges.
Any integer from 0 to 255
color_chunks
Color gradient index for the associated chunk animation.
Whether the animation can chunk or not (used for example in EFFECT_EXPLODINGDEATH).
Any integer from 0 to 255
0 = Yes [default]
255 = No (such as trolls)
sound_freq
Sounds frequency (specifies the delay between creature sounds). Most of animations are set in under 10.
Any integer from 0 to 255
sound_death
Specifies the sound file played when the creature dies.
Note: does not seem to be used.
String
personal_space
Controls how creatures interact with the game world and can move through passages and doorways. It is measured in search map units.
Most are 3 (humanoid creatures), dragons are 13.
Any integer from 0 to 255
cast_frame
Specifies the sound delay (in animation frames) for casting animations.
Integer
brightest
Blending mode (passed directly to the renderer).
1. If brightest=1 and multiply_blend=0, the following blending mode is performed
srcFactor = GL_ONE_MINUS_DST_COLOR
destFactor = GL_ONE
2. If brightest=1 and multiply_blend=1, the following blending mode is performed
srcFactor = GL_SRC_COLOR
destFactor = GL_ONE
Boolean:
0 = No [default]
1 = Yes
multiply_blend
Blending mode (passed directly to the renderer).
1. If multiply_blend=1 and brightest=0, the following blending mode is performed
srcFactor = GL_DST_COLOR
destFactor = GL_ONE
2. If multiply_blend=1 and brightest=1, the following blending mode is performed
Whether certain tinting effects (e.g. environmental lighting such as day/night, weather or shadows) affect the creature animation.
Boolean:
0 = No [default]
1 = Yes
new_palette
Refers to a BMP file with an external palette that modifies the animation BAM files colors.
For example, MWLF_WI.BMP palette overwrites the MWLF bam files palettes to display winter wolf animation.
String
height_offset
Used to calculate the top of the bounding box for certain effects, such as the health bar, blood splatter, etc.
Note: seems to be only used in BG:EE and SoD games...
A pseudo-image (BMP file) which defines attack pattern (how attack animation sequences are triggered within a combat round).
String
glow_layer
Refers to a BAM prefix acting as an additional background layer for glowing sprites (used by deva and planetars animations).
Note: This option is currently defined in the wrong INI section. To be effective it should be defined in the [monster] section of type 7000 animations.
In addition, it looks like it hasn't been fully implemented and doesn't seem to be applied to the weapon overlay. And it doesn't work correctly with unsplit animation schemes (split_bams=0).
String
walk_sound
The sound clip series used to play the default creature walking sound.
String
[Specific animation]Specific animation type settings
This section lists all settings related to the animation type. Replace Specific animation in square brackets with the animation type name matching the animation_type variable.
Variable
Description
Available values
armor_max_code
(character and character_old animations only)
Maximum armor level a character can equip.
It's basically set to 4 for all the characters except for the monk who has it set to 1.
1 = No Armor
2 = Leather / Studded leather
3 = Chain Mail / Robe
4 = Plate
caster
(monster_layered and monster_quadrant animations only)
Whether A2 and A3 sequences are (also) used as CA and SP (overridden if weapon overlays are defined) or not.
monster_quadrant type: whether A3 sequence is used as CA.
Boolean:
0 = No [default]
1 = Yes
can_lie_down
Whether the creature animation displays frames when it falls down when dead/unconscious (Used by Death and Sleep animations).
Note: Doesn't appear to be related to animation display.
Quote from Bubb: "When a creature is being created and normally 'gets up' (like in summons), determines whether it immediately assigns to its self-reporting list, or LIST_BACK (when can_lie_down=1). I didn't see a direct link to animation sequences, but maybe I missed some connection."
Boolean:
0 = No [default]
1 = Yes
detected_by_infravision
Whether a red tint is applied to the creature animation when detected by infravision.
For example, undead creatures are not detected by infravision.
Boolean:
0 = No [default]
1 = Yes
double_blit
Unknown effect: Possibly a performance setting in the original games.
Note: Apparently unused (only used by 0x6400 drizzt) and unimplemented, but should probably always be set to 0.
Boolean:
0 = No [default]
1 = Yes
mirror
Whether eastern directions are calculated by the engine or not.
Note: Apparently unused (only used by 0x3001 neothelid), but should probably always be set to 0 (eastern directions are available in xxxxE BAM files).
Boolean:
0 = No [default]
1 = Yes
extend_direction
(monster_quadrant and monster_ankheg animations only)
Whether the bam files need mirrored directions.
By default ('No'), the engine automatically mirrors directions (draws eastern directions). Otherwise eastern directions are available as xxxxE BAM files.
monster_ankheg type: Number of available directions per animation sequence (e.g. 5 for ankhegs).
Boolean:
0 = No [default]
1 = Yes
extend_direction_test
(monster_quadrant animations only)
The number of western directions needed in each set of BAM files if eastern directions are to be calculated by the engine.
Quote from Bubb: "When sprite mirroring is enabled / direction is being extended, determines how many valid directions the base vidcell holds."
9 (when set) or 8 (neothelid)
false_color
Whether animation uses palette replacement of individual color ranges (see color fields in CRE resource or color-related opcodes) or not.
Boolean:
0 = No [default]
1 = Yes
invulnerable
Indicates whether creature is un-killable by default (e.g. child animations).
Boolean:
0 = No [default]
1 = Yes
list_type
(ambient animations only)
Used internally by the engine to apply special behavior to the creature.
2 means "flying" (such as bats): not detected by infravision, WK transformed to SC, many hardcoded exceptions (including polymorph, pathfinding, etc.).
Integer [0,1,2]
path_smooth
Defines how pathfinding is calculated.
Note that path_smooth=1 is not well documented (probably uses as many angles as directions available).
The number of segments the animation frames have been split into.
Integer
equip_helmet
(character and character_old animations only)
Whether helmet overlays are drawn or not.
Boolean:
0 = No [default]
1 = Yes
height_code
(character and character_old animations only)
Weapons animation overlays BAM prefix ("WQL", "WQM", "WQN", "WQS", "WPL", "WPM" or "WPS").
Fallback option if height_code_helmet or height_code_shield are not defined
String
height_code_helmet
(character and character_old animations only)
Same as above, but for the helmets animation overlays.
String
height_code_shield
(character animation animations only)
Same as above, but for the shields animation overlays.
Note: WQH does not seem to exist...
String
resref
Animation base name, i.e BAM files prefix (MDEM, MTRO...).
Note for character animation type: It can be overridden by animations with class-specific suffix if available (resref_armor_base and resref_armor_specific).
String
shadow
(effect and character_old animations only)
effect: specifies a separate shadow BAM resref.
character_old: changes default shadow from "CSHD" to what is provided. The Drizzt and Sarevok animations use hardcoded resref ("CSHD" and "SSHD" respectively).
String
split_bams
Whether the BAM files are split or not.
Note: if split_bams=0, animations are packed in G1-G2 BAM files.
Boolean:
0 = No [default]
1 = Yes (animations are spread over various subfiles)
translucent
Whether animation is semi-transparent or not.
Boolean:
0 = No [default]
1 = Yes
resref_weapon1
(monster_layered and monster_layered_spell animations only)
Which one-handed weapon animation overlay (BAM suffix) to use.
String (MS, S1, SS)
resref_weapon2
(monster_layered and monster_layered_spell animations only)
Which two-handed weapon animation overlay (BAM suffix) to use.
String (BW, HB)
dual_attack
(monster_layered_spell animations only)
When set: SEQ_SHOOT transforms into SEQ_READY, and A3 has a chance to use A1 instead.
Boolean:
0 = No [default]
1 = Yes
weapon_left_hand
(monster_icewind animations only)
Propagated, but apparently unused (or unimplemented?) in EE games.
This is the 4th character that replaces the last character of the resref animation filename prefix for shared character animations.
'B' for cleric and fighter, 'M' for monk, 'T' for thief, 'W' for wizard.
single character
resref_armor_specific
(character and character_old animations only)
This is the 4th character that replaces the last character of the resref animation filename prefix for class-specific character animations.
Used when the armor code is equal to armor_max_code.
Usually it is the same character as resref_armor_base, except for clerics and fighters that share the same resref value.
While equipped with armors lighter than plate, they use the same animation files; but when they equip a plate, their animation are different.
In this case, a human cleric male and a human fighter male will use the same CHMB prefix BAM files series when equipped with the three first armor levels (no armor, leather and chain), but when equipped with a plate, the cleric will use the CHMC bam series and the fighter the CHMF series.
'C' for cleric, 'F' for fighter, 'M' for monk, 'T' for thief, 'W' for wizard.
single character
hide_weapons
(character_old animations only)
Used by animations without height_code variable; i.e. their weapons animations are part of their main animation (resref BAM files). [0x6400 UDRZ drizzt, 0x6401 UELM elminster and 0x6404 USAR sarevok]
0: draw separate weapon overlay - 1: do not draw weapon overlays
Boolean:
0 = No [default]
1 = Yes
palette1
(monster and monster_multi animations only)
Refers to a BMP file, a palette replacement for xxxxG1 (unsplit) or xxxxG1x (split) BAM files.
Note: usually the same as new_palette resref.
String
palette2
(monster and monster_multi animations only)
Refers to a BMP file, a replacement for xxxxG2 (unsplit) or xxxxG2x (split) BAM files.
Note: usually named with same pattern as the same as palette1; i.e. if palette1 is MPAL_CL1, then palette2 is MPAL_CL2.
String
palette3
(monster_multi animations only)
Refers to a BMP file, a replacement for xxxxG3 (unsplit) or xxxxG3x (split) BAM files.
However, due to a buggy implementation they are basically defunct. Falls back to the [general] section new_palette value + number of animation group (e.g. the Green Dragon palette resref "MDR1_GR" implies that palette resrefs MDR1_GR1, MDR1_GR2, MDR1_GR3, MDR1_GR4 and MDR1_GR5 are used).
String
palette4
(monster_multi animations only)
Refers to a BMP file, a replacement for xxxxG4 (unsplit) or xxxxG4x (split) BAM files.
However, due to a buggy implementation they are basically defunct. Falls back to the [general] section new_palette value + number of animation group (e.g. the Green Dragon palette resref "MDR1_GR" implies that palette resrefs MDR1_GR1, MDR1_GR2, MDR1_GR3, MDR1_GR4 and MDR1_GR5 are used).
String
palette5
(monster_multi animations only)
Refers to a BMP file, a replacement for xxxxG5 (unsplit) or xxxxG5x (split) BAM files.
However, due to a buggy implementation they are basically defunct. Falls back to the [general] section new_palette value + number of animation group (e.g. the Green Dragon palette resref "MDR1_GR" implies that palette resrefs MDR1_GR1, MDR1_GR2, MDR1_GR3, MDR1_GR4 and MDR1_GR5 are used).
String
palletized
(effect animations only)
Appears not to be implemented.
Boolean:
0 = No [default]
1 = Yes
alt_palette
(effect animations only)
Seems to specify a replacement palette for the effect animation.
String
random_render
(effect animations only)
Indicates whether to select a random cycle at spawn or not.
Boolean:
0 = No [default]
1 = Yes
delta_z
(effect animations only)
Determines how fast certain hardcoded effects move on the (fake) z-axis.
Integer
[sounds]Sound clips settings
☛ Unlike classic games, EE games don't store sounds assigned to a given animation in a .2DA file, but in its .INI file.
☛ ⚠️ Please note that all animations Mxxx.2DA files are not used by the EE engine.
You can use one of the existing ones (e.g. 1100.INI) as a template:
Next step is installing all files related to your animation(s).
Infinity Animations: Note for modders > ini files description •BACK TO TOP
Installing new animations in games
1. Copying new animations to the game
To do this, you are strongly recommended to store the animation .bam files in a separate directory, for example 📁 bam/cre, in which you create a subdirectory for each animation, which you copy to the 📁 override folder:
ACTION_FOR_EACH animation IN~animation1~ ~animation2~ ~animation3~ ... BEGINACTION_BASH_FOR~%MOD_FOLDER%/bam/cre/%animation%~ ~^.+\.bam$~BEGIN// We copy only the files we do need.ACTION_IFNOT FILE_EXISTS_IN_GAME~%BASH_FOR_FILE%~BEGINACTION_TO_LOWER%BASH_FOR_FILE%COPY_LARGE~%BASH_FOR_FILESPEC%~ ~override/%BASH_FOR_FILE%~ENDENDEND
2. Installing 2da files (classic games) or ini files defining general sprite values and soundsets (EE games)
If you want to provide a classic-EE games compatibility, it is better to store .2da and .ini files in two separate folders, for example 📁 2da/cre and 📁 ini.
⚠️ ☛ Note for EE games: Since the animation slot ID is unknown before its installation, and may depend on other animations installed by other mods before yours, here is a little trick that makes it easy to install .ini files. Assign to your animation.ini file the name of the animation registered in the ANIMATE.IDS file. For example dao.ini, dao_legs.ini, animation1.ini, animation2.ini... 😉
Then copy the .2da files into the override (classic game):
COPY~%MOD_FOLDER%/2da/cre~ ~override~
As for .ini files (EE games), borrow the code written for Infinity Animations that uses the hex value defined with the ANIMATE.IDS appending process to automatically copy the corresponding .ini file with the right animation ID [$GWNewIni(~%GWNewAnim%~)].
ACTION_BASH_FOR~%MOD_FOLDER%/ini~ ~^.+\.ini$~BEGINOUTER_SPRINT inifile EVAL"%BASH_FOR_RES%"ACTION_TO_UPPER inifile
// Gives each new .ini file its right name (its animation slot index)ACTION_IFVARIABLE_IS_SET$GWNewIni(~%inifile%~)BEGINSILENTOUTER_SPRINT GW_nv_ini $GWNewIni(~%inifile%~)COPY~%BASH_FOR_FILESPEC%~ ~override/%GW_nv_ini%.ini~PRINT@1121// ~ ==> Animation %inifile%.ini file installed as 0x%GW_nv_ini%.ini~END ELSE BEGINPRINT@1122// ~ ==> Animation %inifile%.ini file not installed.~ENDEND
Congratulations, you have just claimed an animation entry, and installed a new creature animation! 🥂
➽ On top of that, a mod template summarizing the whole procedure, which you can integrate into your code, is the "icing on the cake": You will find it in the 📁 documentation/mymod folder. 😝
Infinity Animations: Note for modders > Installing new animations in games •BACK TO TOP
Using new animation slots
👎 Old school way: forget it!
Your new animation being installed, you just have to use it. To do this, you must assign it to a .CRE file, i.e. fill its animation field (0x28) with the value of the new animation slot.
To illustrate this, let's create a bald eagle as an animal companion for a ranger. Before the release of the Enhanced Edition games, it was very simple, by installing the creature like this:
COPY~%MOD_FOLDER%/cre/mycre.cre~ ~override~WRITE_LONG0x28 0x535D// Animation ID (GW_BALD_EAGLE)BUT_ONLY
Et voilĂ !
Well, almost...
Why? Because, as explained in the above sections, new animations don't fill the same slots in original games as in EE games. This code would inevitably produce a CTD in a EE game. 😖
To install this creature in a EE game, you would have had to use the following code:
COPY~%MOD_FOLDER%/cre/mycre.cre~ ~override~WRITE_LONG0x28 0xE001// Animation ID (GW_BALD_EAGLE)BUT_ONLY
And again, this code would only work on your own installation: If another player had installed a mod adding a new IWD animation before yours, your eagle animation would have been installed in slot 0xE002 and your creature would be given the 0xE001 other mod's animation. 😩
So, how to provide perfect compatibility? It is very simple! 😛
👍 New way: 100% safe and compatible with both original and EE games
➽ Use the WeiDU IDS_OF_SYMBOL command which will automatically look up the index of an animation slot in the ANIMATE.IDS file.
Moreover, it has the advantage of not requiring the use of IF GAME_IS~~ BEGIN conditions.
Thus, the following code will fill mycre.cre with 0x535D animation slot in a classic game and the slot defined by GW_FIND_FREE_ANIM_SLOT function in a EE game:
COPY~%MOD_FOLDER%/cre/mycre.cre~ ~override~WRITE_LONG0x28 IDS_OF_SYMBOL (animate ~GW_BALD_EAGLE~)// Animation ID (GW_BALD_EAGLE) : original 0x535D - EE 0xE001BUT_ONLY
This is the simplest and most convenient method used by Infinity Animations mod to be easily installed on all BG based games.
Infinity Animations: Note for modders > Using new animation slots •BACK TO TOP
Updating old mods
As explained in the mod's readme, in a perfect world, Infinity Animations would be installed as a central hub that would be usable by anyone who would like to add animation entries to the game without being bogged down by issues of mod conflicts and incompatibilities.
Unfortunately, since it was designed a long time after the first mega-mods generation that were overwriting game files, in particular to resolve animation conflicts and restore standard animations that mega-mods have overwritten; it needs to be installed after those mega-mods, at least until their authors will update them to benefit from Infinity Animations content...
While waiting for the wonderful day when Infinity Animations will be able to devote itself to its first vocation and not have to solve mods compatibility issues and conflicts, here are a few tips to adapt your mod to the new AI version. Don't worry, it is not very complicated if you are not the author of a mega-mod!
Avoid bad practices
First of all, let's make a detailed assessment of the bad practices that Infinity Animations is striving to correct and that should be avoided at any cost.
The following points should be avoided if you do not want to suffer the wrath of other modders, and players who will not hesitate to point out that your mod ruins their installation:
1. Do not install Infinity Animations if it is not detected.
Some mods automatically install the pre-requisite mods they need to work properly. While this isn't a problem with TobEx, it can be problematic with mods like Infinity Animations, which will be once again actively maintained. If you want to be definitively convinced, please read the literature about the difficulty of making 1PP v4.2.0 cohabit with Item and Spell Revisions which install by default a few components of 1PP v3.
2. Don't use any "biffing" routines.
This practice was common in the early 2000s, as it allowed to bypass the small capacities of hard disks and avoided lags. However, it is no longer necessary today, because the Generalized Biffing mod allows the gamers to biff the content of their override folder for improved performance, which means the files are converted into the BIF file format and moved into the data folder. Moreover, biffing mod files may, in some cases, cause malfunctions. So avoid doing it!
3. Never overwrite existing animation slots with your own ones.
As a result, a umber rock may end up with a cyclops or a goblin animation. It's rather messy, isn't it?
4. Never overwrite ANIMATE.ids file.
And above all, DO NOT DUPLICATE identical animations listed with a different name and/or index.
1.Make sure Infinity Animations is installed.
This allows you to :
Ensure your mod will be compatible with all games by harmonizing their animation slots.
Install creatures using missing animations in EE games without having to check that their .bam, .ini and .wav files are not missing.
Avoid overloading your mod with dozens (or even hundreds) of useless .bam files.
Enjoy all the animations, original, specific to Infinity Animations or shared by modders, without having to install them.
You just have to insert in your tp2 the following line as a prerequisite to install your mod:
REQUIRE_PREDICATE MOD_IS_INSTALLED ~infinityanimations.tp2~ (ID_OF_LABEL ~infinityanimations.tp2~ ~infinity_animations_main~) @ nn
with
@nn = This mod requires Infinity Animations main component.~
Note : this code est much more 'robust' than the one usually used before, which was MOD_IS_INSTALLED~infinityanimations.tp2~ ~0~.
2.Simplify the installation process of the mod.
Take advantage of the update of your mod to simplify its installation process.
2.a. Remove all "biffing" routines.
This concerns almost exclusively mega-mods. The procedure is underway for most of the mods published at SHS to make them compatible with the new version of Infinity Animations.
2.b.Remove any duplicated animation slot entry.
Stacking identical animation slots listed with a different name or/and index is not only useless, but can cause serious or critical glitches during installation of mods that use the IDS_OF_SYMBOL (animate ~animation name~) command to ensure their compatibility with both classic and EE games.
This is the reason why all unnecessary duplication of slots should be removed from tp2, such as the following mods, taken randomly:
To illustrate this, here are the duplicated animation slots of the animate.ids file installed by the Big World Fixpack which gathers all the slots created by a mega-installation:
Fortunately, from now on, Infinity Animations main component cleans up this file and allows to install mods on a sound basis. But damn i! Coding a patch to fix this regression was a real pain... 😡
So, please be nice and don't corrupt this file with unnecessary slots additions and duplications.
2.c. Install only necessary .bam and sound files.
☛ As of version 6.0.0, Infinity automatically installs new animations as well as missing animations (especially in EE games), unless players have modified infinityanimations-config-default.ini file.
☛ In addition, Infinity Animations now automatically installs creatures sound clips accordingly to the game language localization whenever relevant.
➽ Thus, in theory, it is no longer necessary to provide these files in your mod.
However, if, for safety, you decide to keep the installation procedure of these files in case they do not exist in a classic game, do not hesitate to use the function libraries described below.
3.Use Infinity Animations functions libraries.
To ensure the most perfect compatibility with classic and EE games, I have written many libraries of functions and macros that allow to install IA components according to the games specificities. For example, the beetle bombardier sound clips have different prefixes in classic games (t-bmb) and in EE games (mbbm); the harpy animation use different slots in IA (0x5269) and in EE games (0xe252). In addition, its bam files prefixes are also not the same: 3BS in IA and MHAR in EE.
Do not hesitate to use these libraries or to be inspired by them to install your new animations.
a7_functions.tpa: Argent77's functions library to install new animation slots into ANIMATE.ids (big thanks to him!)
ps_recursive_copy.tpa: Sam's functions library to recursively search files into a parent directory, then copy them to a destination directory. Adapted and modified by Gwendolyne to identify existing localized sound files and install all necessary files (animations and sounds) from 📁 archives/subfolders to 📁 override folder (gw_find_sounds_folder, gw_update_sound_clips and gw_update_content fonctions, gw_install_archives and gw_install_modders_content macros).
gw_functions_ee.tpa: list of macros and functions dealing with installing animation slots in EE games.
gw_ee_compat_arrays.tph: library of arrays used to add and install new creature animations (slots, bam, wav files...).
➽ For support or questions, please visit the mod forum.
Infinity Animations: Note for modders > Updating old mods •BACK TO TOP
Version Changelog (core component only)
Version 6.0.0 (March, 2021)
Modified animations name-spaces, now compatible with non-Western code pages (got rid of the the .exe patch routine forcing a code page change and rebooting if a non-Western code page was detected), and fixed duplicate usage of dragon type slots (XDR3, XDR6). 😉
Added native EE compatibility: changed lines of code to provide EE compatibility whenever possible, in particular the animations names have been harmonized.
Updated IA Reference Picker tool (can now be translated) and updated its documentation.
Added French translation (Gwendolyne).
Uploaded mod to official Spellhold Studios GitHub mirror account.
Version Beta 5 (May 12, 2010)
Changed the .exe patch so that it forces a code page change and reboots if a non-Western code page is detected.
Updated the .exe patch so that it recognises BG1 thief avatars.
Cloned missing animation tables from the unmodded game.
Added other missing animation tables to base 📁 /content folder.
Adding missing minotaur and water weird sounds.
Disabled problematic stacked animations from chitin.key.
Added creature sounds where relevant (major update here).