• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Solved] How do I check if an item (tome) is being bought from a shop?

Status
Not open for further replies.
Level 2
Joined
Dec 11, 2020
Messages
11
Hi, I'm trying to find a function for the event when a hero purchases a tome from a shop.
I tried "Unit - A unit Sells an item (from shop)" and "Unit - A unit Uses an item", but both didn't work.
I doubt the other two (unit pawns/acquires item) would work.
The only issue I could think of is that whenever you buy a tome, it automatically uses it so the trigger wouldn't "detect" the tome being in your inventory.
Would be great if anyone has an idea!

Edit: I think the conditions may be an issue too.
I used the conditions "(Item-class of (Sold Item)) Equal to Powerup" and "((Triggering unit) is in UserHeroes) Equal to True"

For the latter, I was hoping to differentiate between AI heroes buying the tomes from User/Player controlled heroes buying them.
 
Last edited:
Level 12
Joined
Feb 5, 2018
Messages
521
  • Events
    • Unit - A unit Acquires an item
  • Conditions
    • (Item-class of (Item being manipulated)) Equal to Powerup
I use this in my own project and it works. The item is still acquired even tho it is used and does not require inventory slot.

  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • Whatever you need here, check for AIPlayer // then do whatever
 
Level 2
Joined
Dec 11, 2020
Messages
11
Thanks, it works! Turns out the AIHero check condition was the issue, I'm still not sure why the variable comparison doesn't work, but that belongs to another thread.
 
Last edited:
Status
Not open for further replies.
Top