Hashtable is like 2d array, it has columns and rows.
You can save data into cell [1][2] for example. (column: 1, row: 2)
But when you want to save data specific for a unit you don't use simple
values like "1" or "2" for cell definition. (they are called
keys btw)
But here, you wantt use the
HandleId of the unit as key.
HandleId is just a number that is unique for each unit, so it won't come in conflict.
Example:
Set myInt = HandleId(MyUnit)
Save "data" in Hashtable[myInt][0].
(second key didn't bother me, so I just chose "0" as example.)
I don't have editor right now, but example for your question:
1. Attacker attacks Stone (you said it's a
unit)
2. Save <Stone> in <hashtable[x][y]>
3. Order attacker to go back/or what ever.
4. When done, order again to attack "LoadUnit <hashtable[x][y]".
x = HandleId(Attacker)
y = Second key does not matter here.
Now this should work. He would attack/ go back/ attack again.
But at this moment you still can't define what resource was braught back.
But this can be solved later, when you understood how to work with hashtables first.
I quickly found this tutorial about hashtables:
http://www.hiveworkshop.com/forums/trigger-gui-editor-tutorials-279/hashtables-mui-133407/
It's not about custom resources, but maybe you can get a basic understanding of how it works.
There are maybe some custom resource systems somewhere around here.
I have not found one quickly, but once found one, I will post here, or someone else will maybe.
Try it out, ask again if something does not work, or isn't clear
.