- Joined
- Nov 2, 2007
- Messages
- 160
Hey guys,
I have read a Hashtable tutorial and everything is quite clear to me.
Now I wanted to use them to attach an integer value to towers when they get an upgrade in order to be able to use the amount of gold paid for possible sell actions.
My problem is that this only works for the last tower that got the upgrade. If I upgrade 2 towers only the second one has the right value.
I only gonna post the important lines for this issue.
Trigger storing the value:
I have read a Hashtable tutorial and everything is quite clear to me.
Now I wanted to use them to attach an integer value to towers when they get an upgrade in order to be able to use the amount of gold paid for possible sell actions.
My problem is that this only works for the last tower that got the upgrade. If I upgrade 2 towers only the second one has the right value.
I only gonna post the important lines for this issue.
Trigger storing the value:
-
Hashtable - Create a hashtable
-
Set Myhashtable = (Last created hashtable)
-
Hashtabelle - Save Myvalue[(Player number of (Owner of (Triggering unit)))] as 1 of (Key (Triggering unit)) in Myhashtable
-
Events
-
Unit - A unit starts to cast a spell
-
-
Conditions
-
(Ability being cast) is equal to Sell
-
-
Actions
-
Set Temp_Integer = (Integer(((((Max. Leben of (Target unit of ability being cast)) / 10.00) + (Real((Load 1 of (Key (Target unit of ability being cast)) from Myhashtable)))) x Sellvalue)))
-