Jump to content


Photo

IA bugs and fixes


  • Please log in to reply
74 replies to this topic

#1 Miloch

Miloch

    Barbarian

  • Modder
  • 6573 posts

Posted 26 January 2010 - 06:30 AM

I ran a check to see if we broke anything by moving the _LOW entries. As I only found two things in an entire BWP install, I just silently included the code to fix it locally, but I didn't know someone else would encounter the issue so quickly :blink:.

Polymorph() can specify a change to any animation entry. It does so for a _LOW entry only once in BGT or Tutu, and one other time out of all the mods out there (in NTotSC). It's very easy to fix though, by adding the following to the code:
ACTION_IF FILE_EXISTS_IN_GAME ~fw0125.are~ BEGIN
  OUTER_SPRINT tst ~_~ //Tutu initial underscore
END ELSE BEGIN
  OUTER_SPRINT tst ~t~
END

COPY_EXISTING ~%tst%halantr.bcs~ ~override~
  DECOMPILE_BCS_TO_BAF
    REPLACE_TEXTUALLY CASE_INSENSITIVE EXACT_MATCH ~Polymorph(MAGE_MALE_HUMAN_LOW)~ ~Polymorph(MAGE_MALE_HUMAN)~
    REPLACE_TEXTUALLY CASE_INSENSITIVE EXACT_MATCH ~Polymorph(20992)~ ~Polymorph(25088)~
  COMPILE_BAF_TO_BCS
BUT_ONLY

ACTION_IF FILE_EXISTS_IN_GAME ~ntkeelor.dlg~ BEGIN
  COPY_EXISTING ~ntkeelor.dlg~ ~override~
    PATCH_IF SOURCE_SIZE > 0x34 BEGIN
      DECOMPILE_DLG_TO_D
      REPLACE_TEXTUALLY CASE_INSENSITIVE EXACT_MATCH ~Polymorph(FIGHTER_MALE_DWARF_LOW)~ ~Polymorph(FIGHTER_MALE_DWARF)~
      REPLACE_TEXTUALLY CASE_INSENSITIVE EXACT_MATCH ~Polymorph(20738)~ ~Polymorph(24834)~
      COMPILE_D_TO_DLG
    END
  BUT_ONLY
END

ACTION_IF FILE_EXISTS_IN_GAME ~dalbion.dlg~ BEGIN
  COPY_EXISTING ~dalbion.dlg~ ~override~
    PATCH_IF SOURCE_SIZE > 0x34 BEGIN
      DECOMPILE_DLG_TO_D
      REPLACE_TEXTUALLY CASE_INSENSITIVE EXACT_MATCH ~Polymorph(IC_YUANTI3)~ ~Polymorph(YUANTI3)~
      COMPILE_D_TO_DLG
    END
  BUT_ONLY
END
I think I've managed to include your other updates Erephine, so I'll send you a new version soonish. Was hoping to finish the sounds first but that probably won't happen for a while (and isn't really urgent I suppose). Hmm, maybe we should use git or something if we are editing the same files, though that might be even more of a pain than diffing and merging.

Incidentally, renaming IDS entries doesn't pose an issue with this normally (just renumbering as we've done for the _LOW entries) since .bcs files are compiled with numeric rather than textual values. It would only be an issue if someone installed a mod expecting certain entries *after* IA, which isn't recommended and in any case, the modder would just have to account for the proper IDS values (numerically would probably be easiest).

Edited by Miloch, 27 January 2010 - 05:30 AM.

Infinity Engine Contributions
Aurora * BG1 NPC * BG1 Fixpack * Haiass * Infinity Animations * Level 1 NPCs * P5Tweaks
PnP Free Action * Thrown Hammers * Unique Containers * BG:EE * BGII:EE * IWD:EE
================================================================
Player & Modder Resources
BAM Batcher * Creature Lister * Creature Checker * Creature Fixer * Tutu/BGT Area Map & List * Tutu Mod List
================================================================
"Infinity turns out to be the opposite of what people say it is. It is not 'that which has nothing beyond itself' that is infinite, but 'that which always has something beyond itself'." -Aristotle


