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

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 11
Joined
Feb 5, 2018
Messages
485
  • 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:
Top