• Please make sure you are familiar with the forum rules. You can find them here: https://forums.tripwireinteractive.com/index.php?threads/forum-rules.2334636/
  • Weve updated the Tripwire Privacy Notice under our Policies to be clearer about our use of customer information to come in line with the EU General Data Protection Regulation (GDPR) rules that come into force today (25th May 2018). The following are highlights of our changes:


    We've incorporated the relevant concepts from the GDPR including joining the EU and Swiss Privacy Shield framework. We've added explanations for why and how Tripwire processes customer data and the types of data that we process, as well as information about your data protection rights.



    For more information about our privacy practices, please review the new Privacy Policy found here: https://tripwireinteractive.com/#/privacy-notice

Modified trader items have SelectedItemIndex = 0

Pharrahnox

FNG / Fresh Meat
Feb 3, 2016
268
71
0
Cranny mate
I've been using a modified version of Insert Name Here's trader list mutator (link), and it was working fine until v1050. Now all modified entries in the trader's list make you buy a crovel instead of the weapon that you're meant to get. I've been trying to sort this out for days, and have finally tracked down the issue. When you select an item that has been replaced or added, the SelectedItemIndex is always 0. I have tried to look through the code for all of the trader-related classes, and that's how I managed to track down the issue, but now I can't seem to figure out where SelectedItemIndex is actually set when you hover over an item in the trader. I have a feeling that this is probably done in Actionscript. Also, since SetItemsInfo() in KFGFxObject_TraderItems is native, and that is the function used in the mutator to update the trader list, I don't know why there is an issue when highlighting these new or modified entries.

Any help would be greatly appreciated; a particular aspect of my mod hinges entirely on modified weapons.
 

Pharrahnox

FNG / Fresh Meat
Feb 3, 2016
268
71
0
Cranny mate
I'm now using a modified version of Marco's code from ServerExt to handle the custom trader list, and it works for v1050. I would still like to know why the other method is now broken and how it could be fixed.
 

oldschool

Active member
May 1, 2015
375
37
28
NYC
osghc.com
Check the code in your weapon.uc Correct the outdated AssosciatedPerkClass= to new code for perk association and see if that helps.
 

Pharrahnox

FNG / Fresh Meat
Feb 3, 2016
268
71
0
Cranny mate
I had already done that, otherwise it wouldn't have compiled. The weapons themselves worked perfectly, just the index issue in the trader list. Thanks anyway.
 

Pharrahnox

FNG / Fresh Meat
Feb 3, 2016
268
71
0
Cranny mate
I haven't tried since I made this thread. I had already spent tens of hours on this, and it seems to me like I've hit a dead end - native functions and ActionScript. I was hoping for a dev to reply, but I lost hope in that a while ago too. But hey, if you want to try to figure it out, go for it.

I have mixed code from Insert Name Here's trader mod and Marco's ServerExt, as well as modifying it myself to suit my needs, and that is now working well. Just the usual problem of localisation :(. I will be posting a 'fix' in a sense, in the form of documented source code for my mod when I release it.
 

rossi123

FNG / Fresh Meat
Jan 16, 2019
2
0
0
38
Pharrahnox;n2284857 said:
I've been using a modified version of Insert Name Here's trader list mutator (link), and it was working fine until v1050. Now all modified entries in the trader's list make you buy a crovel instead of the weapon that you're meant to get. I've been trying to sort this out for days, and have finally tracked down the issue. When you select an item that has been replaced or added, the SelectedItemIndex is always 0. I have tried to look through the code for all of the trader-related classes, and that's how I managed to track down the issue, but now I can't seem to figure out where SelectedItemIndex is actually set when you hover over an item in the trader. I have a feeling that this is probably done in Actionscript. Also, since SetItemsInfo() in KFGFxObject_TraderItems is native, and that is the function used in the mutator to update the trader list, I don't know why there is an issue when highlighting these new or modified entries.

Any help would be greatly appreciated; a particular aspect of my mod hinges entirely on modified weapons.
I will take a closer look when i get a hours
 

Pharrahnox

FNG / Fresh Meat
Feb 3, 2016
268
71
0
Cranny mate
rossi123 This issue is from two years ago and I have long since found an alternative way of adding custom weapons to the trader. HickDead's Trader Inventory Mutator uses basically the same approach off memory. If you require this functionality check the source code for that mod or simply use that mod. If you were merely trying to help me, then thanks but the issue is already solved.
 
  • Like
Reactions: Freebase