nwnxee / unified

Binaries available under the Releases tab on Github
https://nwnxee.github.io/unified
GNU General Public License v3.0
131 stars 92 forks source link

Bug: NWNX_Creature_SetSpecialAbility #114

Closed Morderon closed 5 years ago

Morderon commented 6 years ago

Fails to do anything, most notable return the index/spell to a ready state.

mtijanic commented 6 years ago

Thanks Mord! Do you have something handy that I can test with?

Morderon commented 6 years ago
#include "nwnx_creature"
void ChangeSpell(object oPC, int nSpellId, int bIsReady=TRUE)
{
    int nIndex = 0;
    SendMessageToPC(GetFirstPC(), "Index:" + IntToString(nIndex) + "Ready" + IntToString(bIsReady));
    struct NWNX_Creature_SpecialAbility spell = NWNX_Creature_GetSpecialAbility(oPC, nIndex);

    SendMessageToPC(GetFirstPC(), "Id:" + IntToString(spell.id) + "Ready" + IntToString(spell.ready) + "Level" + IntToString(spell.level));
    spell.ready = bIsReady;
    spell.id = SPELL_MELFS_ACID_ARROW;
    spell.level=3;
    NWNX_Creature_SetSpecialAbility(oPC, nIndex, spell);

    spell = NWNX_Creature_GetSpecialAbility(oPC, nIndex);

    SendMessageToPC(GetFirstPC(), "Id:" + IntToString(spell.id) + "Ready" + IntToString(spell.ready) + "Level" + IntToString(spell.level));
}

void main()
{
    struct NWNX_Creature_SpecialAbility spell;

    spell.id = SPELL_MAGE_ARMOR;
    spell.level = 2;
    spell.ready = TRUE;

    NWNX_Creature_AddSpecialAbility(GetFirstPC(), spell);
    ChangeSpell(GetFirstPC(), SPELL_MAGE_ARMOR);
}

Here you are, returns mage armor before and after the the special ability should be changed and can confirm it didn't change through the gui.

Should work from any event.

Daztek commented 5 years ago

I can't repro this, everything seems to be working as intended.

mtijanic commented 5 years ago

Likewise. Closing.

Morderon commented 5 years ago

Oh yeah sorry i fixed it a while ago. I just didn't close it out.

On Mon, Jan 21, 2019 at 6:20 AM Milos Tijanic notifications@github.com wrote:

Likewise. Closing.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/nwnxee/unified/issues/114#issuecomment-456039818, or mute the thread https://github.com/notifications/unsubscribe-auth/AQqgHLbAXEa1o5tkbdpV3op-tzJT1qU1ks5vFaKNgaJpZM4TFUaC .

Morderon commented 5 years ago

And if your curious what it was it was alright on the nwnx side.

The nwscript just wasn't pushing all the required arguments.

On Mon, Jan 21, 2019 at 9:30 PM Will Will will386@gmail.com wrote:

Oh yeah sorry i fixed it a while ago. I just didn't close it out.

On Mon, Jan 21, 2019 at 6:20 AM Milos Tijanic notifications@github.com wrote:

Likewise. Closing.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/nwnxee/unified/issues/114#issuecomment-456039818, or mute the thread https://github.com/notifications/unsubscribe-auth/AQqgHLbAXEa1o5tkbdpV3op-tzJT1qU1ks5vFaKNgaJpZM4TFUaC .