#2 -Guest-

-Guest-
  • Guest

Posted 26 January 2010 - 08:35 AM

IC_YUANTI3 from NEJ's dalbion.dlg also needs a replacement entry.

#3 Miloch

Miloch

    Barbarian

  • Modder
  • 6573 posts

Posted 26 January 2010 - 11:18 AM

IC_YUANTI3 from NEJ's dalbion.dlg also needs a replacement entry.

Why? There is no problem with morphing to existing entries, as obviously this dialogue wants to do given it does a SetGlobal("Yuanti_Inferno") before that Polymorph. The issues are only with morphing to _LOW entries.

However, there may be an issue if a mod adds animations to nonstandard slots and then also adds Polymorph actions for those. I think the chances for this are fairly slim but it could happen. I think I searched for this and took care of it (Sheena for example used a spell to change to a half-dragon) but I'm not sure I checked all the dialogue and scripts - maybe just spells and items. Guess someone should take a look at that with NI. Guess it might have to be me, unless Arkenor makes a comeback or someone else volunteers.

Edit: I did check dialogues and scripts for other issues like that and found nothing. Also if you want to install the fix above without doing it manually, get it here (also applies to Aurora v4).

Edited by Miloch, 26 January 2010 - 04:33 PM.

Infinity Engine Contributions
Aurora * BG1 NPC * BG1 Fixpack * Haiass * Infinity Animations * Level 1 NPCs * P5Tweaks
PnP Free Action * Thrown Hammers * Unique Containers * BG:EE * BGII:EE * IWD:EE
================================================================
Player & Modder Resources
BAM Batcher * Creature Lister * Creature Checker * Creature Fixer * Tutu/BGT Area Map & List * Tutu Mod List
================================================================
"Infinity turns out to be the opposite of what people say it is. It is not 'that which has nothing beyond itself' that is infinite, but 'that which always has something beyond itself'." -Aristotle


#4 -Guest-

-Guest-
  • Guest

Posted 26 January 2010 - 07:29 PM

The original entry "0xED20 IC_YUANTI3" in animate.ids gets replaced with "0xED20 YUANTI3" after installing Infinity Animations due to:

COPY_EXISTING ~animate.ids~ ~override~

    ...
    
    REPLACE_TEXTUALLY CASE_INSENSITIVE ~[%ws%]IC_~ ~ ~

(from t-animate.tpa: line 27)


now, since you're changing IC_YUANTI3 to YUANTI3, shouldn't you also change "Polymorph(IC_YUANTI3)" to "Polymorph(YUANTI3)" in the respective dialog? (even if it doesn't cause a crash, isn't it still a discrepancy?)

#5 Miloch

Miloch

    Barbarian

  • Modder
  • 6573 posts

Posted 26 January 2010 - 07:45 PM

No, because as I said, scripts and dialogues get compiled with the numeric values rather than textual values. It is only an issue for renumbering values, not renaming them, which every mod and its brother already does (and usually by clumsily overwriting the IDS files rather than patching them).

Infinity Engine Contributions
Aurora * BG1 NPC * BG1 Fixpack * Haiass * Infinity Animations * Level 1 NPCs * P5Tweaks
PnP Free Action * Thrown Hammers * Unique Containers * BG:EE * BGII:EE * IWD:EE
================================================================
Player & Modder Resources
BAM Batcher * Creature Lister * Creature Checker * Creature Fixer * Tutu/BGT Area Map & List * Tutu Mod List
================================================================
"Infinity turns out to be the opposite of what people say it is. It is not 'that which has nothing beyond itself' that is infinite, but 'that which always has something beyond itself'." -Aristotle


#6 -Guest-

-Guest-
  • Guest

Posted 26 January 2010 - 07:58 PM

what's the harm in changing it anyway? ???

at least it would prevent NI from displaying those annoying "IC_YUANT3 not found in ANIMATE.IDS"

this is the only dialogue (besides ntkeelor) that makes IA throw unnecessary errors in my test mega install, so it's not like there's hundreds of them...

#7 Miloch

