0 of 0

File information

Last updated

Original upload

Created by

HackyModProductions

Uploaded by

elchurro2

Virus scan

Safe to use

Tags for this mod

19 comments

  1. Qwinntex
    Qwinntex
    • premium
    • 6 kudos
    Came across this mod since it was incorporated into the unofficial modder's patch.  Was looking at the arrow switching code and it looks very brute force.  Also, updating in the case of added items to the list becomes tedious....

    Optional (slightly changing order, true) could be :

    function arrows()
    bool bDone = false;
    ; Next closest arrows, one index away
    ?int iAdjacentIndex = 1
    ; Original arrow type
    ?int findex = fIndexOriginal
    ; Continue until we find something
    while bDone != true
    ??; if there's a valid arrow type up at the next tier
    if findex + iAdjacentIndex <= nMaxIndex
    ; get the arrows of that type
    nextammo = SAArrowlist.getat(findex + iAdjacentIndex)
    ; if there's any of those arrows in our inventory
    if PlayerRef.GetItemCount(nextammo) > 0
    ; equip them
    PlayerRef.EquipItem(nextammo, false, true)
    ; we've equipped a new arrow type, so we're done
    bDone = true
    endif
    endif
    ; if there's a valid arrow type down at the next tier, and we're not already done
    if findex - iAdjacentIndex >=0 && bDone = false
    ;get the arrows of that type
    nextammo = SAArrowlist.getat(findex - iAdjacentIndex)
    ; if there's any of those arrows in our inventory
    if PlayerRef.GetItemCount(nextammo) > 0
    ; equip them
    PlayerRef.EquipItem(nextammo, false, true)
    ; we've equipped a new arrow type, so we're done
    bDone = true
    endif
    endif
    ??;Check next closest slots
    ??iAdjacentIndex += 1
    ??; Did we run out of options?
    if findex + iAdjacentIndex > nMaxIndex && findex - iAdjacentIndex < 0
    bDone = true
    endif
    endWhile
    endFunction


    In the case of adjusting the number of items in the list, you only need to change nMaxIndex... which you could even have filled in at runtime, if I understand Papyrus correctly.

    easier to read through (imo), but admittedly does slightly alter the choice of arrow that will be used next (going up one, then down one, up two, down two,  vs down 1-3, up 1, down 4,5, up 2.. etc.)

    I personally hate return calls mid function (C++ training showing) and honestly my first read through I didn't even notice them, so I thought the original was going to have a very different end result than it does.

    I don't have a lot of experience in Papyrus, so I may have typos, syntax errors, or other imperfect usages, but if you also find this version to be cleaner, feel free to use it.  (definitely some copy - paste issues that added question marks in weird spots that I can't manage to edit out of the post.)

    At a minimum it fits on one page this way more similar to the bolts, so it should be easier to debug or update.
  2. ShawnDriscoll
    ShawnDriscoll
    • member
    • 86 kudos
    I get the message Unable to unequip item when trying to unequip the arrows it auto-selected for me. I guess this is the normal operation?
    1. elchurro2
      elchurro2
      • member
      • 3 kudos
      No, this is not normal. I have never had this problem. How are you trying to unequip, simply in the inventory?
    2. elchurro2
      elchurro2
      • member
      • 3 kudos
      I uploaded a new version of the mod with a changed parameter in the EquipItem function. Maybe that fixes your issue.
    3. ShawnDriscoll
      ShawnDriscoll
      • member
      • 86 kudos
      I'm just using the regular weapon inventory menu to select arrows to equip/unequip. No favorite hot keys or anything. I will give the update a try.
    4. ShawnDriscoll
      ShawnDriscoll
      • member
      • 86 kudos
      The new version doesn't have the problem I was having. Thanks!
    5. elchurro2
      elchurro2
      • member
      • 3 kudos
      great to hear! thanks again for your feedback
  3. mrjonte
    mrjonte
    • supporter
    • 2 kudos
    What changed in the new version?
    1. elchurro2
      elchurro2
      • member
      • 3 kudos
      see the post by ShawnDriscoll.
      i suppose you don't need to update if you are having no problems.
  4. kalipou
    kalipou
    • premium
    • 12 kudos
    Is the script on at all times or does it only activate when equipped arrows are 0?
    1. elchurro2
      elchurro2
      • member
      • 3 kudos
      The function is started when a type of arrow is at 0.
    2. kalipou
      kalipou
      • premium
      • 12 kudos
      Was concerned about script load since I already run a bunch of combat mods
      Thanks for the quick response :)

      New question, can it be ESL flagged safely? If the scripts use GetFormIDs it would most likely break the links after compacting/renumbering
    3. elchurro2
      elchurro2
      • member
      • 3 kudos
      I have no idea, as I have never looked into that issue. I run on 60 mods at the moment
    4. Verayth
      Verayth
      • premium
      • 13 kudos
      I tested it works for me after compacting it with xEdit and ESL flagging with WryeBash.  I only tried stalhrim and glass, and it swapped the iron out for ebony and glass respectively as the next lowest I had.

      I have 389 mods so far, so ESL is an essential feature for me.
  5. VulcanTourist
    VulcanTourist
    • supporter
    • 19 kudos
    My personal frustration is attaining ethereal arrows but then having the stupid game randomly revert to whatever physical arrows I might happen to have collected. Argh!
  6. RainstormWander
    RainstormWander
    • premium
    • 66 kudos
    Ahh amazing, thank you.
  7. sattyre
    sattyre
    • premium
    • 256 kudos
    fixes a very annoying issue thanks
  8. vegaswanderer
    vegaswanderer
    • supporter
    • 123 kudos
    Fantastic idea. Thank you!
    1. elchurro2
      elchurro2
      • member
      • 3 kudos
      You're welcome!