• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

How to check if hero has full inventory?

Status
Not open for further replies.
Level 12
Joined
Mar 26, 2005
Messages
790
If I want to make some action only if hero has his inventory full (i.e. has 6 items), what condition is for it or how to make it?


Thx, rep





edit:ok, maybe I know, with integer variable, when pick, +1, when loses item, -1, and when variable is 6 then actions...


But are there more solutions?
 
Here it comes:

  • Inventory check
    • Events
  • [Your events]
    • Conditions
      • (Item carried by [your unit] in slot 1) Not equal to No item
      • (Item carried by [your unit] in slot 2) Not equal to No item
      • (Item carried by [your unit] in slot 3) Not equal to No item
      • (Item carried by [your unit] in slot 4) Not equal to No item
      • (Item carried by [your unit] in slot 5) Not equal to No item
      • (Item carried by [your unit] in slot 6) Not equal to No item
    • Actions
  • [Your actions
That should do it
 
There is a mistake in that trigger, M4stah. Yo have to use a previous condition, in logic AND condition. All the conditions have to be inside an AND (multiple conditions), to tell the program that you only want to that happend IF ALL THE CONDITIONS ARE TRUE.
Do you know something about logic? Well, in logic in AND prepositions, all the conditions have to be true to something happens.
I hope have been clear. Bye!
 
I don't think so. I'm programmer and AND is not a default logic operator in any languaje, specially in Jass C++. So, I asume that if it works, is ramdonly but is not the right way to do it...
 
Heh, I had to be blind when I couldnt find that lol :-D

Both of solutions ofc works, but I will use the second one, couse its shorter.




And conditions must be ALL true to run the actions, so the AND is not neccessary.

Thats different from events.
 
be careful with stacked items, maybe if the hero carries 6 potions it counts it as a full inv.
 
Status
Not open for further replies.
Back
Top