- Joined
- Mar 27, 2008
- Messages
- 8,035
I have a spell which if cast onto a target, it will create 2/3/4/5 floating orbs around the target and circling the it.
How can I assign so that each orb knows its owner ?
Situation:
Unit A self-cast the ability and it spawns 3 orbs around it.
Unit B self-cast the ability and it spawns 5 orbs around it.
How can I know which orb belongs to which unit ?
I can imagine this by doing 2 separate arrays for casterIndex and orbIndex in which;
Hero[1]
-----Orb[1]
-----Orb[2]
-----Orb[3]
Hero[2]
-----Orb[4]
-----Orb[5]
-----Orb[6]
-----Orb[7]
-----Orb[8]
How to achieve this ?
And no Hashtable please, I'd like to stick with Indexing.
How can I assign so that each orb knows its owner ?
Situation:
Unit A self-cast the ability and it spawns 3 orbs around it.
Unit B self-cast the ability and it spawns 5 orbs around it.
How can I know which orb belongs to which unit ?
I can imagine this by doing 2 separate arrays for casterIndex and orbIndex in which;
Hero[1]
-----Orb[1]
-----Orb[2]
-----Orb[3]
Hero[2]
-----Orb[4]
-----Orb[5]
-----Orb[6]
-----Orb[7]
-----Orb[8]
How to achieve this ?
And no Hashtable please, I'd like to stick with Indexing.