Check if a unit HAS an item

muddy19

New Member
Reaction score
1
i seem to cant find this as a condition. I want it so that you have to have a unit to get teleported from a reagion but ANY item not a spesific item..yet i cant find it in the conditions.Help? (i have used search and i cant find the awnser to my question)
 

martix

There is no spoon
Reaction score
49
Item comparison, and a loop to cycle thru all slots checking if each does or does not contain said item.
 

muddy19

New Member
Reaction score
1
the problem is you said *said* item..i just wanna check if it HAS an item. i dont care what item it just it has to have A item...thanks anyways..i see where you are coming from with that
 

martix

There is no spoon
Reaction score
49
The specific condition is "Item-type comparison" and as I said - cycle thru all of the hero's slots and check if that slot contains that type of item.
 

trb92

Throwing science at the wall to see what sticks
Reaction score
142
>..i just wanna check if it HAS an item. i dont care what item it just it has to have A item

Code:
 Do Multiple ActionsFor each (Integer A) from 1 to 6, do (Actions)
    Loop - Actions
         Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Item carried by <Whatever unit> in slot (Integer A)) Not equal to (!=) No item
            Then - Actions
                Set HasAnItem = True
            Else - Actions
Loop through the slots. If any slot is not equal to No item then the hero is carrying an item, so you set the boolean to true.

> check if that slot contains that type of item.
It's not a type of item he wants. He just wants to see if the hero is carrying any item. It's completely irrelevant what the item is.
 

muddy19

New Member
Reaction score
1
o well...thanks both of you. Im just off today i guess i wasnt thinking...anyhow thanks alot.
 

martix

There is no spoon
Reaction score
49
Damn, I am stupid, listen to trb. I though you wanted to check if a unit has some specific item type.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top