Skip to content

How to make an EFF file?

AndreaColomboAndreaColombo Member Posts: 5,524
If I wanted to create an EFF file, which tool would I use to that end?

Tangentially, can an EFF file change the armor level code of an item?

Specifically, I would like to create an EFF file that checks whether the wearer of a robe is a Mage. If it is, then the armor code of the robe should be changed from xW to xV. If it isn't, the armor code should be set to xW. Is that something that EFF files can do?

Comments

  • chimericchimeric Member Posts: 1,163
    EFF files can only do what regular effects (opcodes) do. Check out the Gibberlings 3 guide for them. But what you want to do is impossible, there are no checks for appearance of armor or effects that change it.
    AndreaColombo
  • kjeronkjeron Member Posts: 2,367
    The best they could do is alter the characters animation while equipped, but the armor code still runs off the characters base animation. So long as you are using the mage animations (6200s), there is no good solution, as they are still hardcoded.
    All animation slots in the 6200 range only respond to #W animation codes.
    All other animation slots do not respond to #W animation codes.

    It does work if you make the animation change permanent(and therefor change their base animation) every time they equip a new piece of armor, but then you can be left with incorrect animations when unarmored.
    As of v2.0 there are already EFF files present in the game to do this:
    [ FC_(RACE), FF_(RACE), FM_(RACE), FT_(RACE), MC_(RACE), MF_(RACE), MM_(RACE), MT_(RACE) ](.EFF)

    Another option is to expand the other 3 classes with the mage animations, and duplicate the mage animation in another slot range so it can use the same armor codes. Requires duplicating & renaming a lot of animation files.
    Each of the Fighter/Cleric/Thief animations would look like this:
    1A : Fighter/Cleric/Thief Unarmored
    2A : Fighter/Cleric/Thief tier 1
    3A : Fighter/Cleric/Thief tier 2
    4A : Fighter/Cleric/Thief tier 3
    5A : Mage tier 1
    6A : Mage tier 2
    7A : Mage tier 3

    The Mage animation would look the same, just pick whichever Fighter/Cleric/Thief Armored animations you want:
    1A : Mage Unarmored
    2A : Armored tier 1
    3A : Armored tier 2
    4A : Armored tier 3
    5A : Mage tier 1
    6A : Mage tier 2
    7A : Mage tier 3
    AndreaColombo
  • AndreaColomboAndreaColombo Member Posts: 5,524
    edited October 2017
    I'll explain my conundrum in a bit more detail to provide some additional information on what I'm trying to achieve.

    As you rightfully mentioned, only animations in the 6200 range respond to W animation codes. The reason is that only mages are supposed to change their appearance (armor level) when equipping robes, whereas multi- and dual-classed combinations that can wear robes but do not use the Mage animation should remain unaltered.

    This becomes an issue when BG1 sprites are restored, as is the case with a component of my mod. As BG1 sprites must be in 5000-series slots, they do not respond to W animation codes.

    Changing robes' animation codes from W to V works, but has the unfortunate side effect of making robes look like armors on any multi- or dual-classed character that could wear them.

    @erephine and @Galactygon were gracious enough to allow me to incorporate their avatar-switching code into my mod, which is the solution I am currently adopting. However, affecting all armors for all classes seems like an overkill solution for the Mage problem. Additionally, it undermines my Flaming Fist component as most SoD Flaming Fist members have their class set to Fighter, but I need them to look like Clerics.

    My options at this stage seem to be:
    • keep the current solution (with the avatar-switching code as an option)
    • adopt a robe-only version of the avatar-switching code (with the side effect that once changed to Mage, the avatar cannot be changed back through means other than EE Keeper)
    • have robes switch between V and W depending on the wearer's class (which would be the best solution, if feasible.)
    If there is no way to achieve the latter (through an EFF or any other means), I shall probably keep my current solution and code the robe-only variant for personal use.
  • kjeronkjeron Member Posts: 2,367
    There is no way to alter an item's animation code in-game, only the creatures animation.

    My second suggestion(expanding animations to 7 item codes) can likely get you the results you want.

    Another option is to duplicate the item so you have one with each item code, and replace it depending on who wears it, but then your left either having it always identified, or requiring identification every time it is replaced.

    As BG1 sprites must be in 5000-series slots, they do not respond to W animation codes.

    This doesn't match up with my results:
    They work in the 5400, 5600-5F00, 6400, & 6600-6F00 series.
    They do not work in the 5000-5300, 5500, 6000-6300, or 6500 series.
    AndreaColombo
  • AndreaColomboAndreaColombo Member Posts: 5,524
    Out of curiosity, how did you check for what slots could take BG1 sprites?

    I assumed they could only work in the 5000-series as that's the original BG1 series, to the best of my memory.

    Currently I'm using the 56xx series. There's a chance the slots where my Mage animations are can already respond to A animations (they actually respond to V, so I see no reason why they wouldn't respond to A.) In that case, if I changed the Mage animation INI to go all the way up to armor level 7 and changed robes to be 5A, 6A, and 7A as you suggest, Mages should display robes whereas all other characters wearing them should remain unaltered.

    I'll give this a spin.
  • kjeronkjeron Member Posts: 2,367

    Out of curiosity, how did you check for what slots could take BG1 sprites?
    I assumed they could only work in the 5000-series as that's the original BG1 series, to the best of my memory.

    Manually tried various slots.
    BG1 actually used the same slots as BG2 (6000 series).
    The entire 6000 block started as BG1-style, then BG2 changed 6000, 6100, 6200, 6300, and 6500 to only work with the new BG2 animations.
    6400 is still used for old BG1 NPCs (Drizzt, Elminster, Volo) that did not receive new animations in BG2.
    6600-6F00 are still running on default (BG1).
    The 5000 block mirrors the 6000 block in functionality.


    Currently I'm using the 56xx series. There's a chance the slots where my Mage animations are can already respond to A animations (they actually respond to V, so I see no reason why they wouldn't respond to A.) In that case, if I changed the Mage animation INI to go all the way up to armor level 7 and changed robes to be 5A, 6A, and 7A as you suggest, Mages should display robes whereas all other characters wearing them should remain unaltered.

    The specific letter doesn't matter beyond whether it's 'W' or 'not W', it's not even specified anywhere, the preceding number determines everything else.

    Expanding the Mage as such should result in the same behavior as the default animations:
    Mages wearing armor use their default, others wearing robes use their default.
    Mages wearing robes appear robed, others wearing armor appear armored.


    If you want Mages wearing armor to appear armored, or others wearing robes to appear robed, you would need to expand all classes INI to 7, then make renamed duplicates of the mage animations to fill the other classes 5-7 slots, and replace the mages 2-4 slots with the armored animation of another class.
    AndreaColombo
  • AndreaColomboAndreaColombo Member Posts: 5,524
    edited October 2017
    Thank you, @kjeron.

    Same behavior as the default animations is indeed what I seek. From my initial experiment, this seems to work like a charm. I only need to rename the Mage paperdolls as well and I should be golden. I'm very happy with this :) thanks again a lot for your input!
  • CamDawgCamDawg Member, Developer Posts: 3,438
    It was discontinued in the Anthology, but check out Galactygon's Change Avatar When Wearing Robes or Armor component in BG2 Tweaks. It basically attaches a series of EFFs to robes and armor, and adjusts the character's appearance accordingly--it's a hack, but seems to be exactly what you're trying to accomplish.
    AndreaColombo
  • GalactygonGalactygon Member, Developer Posts: 412
    I rather like @kjeron 's approach since you would avoid permanently changing the .cre animation.
    AndreaColombo
  • AndreaColomboAndreaColombo Member Posts: 5,524
    Indeed, that’s what I went with. It’s pretty sleek :)
Sign In or Register to comment.