• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Computer Players obsessed with trying to sell items to shops

Level 7
Joined
Mar 16, 2014
Messages
152
Any computer player, whether it's a proper one or neutral hostile, will constantly try to sell items to shops when I do not want them to do this. It does not matter if the item is unsellable - for some reason the computers drop the items in front of the shops.

Any idea what could be causing this or how to prevent it?

I believe this may have started happening after I reduced the "stats - priority" of all items to 0, that is my only lead for now.
 
Level 18
Joined
Mar 16, 2008
Messages
721
You and Uncle are both right. You pretty much told the AI all items are worthless by setting Priority to zero.

1000 Priority would be the most valuable item. I usually keep item Priority default unless I made a custom item, then I set priority relative to how powerful that item is. Also in my Defense of Felwood map, I pretty much don't want the AI's hero messing with items at all, so I gave it a bunch of non-consunable custom items and set priority to 1000. In that case the hero never changes out items. Maybe it would for another 1000 Priority item but there are no others on the map.

In most guides and other posts on this topic, Priority is mentioned as 'not important' or 'useless' but now you know that it does matter to cpu players.
 
Level 7
Joined
Mar 16, 2014
Messages
152
Thank you, a couple of quick follow-up questions:

1: What fields in the item would you recommend for holding arbitrary data as opposed to priority? I am using priority for extra statistics for each item referenced in triggers.

2: Is there any way you're aware of to disable this functionality or prevent this without using priority, or at least a bandaid fix to detect when the AI is attempting to do this? The weirdest part is they never even sell the items, they just drop them in front of the shops.
 
Level 18
Joined
Mar 16, 2008
Messages
721
1) I'm sure Uncle would have a better solution. But perhaps use Item's Custom Value. Perhaps don't use Priority for extra statistics?

2) I haven't found a way. Like you noticed, it seems even if the item can't be sold, they still try if they consider the item worthless/low prio. Maybe there is some threshold where the cpu considers the item worthless/needs to be pawned like anything below 120? IDK just speculating.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,589
1: What Gnuoy said, you have an infinite number of extra statistics if you use an Item Indexer.

2: Almost everything is an Order so perhaps you could interrupt it. I know that the AI will often just try again so it could cause more problems than good. Another idea would be to make the item's Undroppable when a Computer acquires them, this is possible on 1.31+.
 
Level 20
Joined
Aug 29, 2012
Messages
847
How about creating a custom inventory ability for AI heroes and disable this option?

1692738143504.png


That's a bit extreme but heh that should prevent them from littering :p
 
Top