Miloch

    Barbarian

  • Modder
  • 6573 posts

Posted 26 January 2010 - 08:18 PM

Maybe dialogues decompile differently than scripts, which is retarded but then so is the engine sometimes. Take a look at d4alb.bcs for example and you should see it decompiles properly. The main reason I stripped the IC_ prefix was to match Erephine's IDS files (which in some cases append an _IWD suffix instead for better sorting) and I made a case in the IDS thread for either not touching the entries at all or overhauling them completely but no one really responded. Anyway, if it's just this one additional file (which seems to be the case) then yes, we can either patch it or not mess with the IDS entry - either should have the same effect.

Code and patch updated.

Edited by Miloch, 27 January 2010 - 05:32 AM.

Infinity Engine Contributions
Aurora * BG1 NPC * BG1 Fixpack * Haiass * Infinity Animations * Level 1 NPCs * P5Tweaks
PnP Free Action * Thrown Hammers * Unique Containers * BG:EE * BGII:EE * IWD:EE
================================================================
Player & Modder Resources
BAM Batcher * Creature Lister * Creature Checker * Creature Fixer * Tutu/BGT Area Map & List * Tutu Mod List
================================================================
"Infinity turns out to be the opposite of what people say it is. It is not 'that which has nothing beyond itself' that is infinite, but 'that which always has something beyond itself'." -Aristotle


#8 aVENGER

aVENGER
  • Modder
  • 1680 posts

Posted 05 February 2010 - 12:06 AM

After browsing through setup-infinityanimations.tp2, I noticed that besides altering the cerature animations, this mod also makes some other non-cosmetic stat changes such as altering the creatures' alignment, race, class etc. Personally, I don't think it's such a good idea for a purely cosmetic mod to be doing this, especially without giving the user any notice that it's being done. *insert dependencies related rant here* :P Here's an example of the problematic code:

ACTION_FOR_EACH nb IN ~caddem11~ ~caddem18~ ~caddem25~ ~caddem3~ ~dempit~ ~dempit01~ ~dempitr1~ ~dempitr2~ ~dempitsu~ ~demgelsu~ ~dubnd11~ ~dw#bazpf~ ~dw#pitsu~ ~gelugeon~ ~gelugon1~ ~heldem3~ ~heldem4~ ~heldem5~ ~psbaatl~ ~rempitsu~ ~telpit1~ ~telpit2~ ~tg#dem1~ ~z#gpit01~ ~z#gpitfd~ ~z_whel1~ ~z_whel2~ ~z_whel3~ ~z_whel4~ BEGIN
  ACTION_IF FILE_EXISTS_IN_GAME ~%nb%.cre~ BEGIN //Devils (Pit Fiends, Gelugons)
    COPY_EXISTING ~%nb%.cre~ ~override~
      PATCH_INCLUDE ~infinityanimations/lib/fj_cre_validity.tpp~
      PATCH_IF vl BEGIN
        PATCH_INCLUDE ~infinityanimations/lib/fj_cre_reindex.tpp~
        WRITE_SHORT 0x28 0x1100 //Animation (tanar'ri)
        WRITE_BYTE 0x237 1 //Sex (male)
        WRITE_BYTE 0x271 255 //General (monster)
        READ_BYTE 0x275 gd //Gender
        PATCH_IF (gd != 6) AND (gd != 9) BEGIN //If not summoned
          WRITE_BYTE 0x275 1 //male
        END
        WRITE_BYTE 0x272 141 //Race (devil)
        WRITE_BYTE 0x273 179 //Class (devil)
        WRITE_BYTE 0x27b 19 //Alignment (lawful evil by definition)
      END
    BUT_ONLY
  END
END

