Hi,

I'm trying to create a Battle AI that 1- checks if a specific weapon type is equipped (not a weapon, a category of weapons, like swords, not a specific sword) and then, if it's not currently equipped 2- checks in the inventory if there is at least one weapon of this specific type and then, if yes, 3- adds a temp ability to equip the weapon (with a Change Equipment node).

Step 1 is easy, I use a Check Status node with Weapon Item Type. However, step 2 is tricky because with a Check Status node set to Inventory, I can only check for a specific weapon. So, I'd need to check for every sword in the game... At least, that's according to my current knowledge... maybe I'm wrong.

Is there a better way to check if there is a specific weapon type in inventory and then equip a random one (or the first-found one) from the inventory?
  • edited September 2020
    Step 2 can be handled via selected data:
    - use a Select Item node to get all weapons in the inventory of a defined item type (All Items enabled and using the Limit Item Type settings)
    - use a Selected Data Count node to check if the selected key you stored the weapons into has more than 0 things in it (i.e. Is Greater 0).
    Post edited by gamingislove on
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Thanks Gil! Very clever...
  • Selected data is a pathway to many abilities some consider to be ... unnatural ;)
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Sign In or Register to comment.