Skip to content

Any way to tweak the ammo selection on Nearinfinity?

Earnest_ernestEarnest_ernest Member Posts: 40
edited March 2017 in General Modding
I want to make a script that allows to change the ammo type (in the quiver) when facing different enemies. Lets say that you want the Ranger to automatically use Normal Arrows for normal enemies, whereas if he faces a Shadow to switch to an arrow type that affects magical beings (fire arrow, arrow +1 or +2)

Any way to do it on NI?

UPDATE: found an insightful post that partially deals with it or shows some code to do so:

https://forums.beamdog.com/discussion/comment/575426#Comment_575426

Comments

  • sarevok57sarevok57 Member Posts: 6,002
    if you already have the arrows in your quiver, then im going to say yes you could as this line of code here dictates:

    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

    that line of code is for switching arrows if you ranged character sees one of those races/classes, and then if you wanted to go back to normal arrows for bad guys who don't need magical ammunition you could make another script like this, and just change races/classes to enemies who can be hit by normal ammunition and then have them change their arrow slot to normal arrows ( whatever slot you want to dedicate that to)
  • Earnest_ernestEarnest_ernest Member Posts: 40
    sarevok57 said:

    if you already have the arrows in your quiver, then im going to say yes you could as this line of code here dictates:

    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

    that line of code is for switching arrows if you ranged character sees one of those races/classes, and then if you wanted to go back to normal arrows for bad guys who don't need magical ammunition you could make another script like this, and just change races/classes to enemies who can be hit by normal ammunition and then have them change their arrow slot to normal arrows ( whatever slot you want to dedicate that to)

    Exactly! I wasn't aware that ammo selection counted as a weapon ability: SelectWeaponAbility
    I have now everything I need Thanks!
Sign In or Register to comment.