The most significant problem which arises from this is that changing the Devils' race designation from DEMONIC to IMP causes serious issues with nearly all tactical AI mods, including Tactics, Big Picture, SCS I & II, aTweaks, RR as well as some AI scripts from the unmodded game (Watcher's Keep Fiends). Now, while it's true that the Bioware developers messed up on this one by mislabeling all Fiends (including Devils) as Race = DEMONIC, it's still a very bad idea to arbitrarily change this since most mods detect Fiends with Race(LastSeenBy(Myself),DEMONIC) or something similar, so this change will certainly lead to script breakage. Furthermore, most items which have Fiend related EFF targeting also use Race = DEMONIC for target acquisition. FYI, by the time of ToB, Bioware's devs were fairly consistent in labeling Devils as Race = DEMONIC & Class = IMP while they made Demons Race = DEMONIC & Class = TANARRI.

Edited by aVENGER, 05 February 2010 - 12:24 AM.


#9 Miloch

Miloch

    Barbarian

  • Modder
  • 6573 posts

Posted 05 February 2010 - 11:38 AM

...

Bah. I knew I should've obfuscated this code something fierce :P. Personally, I think the AI mods should update their scripts, which would be easy enough with a global search and replace. Devils are clearly not demons.

And no, it is not this mod's goal to make changes other than "cosmetic" as you say, but it was a goal to have some sort of consistency while patching oodles of creatures. So this is not a "change" per se but an imposition of consistency, since the CREs in question are all over the place, which would be fine if they're different CREs but they're not. This is particularly important when I go to do sounds, since casting sounds are hardcoded to gender - entirely inappropriate for obvious female CREs to have a non-female gender (unless summoned, but even with that they still get the male casting voice).

It's primarily megamods (older ones no longer maintained) that I'm talking about - take a look at the spreadsheet I posted in one of your threads. I guess if it's as you say that devils use race of "demonic" but class of "imp" I'm fine with changing it to that unless cavaliers use the "race" for their bonus against demons. It was pretty clear from this thread that it should only apply to demons proper, and not all sorts of fiends.

Infinity Engine Contributions
Aurora * BG1 NPC * BG1 Fixpack * Haiass * Infinity Animations * Level 1 NPCs * P5Tweaks
PnP Free Action * Thrown Hammers * Unique Containers * BG:EE * BGII:EE * IWD:EE
================================================================
Player & Modder Resources
BAM Batcher * Creature Lister * Creature Checker * Creature Fixer * Tutu/BGT Area Map & List * Tutu Mod List
================================================================
"Infinity turns out to be the opposite of what people say it is. It is not 'that which has nothing beyond itself' that is infinite, but 'that which always has something beyond itself'." -Aristotle


#10 aVENGER

aVENGER
  • Modder
  • 1680 posts

Posted 05 February 2010 - 12:07 PM

I guess if it's as you say that devils use race of "demonic" but class of "imp" I'm fine with changing it


Thanks, that would prevent the aforementioned AI mods from going haywire if Infinity Animations is installed.

unless cavaliers use the "race" for their bonus against demons.


They do, but wouldn't it make more sense to patch those two EFF files to use Class = TANARRI in some kit altering mod? ;)

#11 Miloch

Miloch

    Barbarian

  • Modder
  • 6573 posts

Posted 05 February 2010 - 12:17 PM

They do, but wouldn't it make more sense to patch those two EFF files to use Class = TANARRI in some kit altering mod? ;)

No, it'd make more sense to sneak it into IA as a non-optional component - just kidding :P. Eh, which EFFs are those though (just curious)?

Infinity Engine Contributions
Aurora * BG1 NPC * BG1 Fixpack * Haiass * Infinity Animations * Level 1 NPCs * P5Tweaks
PnP Free Action * Thrown Hammers * Unique Containers * BG:EE * BGII:EE * IWD:EE
================================================================
Player & Modder Resources
BAM Batcher * Creature Lister * Creature Checker * Creature Fixer * Tutu/BGT Area Map & List * Tutu Mod List
================================================================
"Infinity turns out to be the opposite of what people say it is. It is not 'that which has nothing beyond itself' that is infinite, but 'that which always has something beyond itself'." -Aristotle


#12 aVENGER

aVENGER
  • Modder
  • 1680 posts

Posted 05 February 2010 - 12:34 PM

Eh, which EFFs are those though (just curious)?


They are demhit3.eff and demdam3.eff.

