• 🏆 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!

Help retrieving items for multiboard inventory system?

Status
Not open for further replies.
Level 8
Joined
Mar 3, 2009
Messages
327
Whats the simplest way to retrieve items stored in an array of 10 multiboards, each with 12 item slots? i can think of a few ways that would be pretty complex or take forever to make. Also, i'm using GUI, with custom scripts.
 
Level 8
Joined
Mar 3, 2009
Messages
327
EDIT: ok heres what I'm trying to do right this very moment.
Im working on the trigger where an item is acquired. It then needs to save the item's POSITION in the multiboard, so it doesnt overwrite other items. and then, it needs to be able retrieve etc. But for now im worried about saving.

hmm... I should probab;ly rephrase the question :grin:. I have a way to retrieve the 10 multiboards easily. I'm looking for a way to store the items, and then be able to retrieve them one at a time easily. one of the hard ways i mentioned could be an array of 12 for each player. Maybe if i used hashtables?
 
Hashtables can be your solution, yes. You can have an increasing integer, when a unit acquires an item and save it to the unit.
  • Trigger
  • Events
    • Unit - A unit acquires an item
  • Conditions
    • (Load (Key(
  • Actions
    • Set Int = (Load (Key(integer)) of (Key(Triggering unit)) in Hashtable)
    • If (All conditions are true) then do (Actions) else do (Actions)
      • If - Conditions
        • (Int) Less than 12
      • Then - Actions
        • Hashtable - Save (Int + 1) as (Key(Int)) of (Key(Triggering unit)) in Hashtable
        • For each (IntegerA) from 1 to Int, do (Actions)
          • Loop - Actions
            • Hashtable - Save (Item being manipulated) as (Key((items)+(String(IntegerA))) of (Key(Triggering unit)) in Hashtable
(Key((items)+(String(IntegerA))) is "String ID", not "Handle ID" (when it asks you to type a Key, the default one is "Handle ID"; scroll to "String ID" instead). When you get to String ID, scroll to "Concatenate Strings". In the first string field type "items" and in the second, scroll to Conversion - Convert Integer to String and get "For Loop Integer A".
 
Status
Not open for further replies.
Top