Skip to content

#10581 [All] The main screen's Quick Weapon slots should reflect ammo change by script

BelanosBelanos Member Posts: 968
edited November 2014 in IWD:EE Bugs (v1.4.0)
I'm using a script that has my characters automatically switch their ammo slots depending on the enemy they're facing. I'll have one slot for magical ammo for those creatures that are immune to normal weapons, then when the battle is over they'll switch back to normal ammo. While I can see in their inventory screen that they're performing the switches, the HUD slot doesn't show the change. Also if I manually switch their ammo slots, and they switch back to their normal ammo, the GUI is not updated. It will keep on showing the magical ammo I switched them to even though I see in the inventory screen that they're no longer using it. Which makes it a bit of a pain to make sure they're using the type of ammo I want them to.
Post edited by Jalily on

Comments

  • IllydthIllydth Member, Developer Posts: 1,641
    Can you paste the code snipit here in a spoiler tag that you're using to switch ammo? it's likely that the supported script call doesn't perform the graphics updates it's supposed to.
  • BelanosBelanos Member Posts: 968
    edited November 2014
    OK. There's actually two "snippets". This is the one that has them switching to ranged weapons and Ammo Slot 0 after combat is completed:

    [Spoiler]
    IF
    ActionListEmpty()
    CombatCounter(0)
    THEN
    RESPONSE #100
    EquipRanged()
    SelectWeaponAbility(SLOT_AMMO,0)
    Continue()
    END

    [/spoiler]

    This is the one that has them switch to magical ammo if they see an enemy that requires it:

    [Spoiler]
    IF
    !CombatCounter(0)
    !InParty(LastSeenBy(Myself))
    !Range(LastSeenBy(Myself),4)
    Range(LastSeenBy(Myself),8)
    OR(8)
    Race(LastSeenBy(Myself),GOLEM)
    Race(LastSeenBy(Myself),SHADOW)
    Race(LastSeenBy(Myself),IMP)
    Class(LastSeenBy(Myself),WOLF_DIRE)
    Class(LastSeenBy(Myself),WOLF_VAMPIRIC)
    Class(LastSeenBy(Myself),GHOUL_GHAST)
    Class(LastSeenBy(Myself),GHOUL_REVEANT)
    Class(LastSeenBy(Myself),SPIDER_WRAITH)
    THEN
    RESPONSE #100
    RunAwayFrom(NearestEnemyOf(Myself),6)
    EquipRanged()
    SelectWeaponAbility(SLOT_AMMO2,0)
    Continue()
    END
    [/Spoiler]

    Later on comes the bit about attacking the LastSeen enemy. They do seem to be doing what the script tells them to, I've looked inside the inventory screen from time to time, but it's not being shown on the main screen GUI. I'm not sure if this is just an IWD problem, it could very well apply to all the games. I've just become aware of it recently. This is actually a script I was using in the other two games originally BTW, I've just been adapting it to IWD.
  • IllydthIllydth Member, Developer Posts: 1,641
    @Belanos: So just to clarify:

    1) I assume the script is switching between two already slotted arrow types (i.e. you have normal arrows in missile slot 0 and magical missiles in missile slot 1)? Or is it actually replacing (equipping / unequipping) magical ammo and normal ammo from your inventory slots?

    2) In the Inventory screen, after running the script that changes your basic arrows out for magical arrows (for instance) you'll go to your missile slots above your main hand weapon slots and see the magical arrows in one of the three arrow slots and it will be highlighted in Green. But when you close the inventory screen and go back to the main interface, the arrow that shows in the quick weapon slot on your main screen associated with the bow still shows the normal arrow picture? Or is there somewhere else you're looking in the interface to see what kind of arrow you have equipped?

    3) This is a graphical issue only right? The actual arrows that are being fired are either Magical or Non-Magical respectively depending on which script ran, despite what the main interface is showing you? And the RIGHT arrows are decreasing in amount in your inventory when they fire correct? (i.e. Even if it's showing you non-magical arrows, when you fire your bow the count of magic arrows is decreasing as it should be?)

    Just trying to figure out what exactly is not showing up correctly.
  • BelanosBelanos Member Posts: 968
    Illydth said:



    1) I assume the script is switching between two already slotted arrow types (i.e. you have normal arrows in missile slot 0 and magical missiles in missile slot 1)?

    Correct.
    Illydth said:

    2) In the Inventory screen, after running the script that changes your basic arrows out for magical arrows (for instance) you'll go to your missile slots above your main hand weapon slots and see the magical arrows in one of the three arrow slots and it will be highlighted in Green. But when you close the inventory screen and go back to the main interface, the arrow that shows in the quick weapon slot on your main screen associated with the bow still shows the normal arrow picture?

    Again correct.
    Illydth said:

    3) This is a graphical issue only right? The actual arrows that are being fired are either Magical or Non-Magical respectively depending on which script ran, despite what the main interface is showing you? And the RIGHT arrows are decreasing in amount in your inventory when they fire correct? (i.e. Even if it's showing you non-magical arrows, when you fire your bow the count of magic arrows is decreasing as it should be?)

    Also correct. The script is apparently working as it should, though I did have something of an issue with my Bard not using Fire Arrows against a Troll when it was down to 1 HP. That could have been something I did wrong in the script though. But on the main screen GUI, the graphic slot for the arrows being used is not updating. It will only show what I select manually and won't change along with the script usage. It is a rather minor issue I admit, but it makes it a bit of a pain to keep tabs on my characters to make sure they're doing the right thing. I have to open up their inventory window to make sure they're using the right type of ammo, which kind of defeats the purpose of trying to make the change in the script.

  • IllydthIllydth Member, Developer Posts: 1,641
    Yep, I completely agree. At this point I'm out of my league as this one's likely to be burred in the code somewhere.

    Thanks for the help! Please keep an eye on the thread every day or two in case one of the Devs has more questions.
  • Avenger_teambgAvenger_teambg Member, Developer Posts: 5,862
    Does quicksave/reload fix the apparent GUI glitch? If it does, then it is indeed a GUI glitch.
  • BelanosBelanos Member Posts: 968

    Does quicksave/reload fix the apparent GUI glitch? If it does, then it is indeed a GUI glitch.

    No it doesn't, it never updates on it's own. It will remain fixed at whatever ammo slot I've manually selected. I can't be entirely sure but I believe this is happening with all the games, not just IWD.

Sign In or Register to comment.