If you change param1 to 160 and param2 to 5 you'll make them target Class = TANARI.

#13 Miloch

Miloch

    Barbarian

  • Modder
  • 6573 posts

Posted 05 February 2010 - 01:15 PM

If you change param1 to 160 and param2 to 5 you'll make them target Class = TANARI.

Why not put that in aTweaks? It would complement your existing PnP Fiends component nicely :).

Infinity Engine Contributions
Aurora * BG1 NPC * BG1 Fixpack * Haiass * Infinity Animations * Level 1 NPCs * P5Tweaks
PnP Free Action * Thrown Hammers * Unique Containers * BG:EE * BGII:EE * IWD:EE
================================================================
Player & Modder Resources
BAM Batcher * Creature Lister * Creature Checker * Creature Fixer * Tutu/BGT Area Map & List * Tutu Mod List
================================================================
"Infinity turns out to be the opposite of what people say it is. It is not 'that which has nothing beyond itself' that is infinite, but 'that which always has something beyond itself'." -Aristotle


#14 aVENGER

aVENGER
  • Modder
  • 1680 posts

Posted 08 February 2010 - 04:42 AM

Thanks for fixing the alignment conflict. :)

BTW, I noticed that you now also adjust the Fiends' levels using PnP values. While I personally have no problem with that (since aTweaks uses the exact same values) it might adversely affect other mods which toughen Fiends up (i.e. Spell Revisions and SCSII). Therefore, I still think it would be the best to separate everything but the gender fixes (which do indeed affect casting sounds) into an optional component and document it properly to avoid confusing the players.

Edited by aVENGER, 08 February 2010 - 04:45 AM.


#15 Miloch

Miloch

    Barbarian

  • Modder
  • 6573 posts

Posted 08 February 2010 - 11:38 AM

Thanks for fixing the alignment conflict.

What alignment conflict? :blink:

BTW, I noticed that you now also adjust the Fiends' levels using PnP values.

No, we don't. The only possible thing like that I recall is fixing a bug in stuff like Aec'Letec's level/hitdice being set at "1", in which case we correct it to match the hitdice/points, and even *then* only if someone else hasn't set it to a greater value (by using an IF level < value check). This is essentially a cosmetic change anyway, since we don't mess with actual HP. The stuff you're nitpicking at this point is truly trivial, and done for patching consistency purposes (concerning mod-added or BG1 CREs which would not be picked up by the BG2 Fixpack) and it's not worth trying to clone the entire mod and make another component out of it, maintain 2 different versions and *then* document such needless duplication when we should be focusing on the meat and potatoes (i.e. animations and sounds). Now if you have valid examples of issues the code may cause (like your fiend race example) I can take a look at it. But this doesn't sound like a mod bug, so quit harshin' on the soopercode, dood :lol:.

Edit: I did notice an actual bug in beta4 whereby I had commented out a large chunk of the file-checking code for testing purposes :huh:. Fixed in uploaded archive.

Edited by Miloch, 08 February 2010 - 06:40 PM.

Infinity Engine Contributions
Aurora * BG1 NPC * BG1 Fixpack * Haiass * Infinity Animations * Level 1 NPCs * P5Tweaks
PnP Free Action * Thrown Hammers * Unique Containers * BG:EE * BGII:EE * IWD:EE
================================================================
Player & Modder Resources
BAM Batcher * Creature Lister * Creature Checker * Creature Fixer * Tutu/BGT Area Map & List * Tutu Mod List
================================================================
"Infinity turns out to be the opposite of what people say it is. It is not 'that which has nothing beyond itself' that is infinite, but 'that which always has something beyond itself'." -Aristotle


#16 aVENGER

aVENGER
  • Modder
  • 1680 posts

Posted 08 February 2010 - 11:00 PM

What alignment conflict? :blink:


Slip of the tongue, I ment the race conflict of course. :)


No, we don't. The only possible thing like that I recall is fixing a bug in stuff like Aec'Letec's level/hitdice being set at "1", in which case we correct it to match the hitdice/points, and even *then* only if someone else hasn't set it to a greater value (by using an IF level < value check).


