@viader : Hi, i would preferred to contact you directly... But it seems i can't. So i ask you here: the extanim can be found also on the older version of the infinity engine games? (the non enhanced editions) Becouse when i explore them with nearinfinity i've never found that file. I wanted to add some animations time ago, but i've never been able to find where are the references slots... Only the animate.ids, which alone is not enough for do the job.
Alas... I cannot. First, of course becouse that site is down, but also becouse my pack, which is a "newer" version, but still, before the "enhanced editions", is not recognized by the batch program made by the other guy/gal. I've already tried. Anyway, all i want is simply to know if this sort of "list" (extanim.2da/ids) with the free animations slots (or occupied ones) can be found somewhere in the not enhanced editions.
Well, about why the batch gives me error with my exes i'm not sure.. Could be something else, for sure. Alas, since the site is down, i can't ask to the creator of the mod. My pack is the by the way.
As for the extanim... if it can't be found that, at least i hope there's a way to know which slots can be used or not.
Since this thread is being used to "claim" animation slots and thus avoid incompatibility between different mods, it might be useful to have it (or a condensed version containing the free slots and the claimed ones) stickied for better visibility?
I would prefer to use a method that finds unoccupied creature animation slots dynamically. That way you don't have to reserve fixed ranges of animation slots which might turn out to be too small or big, or overlap with slots in other mods.
I'm currently using a simple slot finding routine (see below) for my Golem Builder mod which attempts to find the next free animation slot in a given range. It checks ANIMATE.IDS, existing INI files and a hardcoded list defined as text file (that can be easily expanded) to avoid using reserved slots. The procedure works well in conjunction with the INI file mechanism for defining new creature animations which is available since patch v1.3.2058.
I have only tested slots for type 7000 and type E000 animations. The type E000 range (used for IWD style animations) appears to have the most freedom. Each unoccupied slot seems to display custom creature animations correctly. Type 7000 animations are more limited. Only the following ranges worked in my tests: 7000..700F 7100..710F 7200..720F 7300..73FF 7400..740F 7500..750F 7600..760F 7700..770F 7800..780F 7900..790F 7A00..7A0F 7B00..7B0F 7C00..7C0F 7D00..7D0F 7E00..7E0F 7F00..7FFF
I haven't tested other ranges yet.
The slot finding functions: [spoiler]/**
* Returns the first free creature animation slot in the range defined by slotMin and slotMax.
* INT_VAR slotMin Lowest available creature animation slot for the animation.
* INT_VAR slotMax Upper limit of creature animation slot range for the animation.
* STR_VAR slotFile Points to a hardcoded list of reserved animation slots to speed up the
* slot finding process.
* RET slot A free animation slot. Returns -1 if none found.
*/
DEFINE_ACTION_FUNCTION FIND_FREE_ANIM_SLOT
INT_VAR
slotMin = 0
slotMax = (slotMin BAND 0xf000) + 0x1000
STR_VAR
slotFile = EVAL ~%MOD_FOLDER%/lib/animslots.txt~
RET
slot
BEGIN
OUTER_SET slot = "-1"
ACTION_IF (slotMin < 0) BEGIN OUTER_SET slotMin = 0 END
ACTION_IF (slotMax < 0) BEGIN OUTER_SET slotMax = 0 END
ACTION_IF (slotMax < slotMin) BEGIN
OUTER_SET tmp = slotMin
OUTER_SET slotMin = slotMax
OUTER_SET slotMax = tmp
END
// animslots.txt contains reserved creature animation slots
COPY - ~%slotFile%~ ~%slotFile%~
READ_ASCII 0 slotList (SOURCE_SIZE)
FOR (idx = slotMin; idx < slotMax; ++idx) BEGIN
LOOKUP_IDS_SYMBOL_OF_INT name ~animate~ idx
PATCH_IF (~%name%~ STRING_EQUAL ~%idx%~) BEGIN
LPF TO_HEX_NUMBER INT_VAR value = idx minDigits = 4 RET hexNumber END
PATCH_IF (NOT FILE_EXISTS_IN_GAME ~%hexNumber%.ini~ AND
~%slotList%~ STRING_CONTAINS_REGEXP ~"%hexNumber%"~ != 0) BEGIN
SET slot = idx
SET idx = slotMax
END
END
END
END
// As patch function
DEFINE_PATCH_FUNCTION FIND_FREE_ANIM_SLOT
INT_VAR
slotMin = 0
slotMax = (slotMin BAND 0xf000) + 0x1000
RET
slot
BEGIN
INNER_ACTION BEGIN
LAF FIND_FREE_ANIM_SLOT INT_VAR slotMin = slotMin slotMax = slotMax RET slot END
END
END
/**
* Converts any positive decimal number into a hexadecimal number.
* INT_VAR value A positive number to convert.
* INT_VAR minDigits The minimum number of digits for the returned value. Smaller numbers
* are padded with zeroes.
* RET hexNumber The hexadecimal representation of the number as string.
*/
DEFINE_ACTION_FUNCTION TO_HEX_NUMBER
INT_VAR
value = 0
minDigits = 1
RET
hexNumber
BEGIN
ACTION_IF (minDigits < 1) BEGIN OUTER_SET minDigits = 1 END
ACTION_IF (minDigits > 8) BEGIN OUTER_SET minDigits = 8 END
OUTER_TEXT_SPRINT hexNumber ~~
ACTION_DEFINE_ARRAY digit BEGIN ~0~ ~1~ ~2~ ~3~ ~4~ ~5~ ~6~ ~7~ ~8~ ~9~ ~a~ ~b~ ~c~ ~d~ ~e~ ~f~ END
OUTER_SET remainder = value BAND 0x7fffffff // no negative numbers allowed
OUTER_WHILE (remainder != 0) BEGIN
OUTER_SET curDigit = remainder BAND 0xf
OUTER_SET remainder = remainder BLSR 4
OUTER_TEXT_SPRINT hexDigit $EVAL digit(~%curDigit%~)
OUTER_TEXT_SPRINT hexNumber ~%hexDigit%%hexNumber%~
END
OUTER_WHILE (STRING_LENGTH ~%hexNumber%~ < minDigits) BEGIN
OUTER_TEXT_SPRINT hexNumber ~0%hexNumber%~
END
END
// As patch function
DEFINE_PATCH_FUNCTION TO_HEX_NUMBER
INT_VAR
value = 0
minDigits = 1
RET
hexNumber
BEGIN
INNER_ACTION BEGIN
LAF TO_HEX_NUMBER INT_VAR value = value minDigits = minDigits RET hexNumber END
END
END
And the required text file containing reserved animation slots: Download [/spoiler] Example code: [spoiler]// Installing a type 7000 creature animation
LAF FIND_FREE_ANIM_SLOT
INT_VAR
slotMin = 0x7300
slotMax = 0x7400
RET
slot
END
ACTION_IF (slot > 0) BEGIN
LAF TO_HEX_NUMBER INT_VAR value = slot minDigits = 4 RET hexNumber END
APPEND ~animate.ids~ ~0x%hexNumber% MY_NEW_CREATURE_ANIM~ UNLESS ~MY_NEW_CREATURE_ANIM~
CLEAR_IDS_MAP
// Installing INI containing creature animation definitions
COPY ~%MOD_FOLDER%/animations/my_new_animation/7xxx.ini~ ~override/%hexNumber%.ini~
// Installing creature animations
ACTION_BASH_FOR ~%MOD_FOLDER%/animations/my_new_animation~ ~.+\.bam~ BEGIN
COPY ~%BASH_FOR_FILESPEC%~ ~override~
END
// Updating creature animation field in CRE files
COPY ~%MOD_FOLDER%/creatures/mycre.cre~ ~override~
SAY NAME1 ~Strange new creature~
WRITE_LONG 0x28 slot // new creature animation
END ELSE BEGIN
FAIL ~No free creature animation slot available.~
END
This example should install the creature animation into slot 0x7303 on a clean BG2EE installation. [/spoiler]
@argent77 Awesome, this looks like a great solution. I'm too lazy to do it now but I'll probably switch to your method for the next release of my mod. Thanks.
The function returns animation slots that are guaranteed to be unoccupied by the current game installation, or -1 if no free slots are available in the given range.
@argent77 I feel stupid but how do I get the .ini file that is needed for your slot-search function? I extracted the drider animations from viader's mod and what I have is .2da, sounds and BAM. This is what I have in my tp2 currently:APPEND ~ANIMATE.IDS~
~0xe282 IC2_DRIDER_FEMALE
0xe283 IC2_DRIDER_MALE~
APPEND ~EXTANIM.2DA~
~57986 0 1 1 0 0 0 47 0 0 NONE NONE NONE 8 10 MDRF NONE 0 0 NONE
57987 0 1 1 0 0 0 47 0 0 NONE NONE NONE 8 10 MDRM NONE 0 0 NONE~
APPEND ~EXTSPEED.2DA~
~57986 9
57987 9~
APPEND ~anisnd.ids~
~0xe282 MDRF CGAMEANIMATIONTYPE_IC2_DRIDER_FEMALE
0xe283 MDRM CGAMEANIMATIONTYPE_IC2_DRIDER_MALE~
COPY ~C#Solaufein/animations/ee/2da~ ~override~
COPY ~C#Solaufein/animations/ee/sound~ ~override~
COPY ~C#Solaufein/animations/ee/bam~ ~override~
@jastey - But where are you going to use it? You no longer need this if it's for BG2EE v2+, because BeamDog now uses the same animation list for BG1EE (v2+), SoD and BG2EE (v2+). You just extract drider animation and ini if needed and copy it to BG2EE override. Since drider is on the animation list, it should work already. I did that with one of the drider animations in my mod. Check it out.
That is great to know. Where would I get the drider animations and .ini? I had a look at your mod, but I am unable to detect what I would need for my mod to make the DROW_MALE and DROW_FEMALE animations in BGII:EE work.
@jastey You need SoD to extrace those animations from the game. They are just a bunch of bams. Use Near Infinity to browse bam files and once you find drows, just export them. Same with the ini. In my mod you'll find all male animations (bam folder - all files starting with letters mdrm). You'll need to extract female from SoD. Male did not need ini, game recognized everything without it (I guess ini may be in BG2 already). So once you copy the male animation to override, that alone should work. It may be the same with female drider, but you need to check it
I'm stupid, of course I mean driders. DRIDER_MALE and DRIDER_FEMALE.
I have the BAMs and the 2da from viader's mod. I'd need instructions to add them to bg2ee so I can use the existant DRIDER_MALE and DRIDER_FEMALE animation antries. If you were talking about driders, which ones exactly are the drider animations in your mod?
I mention that already - mdrm. I am not sure Viader uses the same file names and the file names must remain the same. Just take all mdrm files from my mod (mdrma1, mdrma1e, mdrma2... and all the other files that have mdrm in their name). Those are driders. You will also need female driders. Take them from SoD, not Viaders package, because the files may differ. I'm not sure if Beamdog changed them later, but Viader's package was uploaded LONG before SoD. For example wisp animations changed a bit between IWD2 and SoD, so... yeah... It's better to export them from SoD.
Open NearInfinity and check BG1EE+SoD game installation - I gues the file names will start with mdrf, but that's my guess. Just export them and paste all files to your BG2EE override folder.
I believe it's not a good idea. I mean... it's adding files that are not used and may confuse other modders. Everything will work just fine without those files. You only need bams (and maybe ini for female, as I said I did not check that). It works just fine - checked that in my mod. Anyway - you're welcome.
To summarize, fully defined INI files for all available BG/BG2/IWD/IWD2 creature animations are already present in v2.x patched BGEE and BG2EE. All you have to do is to install associated BAM and WAV resources (and sometimes BMPs for altered palettes). 2DA files are not needed anymore (although the game doesn't break if you install them anyway).
In the case of driders look for E282.INI and E283.INI. The required resource names should all be defined in this file. The resources can be taken directly from IWD2 without making further changes. The animations are of type E000, so BAM files should be following the IWD animation scheme (i.e. using filename suffix A1/A1E, CA/CAE, WK/WKE, ...).
As you know, the equipped appearance attribute of Ninja-tos is S1 - Long sword and the equipped appearance attribute of Wakizashis is SS - Short sword. -> Is it possible to creare a new animation for these two exotic weapons? If so, how?
I know this is an old thing, but I'm trying to mod BG:EE v1.3, and I'm a little confused about how this mod adds animations to the game.
Does anyone know what bams.exe does? For me it just closes instantly when I try to run it. I tried it from command line too, and I got the same thing—seemingly nothing happened.
As far as I remember, bams.exe is a command line tool that allows modders to modify animations palettes. You don't need it. Run the setup exe to install the mod.
As far as I remember, bams.exe is a command line tool that allows modders to modify animations palettes. You don't need it. Run the setup exe to install the mod.
Thanks for the explanation. The problem is that I want the vanilla BG1 character animations, and while the files are there in the archive, the mod doesn't seem to add them to the game as actual animations. So right now I'm trying to find out how the mods adds the rest of the animations so that I could replicate that process for the vanilla BG1 character animation BAMs.
Comments
0x56440x5645Becouse when i explore them with nearinfinity i've never found that file. I wanted to add some animations time ago, but i've never been able to find where are the references slots... Only the animate.ids, which alone is not enough for do the job.
As for the extanim... if it can't be found that, at least i hope there's a way to know which slots can be used or not.
Since this thread is being used to "claim" animation slots and thus avoid incompatibility between different mods, it might be useful to have it (or a condensed version containing the free slots and the claimed ones) stickied for better visibility?
I'm currently using a simple slot finding routine (see below) for my Golem Builder mod which attempts to find the next free animation slot in a given range. It checks ANIMATE.IDS, existing INI files and a hardcoded list defined as text file (that can be easily expanded) to avoid using reserved slots. The procedure works well in conjunction with the INI file mechanism for defining new creature animations which is available since patch v1.3.2058.
I have only tested slots for type 7000 and type E000 animations. The type E000 range (used for IWD style animations) appears to have the most freedom. Each unoccupied slot seems to display custom creature animations correctly. Type 7000 animations are more limited. Only the following ranges worked in my tests:
7000..700F
7100..710F
7200..720F
7300..73FF
7400..740F
7500..750F
7600..760F
7700..770F
7800..780F
7900..790F
7A00..7A0F
7B00..7B0F
7C00..7C0F
7D00..7D0F
7E00..7E0F
7F00..7FFF
I haven't tested other ranges yet.
The slot finding functions:
[spoiler]
/** * Returns the first free creature animation slot in the range defined by slotMin and slotMax. * INT_VAR slotMin Lowest available creature animation slot for the animation. * INT_VAR slotMax Upper limit of creature animation slot range for the animation. * STR_VAR slotFile Points to a hardcoded list of reserved animation slots to speed up the * slot finding process. * RET slot A free animation slot. Returns -1 if none found. */ DEFINE_ACTION_FUNCTION FIND_FREE_ANIM_SLOT INT_VAR slotMin = 0 slotMax = (slotMin BAND 0xf000) + 0x1000 STR_VAR slotFile = EVAL ~%MOD_FOLDER%/lib/animslots.txt~ RET slot BEGIN OUTER_SET slot = "-1" ACTION_IF (slotMin < 0) BEGIN OUTER_SET slotMin = 0 END ACTION_IF (slotMax < 0) BEGIN OUTER_SET slotMax = 0 END ACTION_IF (slotMax < slotMin) BEGIN OUTER_SET tmp = slotMin OUTER_SET slotMin = slotMax OUTER_SET slotMax = tmp END // animslots.txt contains reserved creature animation slots COPY - ~%slotFile%~ ~%slotFile%~ READ_ASCII 0 slotList (SOURCE_SIZE) FOR (idx = slotMin; idx < slotMax; ++idx) BEGIN LOOKUP_IDS_SYMBOL_OF_INT name ~animate~ idx PATCH_IF (~%name%~ STRING_EQUAL ~%idx%~) BEGIN LPF TO_HEX_NUMBER INT_VAR value = idx minDigits = 4 RET hexNumber END PATCH_IF (NOT FILE_EXISTS_IN_GAME ~%hexNumber%.ini~ AND ~%slotList%~ STRING_CONTAINS_REGEXP ~"%hexNumber%"~ != 0) BEGIN SET slot = idx SET idx = slotMax END END END END // As patch function DEFINE_PATCH_FUNCTION FIND_FREE_ANIM_SLOT INT_VAR slotMin = 0 slotMax = (slotMin BAND 0xf000) + 0x1000 RET slot BEGIN INNER_ACTION BEGIN LAF FIND_FREE_ANIM_SLOT INT_VAR slotMin = slotMin slotMax = slotMax RET slot END END END /** * Converts any positive decimal number into a hexadecimal number. * INT_VAR value A positive number to convert. * INT_VAR minDigits The minimum number of digits for the returned value. Smaller numbers * are padded with zeroes. * RET hexNumber The hexadecimal representation of the number as string. */ DEFINE_ACTION_FUNCTION TO_HEX_NUMBER INT_VAR value = 0 minDigits = 1 RET hexNumber BEGIN ACTION_IF (minDigits < 1) BEGIN OUTER_SET minDigits = 1 END ACTION_IF (minDigits > 8) BEGIN OUTER_SET minDigits = 8 END OUTER_TEXT_SPRINT hexNumber ~~ ACTION_DEFINE_ARRAY digit BEGIN ~0~ ~1~ ~2~ ~3~ ~4~ ~5~ ~6~ ~7~ ~8~ ~9~ ~a~ ~b~ ~c~ ~d~ ~e~ ~f~ END OUTER_SET remainder = value BAND 0x7fffffff // no negative numbers allowed OUTER_WHILE (remainder != 0) BEGIN OUTER_SET curDigit = remainder BAND 0xf OUTER_SET remainder = remainder BLSR 4 OUTER_TEXT_SPRINT hexDigit $EVAL digit(~%curDigit%~) OUTER_TEXT_SPRINT hexNumber ~%hexDigit%%hexNumber%~ END OUTER_WHILE (STRING_LENGTH ~%hexNumber%~ < minDigits) BEGIN OUTER_TEXT_SPRINT hexNumber ~0%hexNumber%~ END END // As patch function DEFINE_PATCH_FUNCTION TO_HEX_NUMBER INT_VAR value = 0 minDigits = 1 RET hexNumber BEGIN INNER_ACTION BEGIN LAF TO_HEX_NUMBER INT_VAR value = value minDigits = minDigits RET hexNumber END END END
And the required text file containing reserved animation slots: Download
[/spoiler]
Example code:
[spoiler]
// Installing a type 7000 creature animation LAF FIND_FREE_ANIM_SLOT INT_VAR slotMin = 0x7300 slotMax = 0x7400 RET slot END ACTION_IF (slot > 0) BEGIN LAF TO_HEX_NUMBER INT_VAR value = slot minDigits = 4 RET hexNumber END APPEND ~animate.ids~ ~0x%hexNumber% MY_NEW_CREATURE_ANIM~ UNLESS ~MY_NEW_CREATURE_ANIM~ CLEAR_IDS_MAP // Installing INI containing creature animation definitions COPY ~%MOD_FOLDER%/animations/my_new_animation/7xxx.ini~ ~override/%hexNumber%.ini~ // Installing creature animations ACTION_BASH_FOR ~%MOD_FOLDER%/animations/my_new_animation~ ~.+\.bam~ BEGIN COPY ~%BASH_FOR_FILESPEC%~ ~override~ END // Updating creature animation field in CRE files COPY ~%MOD_FOLDER%/creatures/mycre.cre~ ~override~ SAY NAME1 ~Strange new creature~ WRITE_LONG 0x28 slot // new creature animation END ELSE BEGIN FAIL ~No free creature animation slot available.~ END
This example should install the creature animation into slot 0x7303 on a clean BG2EE installation.
[/spoiler]
I'm too lazy to do it now but I'll probably switch to your method for the next release of my mod.
Thanks.
Download: animation_slots_library_v2.zip (including example usage)
The function returns animation slots that are guaranteed to be unoccupied by the current game installation, or -1 if no free slots are available in the given range.
Edit: Added a new parameter "slotSteps" to v2.
APPEND ~ANIMATE.IDS~ ~0xe282 IC2_DRIDER_FEMALE 0xe283 IC2_DRIDER_MALE~ APPEND ~EXTANIM.2DA~ ~57986 0 1 1 0 0 0 47 0 0 NONE NONE NONE 8 10 MDRF NONE 0 0 NONE 57987 0 1 1 0 0 0 47 0 0 NONE NONE NONE 8 10 MDRM NONE 0 0 NONE~ APPEND ~EXTSPEED.2DA~ ~57986 9 57987 9~ APPEND ~anisnd.ids~ ~0xe282 MDRF CGAMEANIMATIONTYPE_IC2_DRIDER_FEMALE 0xe283 MDRM CGAMEANIMATIONTYPE_IC2_DRIDER_MALE~ COPY ~C#Solaufein/animations/ee/2da~ ~override~ COPY ~C#Solaufein/animations/ee/sound~ ~override~ COPY ~C#Solaufein/animations/ee/bam~ ~override~
(Taken from this mod.)
I have problems transferring this to a version using your function, and I would appreciate any help.
Male did not need ini, game recognized everything without it (I guess ini may be in BG2 already). So once you copy the male animation to override, that alone should work. It may be the same with female drider, but you need to check it
I have the BAMs and the 2da from viader's mod. I'd need instructions to add them to bg2ee so I can use the existant DRIDER_MALE and DRIDER_FEMALE animation antries.
If you were talking about driders, which ones exactly are the drider animations in your mod?
Do I still need the MDRF.2da and MDRM.2da? Do they hurt if I copy them to the override?
Open NearInfinity and check BG1EE+SoD game installation - I gues the file names will start with mdrf, but that's my guess. Just export them and paste all files to your BG2EE override folder.
I will leave the MDRF.2da and MDRM.2da in unless someone tells me why it isn't a good idea. :-)
Anyway - you're welcome.
In the case of driders look for E282.INI and E283.INI. The required resource names should all be defined in this file. The resources can be taken directly from IWD2 without making further changes. The animations are of type E000, so BAM files should be following the IWD animation scheme (i.e. using filename suffix A1/A1E, CA/CAE, WK/WKE, ...).
I'm only using the BAMs and WAVs.
Thanks!
Does anyone know what bams.exe does? For me it just closes instantly when I try to run it. I tried it from command line too, and I got the same thing—seemingly nothing happened.
Thanks for the explanation. The problem is that I want the vanilla BG1 character animations, and while the files are there in the archive, the mod doesn't seem to add them to the game as actual animations. So right now I'm trying to find out how the mods adds the rest of the animations so that I could replicate that process for the vanilla BG1 character animation BAMs.