Skip to content

Unselecting weapon abilities... or unequipping weapons

chimericchimeric Member Posts: 1,163
I think this deserves a separate topic. I'd like to hear what people have to say about making a weapon harmless and not used, even though it's equipped, or about unequipping it with a reference to a slot rather than a specific Strref. I'm interested in a universal solution, something to make characters not hold their weapons, by hook or by crook. And I'm interested because I'm working on a mechanic that makes characters do something in certain situations if they have a weapon equipped and selected. I've patched weapons with while-equipped spell states to let the engine know just what a character is wielding. But it's important to give players a way to quickly "disable" the weapon if they want to avoid the automated response at a particular time. Turning the whole ability off from the special bar is going to take an action, it's going to take time - mostly because anything counts towards the one spell per round limit, unless the character is constantly under "Aura Cleared." It's quite necessary to have some on-the-go weapons-off mechanic, but, as you know, weapons can't be "unselected" except by going to the inventory to drop them by hand (too bothersome) or by switching to a fist (which forces a character to keep one weapon slot empty, and many classes only have two to begin with). I don't care if the weapons still show, so long as they are not considered held.

I don't know if that's possible. But I've tried running a script on Minsc with a throwing axe. Those axes have two abilities, so probably 0 and 1. I thought that if I told the engine to use a non-existing ability, the weapon might be tucked away somehow. I've seen something like that happen after spells that create magical weapons; after they wear off, none of the character's arms are selected.

SelectWeaponAbility(SLOT_WEAPON0,1) Wait(1) SelectWeaponAbility(SLOT_WEAPON0,1) Wait(1) SelectWeaponAbility(SLOT_WEAPON1,1) Wait(1) SelectWeaponAbility(SLOT_WEAPON2,1) Wait(1) SelectWeaponAbility(SLOT_WEAPON0,2) Wait(1) SelectWeaponAbility(SLOT_WEAPON0,2) Wait(1) SelectWeaponAbility(SLOT_WEAPON1,2) Wait(1) SelectWeaponAbility(SLOT_WEAPON2,2) Wait(1) Attack("sharteel")


This gave me some hope, because no weapon seemed to be selected, but Minsc attacked Shar-Teel for slashing damage, so the axe was there... Now I'm leaning towards creating a blank magical weapon for 1 second, to eclipse what's actually equipped with its spell state, but maybe you know a better way? Also I don't understand why the axe shows in the game as having two abilities, and they can be selected, and the axe somehow reacts to this script, but the edited quarterstaff with an added Melee ability does none of that.

Comments

  • kjeronkjeron Member Posts: 2,367
    Spells and abilities with Ability Target 7 function separately from the Aura Cleansing mechanic. They activate immediately, and have no influence on when the next spell can be cast.
    OR
    SelectWeaponAbility(SLOT_FIST,0)
  • chimericchimeric Member Posts: 1,163
    The second one is only good if they have an empty slot... Right?

    Ability target 7, you mean Caster-no-animation? I use it sometimes... So I can cast those any number of times in a row?
  • kjeronkjeron Member Posts: 2,367
    chimeric said:

    The second one is only good if they have an empty slot... Right?

    No, the Fist slot is separate from quick-weapon slots, it is hidden, but always there.
    One limitation of SelectWeaponAbility() is that it will not work if you have a Magically Created or Cursed weapon equipped, as those cannot be switched out, but I don't think that is an issue given what your trying to accomplish, or at least one that can be worked around.
    chimeric said:

    Ability target 7, you mean Caster-no-animation? I use it sometimes... So I can cast those any number of times in a row?

    Yes, even while the game is paused.
  • chimericchimeric Member Posts: 1,163
    edited September 2017
    kjeron said:

    No, the Fist slot is separate from quick-weapon slots, it is hidden, but always there. One limitation of SelectWeaponAbility() is that it will not work if you have a Magically Created or Cursed weapon equipped, as those cannot be switched out, but I don't think that is an issue given what your trying to accomplish, or at least one that can be worked around.

    So monks don't get that slot at all? Because they have special fists equipped, you know. But for the magical and cursed weapons - not a problem there. Well, if Caster-no-animation ability works instantly, then I don't need a separate button. For most characters it will be switch to the fist or the special bar button. Perfect.

  • kjeronkjeron Member Posts: 2,367
    chimeric said:

    So monks don't get that slot at all?

    All creatures except monks have "FIST.ITM" in their SLOT_FIST.
    Monks have "MFIST1.ITM" through "MFIST8.ITM" in their SLOT_FIST.
    Every empty quick-weapon slot (SLOT_WEAPON0 - SLOT_WEAPON3) defaults to using whatever item is in SLOT_FIST.
  • chimericchimeric Member Posts: 1,163
    Okay, so monks are out of luck. Fists are their main weapon. Well, I can do what I was going to do originally - let them switch TO a weapon instead to avoid the scripted behavior.
Sign In or Register to comment.