Ah, I didnt notice the Level1 < 13 check at first glance, sorry. That's cool then, but you might want to use something similar here as well:

ACTION_IF FILE_EXISTS_IN_GAME ~%tsu%kirinh.cre~ BEGIN //Kirinhale
  COPY_EXISTING ~%tsu%kirinh.cre~ ~override~
    PATCH_IF SOURCE_SIZE > 0x2d3 BEGIN
      WRITE_SHORT 0x28 0x5290 //Animation (succubus_nwn)
      WRITE_BYTE 0x234 12 //Level 1 (was 0)
      WRITE_BYTE 0x237 2 //Sex (female)
      WRITE_BYTE 0x23e 25 //Charisma (was 30)
      WRITE_BYTE 0x275 2 //Gender (female)
      WRITE_BYTE 0x272 121 //Race (fiend)
    END
  BUT_ONLY
END

Anyway, I case I didn't say it already, great mod, definitivelly going to my perma install list. 8)

#17 Miloch

Miloch

    Barbarian

  • Modder
  • 6573 posts

Posted 09 February 2010 - 03:31 PM

That's cool then, but you might want to use something similar here as well:

Yeah, I saw that but didn't think it significant enough to bother with. But what's 2 more lines of code :P. Actually, I don't know why I used 12 - it should really be 6 to match 48 HP. And also the PnP value, not that this is a PnP mod per se, but it's clearly more appropriate than *zero*. This might only be off in Tutu; BGT or some other BGT mod fixes it). If you're wondering about the charisma, 30 is not a valid value so it's a bugfix.

Infinity Engine Contributions
Aurora * BG1 NPC * BG1 Fixpack * Haiass * Infinity Animations * Level 1 NPCs * P5Tweaks
PnP Free Action * Thrown Hammers * Unique Containers * BG:EE * BGII:EE * IWD:EE
================================================================
Player & Modder Resources
BAM Batcher * Creature Lister * Creature Checker * Creature Fixer * Tutu/BGT Area Map & List * Tutu Mod List
================================================================
"Infinity turns out to be the opposite of what people say it is. It is not 'that which has nothing beyond itself' that is infinite, but 'that which always has something beyond itself'." -Aristotle


#18 Inebane

Inebane
  • Member
  • 11 posts

Posted 14 February 2010 - 11:16 AM

Hello, encountered a IA related error while installing BWP 8.3, so I felt like reporting it! ;-)

Spoiler


So the first idea that comes to my mind is the non-unicode language. Had it set to Polish, not English but after changing the language to English the error remains. Ofc the files required are in the directory. Any ideas?

EDIT: It was the language it seems. After switching to English I started from scratch and everything works fine now! ;]

Edited by Inebane, 14 February 2010 - 04:33 PM.


#19 Miloch

Miloch

    Barbarian

  • Modder
  • 6573 posts

Posted 15 February 2010 - 10:22 PM

EDIT: It was the language it seems. After switching to English I started from scratch and everything works fine now! ;]

I guess Erephine will have to look at this whenever she's back around. I told her this might happen with her approach, because some components expect the originally-named files in order to install properly. So I guess the workaround is to set your codepage to English/Latin as you've done and as described in the readme (I knew there was a reason we wanted to leave that bit in the readme for now).

Infinity Engine Contributions
Aurora * BG1 NPC * BG1 Fixpack * Haiass * Infinity Animations * Level 1 NPCs * P5Tweaks
PnP Free Action * Thrown Hammers * Unique Containers * BG:EE * BGII:EE * IWD:EE
================================================================
Player & Modder Resources
BAM Batcher * Creature Lister * Creature Checker * Creature Fixer * Tutu/BGT Area Map & List * Tutu Mod List
================================================================
"Infinity turns out to be the opposite of what people say it is. It is not 'that which has nothing beyond itself' that is infinite, but 'that which always has something beyond itself'." -Aristotle


#20 Inebane

Inebane
  • Member
  • 11 posts

Posted 16 February 2010 - 02:15 PM

I fail at reading readmes :P Too many mods! :P