Skip to content

Polymorph limitations

seraglioseraglio Member Posts: 122
I've been playing around with polymorphs(opcode135) recently and noticed that the head slot is not used when a player polymorphs. Chest slot seems to be retained. Also noticed that only STR and DEX (not CON), come from the .cre file. Anyone have a complete list of how polymorphs work? For instance do resistances from the Cre set or increment existing resistances?

Comments

  • _Luke__Luke_ Member, Mobile Tester Posts: 1,535
    @kjeron

    Could you shed some light? Thanks :)
  • kjeronkjeron Member Posts: 2,367
    Polymorph "sets" Strength, Dexterity, Resistances (excluding Poison and Magic Damage), Base AC, Specific AC (Crush/Slash/Pierce/Missile), and Base APR. IIIRC Constitution was removed because of issues that could not otherwise be fixed.
    However, it stacks in the same manner as (most) other effects. Any effect that "increments" will not conflict with Polymorphing, aside from those that permanently affect the base stat (Manual of Gainful Exercise).

    Effects that "Set" values from Abilities override equipped effects that "Set" those values (for almost every opcode*). In BGEE/SOD, the Polymorph effect is applied by the spell, while in BG2EE it is applied by the item(weapon). Effects of each type (Equipped/Ability) stack in the order they were applied, with the most recent having priority.

    When the polymorph comes from an equipped effect, the Item Slot of other effects matters only in regards to loading the game - as all equipped items are re-equipped in a set order when the game is loaded.

    When the polymorph comes from an ability, any abilities used prior to polymorphing that set those stats will be overridden by the polymorph, while abilities used after the polymorphing will override the polymorph stats. A polymorph from an ability will always override any stats set by equipped effects.

    *Op0 (Modify AC) has a "Set Base AC" mode that always uses the "Best" value from all effects. The Base AC set by polymorph does not have this behavior.
    *Op1 (Modify APR) has a "Set Final" mode that can override any other source (excluding haste/slow AFAIK).
    *Op129/130/131/132/133/137 (Aid, Bless, Chant, DUHM, Luck, Bad Chant) stack in reverse order (equipped effects will override abilties, both are overridden by the base states).
    semiticgoddess_Luke_lolien
  • _Luke__Luke_ Member, Mobile Tester Posts: 1,535
    @kjeron

    Is this "In BGEE/SOD, the Polymorph effect is applied by the spell, while in BG2EE it is applied by the item(weapon)" somewhat relevant?
  • kjeronkjeron Member Posts: 2,367
    Luke93 wrote: »
    @kjeron

    Is this "In BGEE/SOD, the Polymorph effect is applied by the spell, while in BG2EE it is applied by the item(weapon)" somewhat relevant?
    Yes.
    In BGEE/SOD, spells that set stats will only override the stats set by polymorph if cast after the polymorph, while items will never override them.
    In BG2EE, spells will always override the stats set by polymorph, while items that set stats will only override them if equipped after the polymorph.
    _Luke_lolien
  • _Luke__Luke_ Member, Mobile Tester Posts: 1,535
    edited May 2019
    @kjeron

    Moreover, can you confirm that in order to "fix" this issue => https://support.baldursgate.com/issues/20603, you need to delete the existing opcode #135 and use opcode #53 as an equipped effect on the creature weapon or opcode #135 (param #2 = 1) as an equipped effect on the creature weapon + adding resistances (opcodes #89, #88, #87, #29 and so forth) as equipped effects on the creature weapon (if any)?
  • The user and all related content has been deleted.
    semiticgoddessOlvynChuru_Luke_
  • _Luke__Luke_ Member, Mobile Tester Posts: 1,535
    That said, summoning a magical claw weapon and applying all "polymorph" effects to the weapon (including opcode 53 for the animation change) does seem markedly superior, and it's what I do with all of my shapechanging spells and abilities these days.

    Yeah, you're right, it feels more customizable..... Moreover, I was thinking of blocking access to the Inventory screen (op#144, param#2 = 15). I mean, you should not be able to adjust your equipment while polymorphed into a slime :D
  • _Luke__Luke_ Member, Mobile Tester Posts: 1,535
    @kjeron

    According to NearInfinity, opcode #135 has three 'Appearance only' modes (param#2 = 1, param#2 = 2, param#2 = 3). I assume they're all equivalent, right?
  • kjeronkjeron Member Posts: 2,367
    edited June 2019
    That's my assumption - it's parameter2 has only two meaningful values: zero and non-zero.
  • BubbBubb Member Posts: 998
    Note that when the resref is empty in Opcode #135, and it subsequently clears other Polymorph Effects, Param2 is used just like Param1 of Opcode #337.

    Which is to say that it will clear all Polymorph effects if Param2 = -1, else it will only clear Polymorph effects that have a Param2 that matches.
    kjeron
  • kjeronkjeron Member Posts: 2,367
    edited June 2019
    Bubb wrote: »
    Note that when the resref is empty in Opcode #135, and it subsequently clears other Polymorph Effects, Param2 is used just like Param1 of Opcode #337.
    Interesting...
    @Luke93 Human/Natural form abilities end polymorph effects with param2=0, so they will not remove animation-only polymorphs (unless the effects are on the weapon, which would be removed), which is intended, so that it will not remove effects such as the Drow Transformation spell that is cast on the party in BG2EE.

    Another interesting issue - the creature you're polymorphing into cannot have STATE_SLEEPING, STATE_FROZEN_DEATH, STATE_STONE_DEATH, STATE_FLAME_DEATH, or STATE_DEAD set in it's CRE file, or the game will crash. Seems to be two common factors - states that color the creature's animation (FROZEN,STONE,FLAME) and states that already crash if forced to take actions not listed in ACTSLEEP.IDS (SLEEPING, DEAD).
    Post edited by kjeron on
  • _Luke__Luke_ Member, Mobile Tester Posts: 1,535
    kjeron wrote: »
    Bubb wrote: »
    Note that when the resref is empty in Opcode #135, and it subsequently clears other Polymorph Effects, param#2 is used just like param#1 of Opcode #337.
    Interesting...
    @Luke93 Human/Natural form abilities end polymorph effects with param#2=0...

    So, are you saying they're currently removing all polymorph effects that have param#2 = 0? And all the other polymorph effects are instead removed by opcode #112 (Remove item)?
  • kjeronkjeron Member Posts: 2,367
    edited June 2019
    The Human/Natural form abilities do both - apply op135 with an empty resource, and remove the item in the Magical Weapon slot. It really depends on how the polymorph abilities are setup.
    In BGEE, the Polymorph is in the spell, removing the weapon doesn't remove the polymorph effect, and removing the effect doesn't remove the weapon, so both are needed.
    In BG2EE, the Polymorph is on the weapon, removing the effect is only temporary - it will be reapplied if you save and reload, as all items gets re-equipped on load. Removing the weapon will remove both the weapon and the effect.
  • _Luke__Luke_ Member, Mobile Tester Posts: 1,535
    edited January 2020
    kjeron wrote: »
    In BG2EE, the Polymorph is on the weapon, removing the effect is only temporary - it will be reapplied if you save and reload, as all items gets re-equipped on load. Removing the weapon will remove both the weapon and the effect.

    Guess the same holds if I use op#53 instead of op#135 (p2=0), doesn't it?

    A related question: multiple applications of opcode #111 (Create weapon) automatically remove whatever ITM is in the Magical Weapon slot (if any!) before creating the ITM specified by the resource field, right? If that's the case, then only the 'Return to Human Form' SPL needs opcode #112 (Remove item), correct?
  • kjeronkjeron Member Posts: 2,367
    Luke93 wrote: »
    Guess the same holds if I use op#53 instead of op#135 (p2=0), doesn't it?
    Yes, it would do even less towards removing it.
    Luke93 wrote: »
    A related question: multiple applications of opcode #111 (Create weapon) automatically remove whatever ITM is in the Magical Weapon slot (if any!) before creating the ITM specified by the resource field, right? If that's the case, then only the 'Return to Human Form' SPL needs opcode #112 (Remove item), correct?
    Correct - there is no reason for a polymorph ability to use op112, not that it would have any way of knowing what item to remove in the first place.

    The "Return to Human Form" ability still needs both (op111 then op112), so that it "knows" which item it is removing. You can't drop op112 and just use op111 with an empty resource field, as doing so is prone to crashing (not consistently, but it happens).
  • _Luke__Luke_ Member, Mobile Tester Posts: 1,535
    edited January 2020
    kjeron wrote: »
    The "Return to Human Form" ability still needs both (op111 then op112), so that it "knows" which item it is removing...

    That implies creating a "Return to Human Form" ability per opcode #111... It's not ideal with something like WIZARD_POLYMORPH_SELF that grants several forms... In such cases it's probably better to code a single "Return to Human Form" ability which collects all the necessary op#112...

    And what about SPIN160.spl (SALAMANDER_BREATHE_FIREBALL) and the like? If I create an item that lets you shapeshift into something, then I should remember to apply op#172 referencing those SPLs... But I cannot know how many there are in the game :( (if you also take into accounts other mods...)
  • The user and all related content has been deleted.
  • kjeronkjeron Member Posts: 2,367
    edited January 2020
    Luke93 wrote: »
    That implies creating a "Return to Human Form" ability per opcode #111... It's not ideal with something like WIZARD_POLYMORPH_SELF that grants several forms... In such cases it's probably better to code a single "Return to Human Form" ability which collects all the necessary op#112...
    There's no need to account for multiple op112 effects, the following will remove whatever is in the slot:
    ->op111: WOLFM
    ->op112: WOLFM
    
    The game is a complete mess about organizing polymorph abilities.
    Luke93 wrote: »
    And what about SPIN160.spl (SALAMANDER_BREATHE_FIREBALL) and the like? If I create an item that lets you shapeshift into something, then I should remember to apply op#172 referencing those SPLs... But I cannot know how many there are in the game :( (if you also take into accounts other mods...)
    There is no way to know, so IMO they shouldn't exist, not even the Breath Fireball ability. That there are 3x op172 effects to remove it shows those designing the abilities didn't even know what they were doing (1x would suffice).

    This would mostly be irrelevant if the Magical Weapon slot would allow Item Abilities, or if op171 could function temporarily "While Equipped".
  • _Luke__Luke_ Member, Mobile Tester Posts: 1,535
    edited January 2020
    kjeron wrote: »
    Luke93 wrote: »
    That implies creating a "Return to Human Form" ability per opcode #111... It's not ideal with something like WIZARD_POLYMORPH_SELF that grants several forms... In such cases it's probably better to code a single "Return to Human Form" ability which collects all the necessary op#112...
    There's no need to account for multiple op112 effects, the following will remove whatever is in the slot:
    ->op111: WOLFM
    ->op112: WOLFM
    
    The game is a complete mess about organizing polymorph abilities.
    Oh, I see, you're talking about a dummy / placeholder ITM, aren't you? So every ITM (e.g., SW1H01 – Bastard Sword) is fine provided it exists in the game? And that also implies that there's no need to have multiple "Return to Human Form" abilities, right?

    @subtledoctor

    What you're suggesting is not enough. As kjeron said, you should also patch every other polymorph ability in the game so as to remove whatever you're adding via opcode #171, and there's no (easy?) way to know what items/spells grant polymorph abilities...
  • kjeronkjeron Member Posts: 2,367
    Luke93 wrote: »
    Oh, I see, you're talking about a dummy / placeholder ITM, aren't you? So every ITM (e.g., SW1H01 – Bastard Sword) is fine provided it exists in the game?
    Yes.
    Luke93 wrote: »
    And that also implies that there's no need to have multiple "Return to Human Form" abilities, right?
    Ideally yes. If every polymorph just granted the same "Natural Form" ability, it would be far simpler.

    Another altnerative would be to abandon granting the "Natural Form" ability, and add an item ability to "FIST.ITM" (and any Monk fists) to cast it. This way it would always be available, and hostile polymorphs could disable the "Use Item" button to block it's use.
  • [Deleted User][Deleted User] Posts: 0
    edited January 2020
    The user and all related content has been deleted.
  • _Luke__Luke_ Member, Mobile Tester Posts: 1,535
    ... and for good measure, can use opcode 337 to remove any opcode 53 effects...
    I wouldn't do that, you risk to remove the Drow Transformation Adalon casts at the party in BG2 (if I recall correctly, it makes use of opcode #53...). If you use opcode #53 for your shapeshifting abilities, then opcode #112 should be enough when it comes to removing them (no need to use op#135 with empty resource either...)
    I suppose you're worried about a druid/mage casting Polymorph Self and then using an innate druid shapeshift without first going back to natural form... if my polymorph form had an innate ability, I will retain it in my druid animal form...
    Yes, that's exactly what I'd like to avoid.

    Option #1 and #3 are definitely the best options here, but:
    1. opcode #135 isn't (currently!) working as the Spell Deflection opcode
    2. as @kjeron said, magically created items do not support Item Abilities (header_type = 3)... And opcode #171 do not function temporarily "While Equipped" (timing = 2) :( .
  • _Luke__Luke_ Member, Mobile Tester Posts: 1,535
    edited January 2020
    kjeron wrote: »
    There is no way to know, so IMO they shouldn't exist, not even the Breath Fireball ability. That there are 3x op172 effects to remove it shows those designing the abilities didn't even know what they were doing (1x would suffice).

    Sorry to bother you again, but the same holds for the 'Return to Natural Form' abilities, right? That is, you need to take into account all of them and apply op#172 referencing them whenever you shapeshift into something / return to your original form or your 'Innate Abilities' menu will be filled with 'Return to Natural Form' abilities, correct? For instance, cast WIZARD_POLYMORPH_SELF, shapeshift into a Flind and then activate 'CLCK04.itm' (Relair's Mistake).... Of course, this issue is due to the fact that there are many 'Return to Natural Form' abilities in the game....
  • [Deleted User][Deleted User] Posts: 0
    edited January 2020
    The user and all related content has been deleted.
  • kjeronkjeron Member Posts: 2,367
    @subtledoctor - I referred to the "Magical Weapon Slot" (SLOT_MISC19 - #34), which does not respect item abilities no matter which opcode creates the item. op111 always creates items in this slot, op143 can create items in this slot just like any other slot (but still won't "equip" it just like the other weapon slots).

Sign In or Register to comment.