- Joined
- Aug 12, 2010
- Messages
- 149
I read the hashtable/mui tutorial and while it was very helpful I can't seem to make this work. I think I know what I want to do, but I don't know how to use WC3 triggers to do it. I am attempting to create a trigger that, creates 60 dummies evenly spaced in a circle around the caster and then connects each dummy to the one 6 places ahead of it with a mana link spell. It will look similar to the bottom right polygram on this page but with more points. I can create the circle of 60 dummies, but I'm having trouble using a hashtable to store/recover their handles. As I undertstand it, a hashtable is like a 2d array. What I want to do is this:
Create a dummy at (r, theta).
Store the handle of the dummy in a hashtable at (A, c).
Increment theta by 6 degrees.
Increment A by 1
Keep c constant.
Repeat 60 times
Each dummy will be saved in the hashtable along with a value of A that describes its position in the ring of dummies. Then I should be able order the unit described by the value (A, c) to Mana Link the value (A+6, c). It's not working the way I have it set up, though. The dummies are created but nothing happens.
K_Discordance_Params{2] = 500, it's the distance from the caster to each point
K_Discordance_Params{3] = 6, it's the number of points that are skipped when connecting them with mana link
Create a dummy at (r, theta).
Store the handle of the dummy in a hashtable at (A, c).
Increment theta by 6 degrees.
Increment A by 1
Keep c constant.
Repeat 60 times
Each dummy will be saved in the hashtable along with a value of A that describes its position in the ring of dummies. Then I should be able order the unit described by the value (A, c) to Mana Link the value (A+6, c). It's not working the way I have it set up, though. The dummies are created but nothing happens.
-
Discordance
-

Events
-


Unit - A unit Starts the effect of an ability
-
-

Conditions
-


(Ability being cast) Equal to Discordance (K)
-
-

Actions
-


Set K_Discordance_Caster = (Triggering unit)
-


Set K_Discordance_Owner = (Owner of (Triggering unit))
-


Set K_Discordance_Locations[1] = (Position of K_Discordance_Caster)
-


-------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
-


-------- ============================= CREATE THE RING DUMMIES ============================= --------
-


-------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
-


For each (Integer A) from 1 to (Integer(K_Discordance_Params[1])), do (Actions)
-



Loop - Actions
-




Set K_Discordance_Iteration[1] = (Integer A)
-




Set K_Discordance_Locations[2] = (K_Discordance_Locations[1] offset by K_Discordance_Params[2] towards ((Real(K_Discordance_Iteration[1])) x K_Discordance_Theta) degrees)
-




Unit - Create 1 Dummy (Discordance) for K_Discordance_Owner at K_Discordance_Locations[2] facing K_Discordance_Locations[1]
-




Unit - Add a 35.00 second Generic expiration timer to (Last created unit)
-




Unit - Add K - Discordance Ring FX to (Last created unit)
-




Hashtable - Save Handle Of(Last created unit) as K_Discordance_Iteration[1] of (Key Discordance Ring Units) in K_Discordance_Hash
-




Custom script: call RemoveLocation(udg_K_Discordance_Locations[2])
-
-
-


-------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
-


-------- ============================= CREATE THE RING SFX ============================= --------
-


-------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
-


For each (Integer A) from 1 to (Integer(K_Discordance_Params[1])), do (Actions)
-



Loop - Actions
-




-------- Linking the points on the ring of dummies --------
-




Set K_Discordance_Iteration[1] = (Integer A)
-




Set K_Discordance_Iteration[2] = ((K_Discordance_Iteration[1] + (Integer(K_Discordance_Params[3]))) mod (Integer(K_Discordance_Params[1])))
-




Set K_Discordance_RingUnit[1] = (Load K_Discordance_Iteration[1] of (Key Discordance Ring Units) in K_Discordance_Hash)
-




Set K_Discordance_RingUnit[2] = (Load K_Discordance_Iteration[2] of (Key Discordance Ring Units) in K_Discordance_Hash)
-




Unit - Order K_Discordance_RingUnit[1] to Human Priest - Inner Fire K_Discordance_RingUnit[2]
-
-
-
-
K_Discordance_Params{2] = 500, it's the distance from the caster to each point
K_Discordance_Params{3] = 6, it's the number of points that are skipped when connecting them with mana link






