Skip to content

A couple of 1.69 bugs

Recently found a couple of bugs in 1.69 that you may want to check don't exist in EE. (and hopefully aren't just due to user error on my part)

1:
Had this code in a custom AI script and it started crashing the game after moving the server to Linux.
(To clarify its purpose: this is used to unsure that a nasty boss targets the centre of a group of players for maximum effect.)
int i = 1; object oEnemy = GetNearestEnemy(oSource, i); vector vTarget = Vector(); if (!GetIsObjectValid(oEnemy)) return OBJECT_SELF; while (GetIsObjectValid(oEnemy)) { vTarget += GetPosition(oEnemy); i++; oEnemy = GetNearestEnemy(oSource, i); } vTarget = Vector(GetChangeInX(VectorMagnitude(vTarget), VectorToAngle(vTarget))/(i-1), GetChangeInY(VectorMagnitude(vTarget), VectorToAngle(vTarget))/(i-1), 0.0); return GetNearestCreatureToLocation(CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY, Location(GetArea(oSource), vTarget, 0.0), 1);
Debugging found the source of the issue was GetNearestCreatureToLocation(). Ended up writing my own code to do the same action, but an inbuilt function that crashes the game is not a good thing.

2:
I added this line to the modules on unequip event to tidy things up should multiple hide slot items get created on a player. Instead this would cause the item in the slot to get deleted at random times or when other items were swapped.
// Destroy rogue pchides if (GetTag(oItem) == "pchide" && oItem != GetItemInSlot(INVENTORY_SLOT_CARMOUR)) DestroyObject(oItem);

Bonus extra bugs:
Extra damage from EffectDamageIncrease() currently bypasses resistance/vulnerability and even the invulnerability flag.

The x0_i0_walkway calls WalkWaypoints() from inside WalkWaypoints() (line 420). Other than this being an infinite loop, the default npc's on Heartbeat script nw_c2_default1 also calls WalkWayPoints(). This will quickly slow down any server with waypointing npcs and cause some rather irregular patrol routes.

Comments

  • TheKrit already addressed the problems with extra skins in this package: https://neverwintervault.org/project/nwn1/hakpak/remove-pc-properties

    Not sure about the extra damage bypass as I can't seem to replicate it. How did you determine this?

    x0_i0-walkway - the call to WalkWaypoints() at line 420 was added specifically to allow the patrol route to be walked again once completed (see the side note dated February 14, 2003). I ran a test with this line blocked out and the monster walked the route once then stood at the last waypoint on the route.
  • HousePetHousePet Member Posts: 12
    Extra damage bypass was determined by having an NPC boss set to invulnerable (until a player did a certain action). Divine Might/Favor damage was still able to hurt the boss.
    Also, I made a class which was based around the ability to add elemental damage to weapon attacks using the same effect. As part of the class was selecting what element to use, it was quickly determined that it didn't matter, as it ignored resistance, immunity and invulnerability.

    As for the WalkWayPoints(), a run of the profiling plugin on my server showed a major overflow coming from nw_c2_default1 and npcs had been seen walking rather erratically after the server had been up for a while. Commenting out line 420 reduced the server load and did not cause NPCs to stop following waypoints for us.
  • tfoxtfox Member Posts: 87
    HousePet said:

    Extra damage bypass was determined by having an NPC boss set to invulnerable (until a player did a certain action). Divine Might/Favor damage was still able to hurt the boss.
    Also, I made a class which was based around the ability to add elemental damage to weapon attacks using the same effect. As part of the class was selecting what element to use, it was quickly determined that it didn't matter, as it ignored resistance, immunity and invulnerability.

    While it isn't an actual fix, if you apply the damage effect to the weapon instead of the player character (divine might/favour/battle tide apply it to the player which is why you can switch weapons and still have the bonus) then the damage respects resistances/Immunity/Vulnerability and the invulnerability flag. This is only an issue for elemental and energy based damage bonus' applied to the character, physical damage bonus like what prayer and bard song does, doesn't have this issue.

    While it'd be nice to fix, it's also nice to have the ability to treat the damage as more exotic and unresistable as desired from a module builder side, more options are always welcome (if it's fixed I'd rather hope beamdog allow an untyped damage type). So incase it isn't fixed, the above info should help you make your custom class at least respect damage resistances/immunity and the like if you tie the bonus to weapon instead of character.
  • I'll have to do more testing on WalkWaypoints then. Its possible something else is causing the issue I noted if that line is commented out.
Sign In or Register to comment.