• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Trigger] Checking inventory for multiple items at once

Status
Not open for further replies.

Ardenian

A

Ardenian

Hello,

I would like to receive an answer to the following question, please:

1. How can I define a general index, checking every index ?
Example:
  • (Item-type of (Item carried by GDD_DamageSource in slot TempInteger[0])) Equal Orb[1]
(Item-type of (Item carried by GDD_DamageSource in slot TempInteger[0])) Equal Orb[1]

With a loop I can check every item slot, but how can I check it for every indexed item Orb[EVERY] ?

One workaround would be to create a 'Any'-Condition and add every indexed item and add a variable that is set to the index of the item that is actually hold, but how do I get the index ?

Would this work if the GDD_DamageSource has multiple Orb[INDEX] ?
So the trigger runs for every item hold of type Orb[INDEX] ?
 

Ardenian

A

Ardenian

Is there a way to avoid hash tables ? Never bothered to learn how to use them, believe me, I tried, but there were always easier ways.

Could you show me the trigger, I guess it is a very simple one, please ?
 

Ardenian

A

Ardenian

Yes, I have 6 different items, stored in Orb[]. Now, I have a trigger checking whether a unit holds an item of type Orb[].

The problem is, I can only check for Orb[1] or for Orb[2] and so on, so I have 6 triggers for every indexed item.
 

Ardenian

A

Ardenian

Oh, yes, that's it, thank you. I am ashamed I myself didn't think of a double loop..

Is it recommended to use this method or hashtables ?
 
Status
Not open for further replies.
Top