Official Pawn forums Forum Index
  
Bad upgrade info for dual-wielding classes

 
Post new topic   Reply to topic    Official Pawn forums Forum Index -> Bug Reports
View previous topic :: View next topic  
Author Message
JMnITup



Joined: 23 Jan 2011
Posts: 2

PostPosted: Sun Jan 23, 2011 2:31 pm    Post subject: Bad upgrade info for dual-wielding classes Reply with quote

I have scales for Main Hand weapon (MH and 1H), and for Off Hand weapon (OH and 1H).

Unfortunately, Pawn makes no slot designation, and compares the values for any weapon with any other weapon, regardless of slot usage.

Take this example:

I have these 3 weapons:

Dagger1 - 1H (MHS=880, OHS=684)
Dagger2 - OH (MHS=n/a, OHS=943)
Dagger3 - 1H (MHS=866, OHS=674)

Clearly, my best weapon in the MHS is Dagger1, and my best in the OHS is Dagger2.

However, Pawn incorrectly tells me that Dagger3 is an upgrade for 1H set.

This is because it is assuming that I can use TWO MHS weapons, or two OHS weapons... it is assuming Dagger3 is my 2nd best MHS weapon (since it is 1h and can be used in my offhand), and so saying it is an upgrade, even though it is far inferior to Dagger2 in my offhand.

Is there any way to turn off the '2nd best' thing for weapons on a per-sclae basis?
Back to top
View user's profileSend private message
JMnITup



Joined: 23 Jan 2011
Posts: 2

PostPosted: Sun Jan 23, 2011 3:52 pm    Post subject: Reply with quote

As an FYI, I did a quick hack that resolves this issue, though it might introduce unintended changes... however, the MAIN thing I think it will do is simply keep very low level characters from seeing upgrades for items they don't have yet, so pretty low edge case.

in Pawn.lua, in the PawnIsItemAnUpgrade function definition, somewhere around line 2607, I just added a check where if Item.InvType == "INVTYPE_WEAPON", it wouldn't do the edge case add when it couldn't find a match: (aligned my added lines to the left to make them stand out).

Very hacky fix, but I think it will work for me until I download an update and lose my hack. :)


Code:
            else
               -- Not having best item data for a particular slot isn't a bizarre case; it will happen often for low-level characters
               -- who don't have any helms or shoulders.
-- JM: However, ignore this for 1h either-hand weapons for now, as a hack fix
if Item.InvType ~= "INVTYPE_WEAPON" then
                  if not ThisValue then _, ThisValue = PawnGetSingleValueFromItem(Item, ScaleName) end
                  if ThisValue and ThisValue > 0 then
                     NewTableEntry = { ["ScaleName"] = ScaleName, ["LocalizedScaleName"] = Scale.LocalizedName or ScaleName, ["PercentUpgrade"] = PawnBigUpgradeThreshold, ["ExistingItemID"] = BestItem }
                  end
end
            end
Back to top
View user's profileSend private message
Vger
Pawn Mod Creator


Joined: 09 Jul 2007
Posts: 120
Location: Azjol-Nerub (US)

PostPosted: Mon Jan 24, 2011 6:53 pm    Post subject: Reply with quote

Thanks for the report! I'll try to keep your case in mind; the upgrade functionality is indeed not designed to work for people who use multiple scales in conjunction like that. It also doesn't work well for warriors with Titan's Grip who want TWO good 2H weapons.

I can't think of anything off the top of my head that your hack might break, so hopefully that will work fine for you in the meantime.
Back to top
View user's profileSend private messageVisit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Official Pawn forums Forum Index -> Bug Reports All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum