| 09-19-2006, 02:29 AM | #1 |
I just want to know if I can, for future refrence perhaps. I don't need an alternative to doing this, I just want to know if its possible without killing the WE. Alright! So, say I have a variable array. Can I index the index? Like: Unit_Variable [Integer_Variable [1]] It seems stupid, I know. I just thought of it. |
| 09-19-2006, 02:39 AM | #2 |
Yes, that would be okay since the variable type of the index you're using for the outer array is an integer. It's like looping with respect to 'i' and doing "set udg_Array[i] = SomeUnit" Same principle, just you're using an array value for the index. |
| 09-19-2006, 02:46 AM | #3 |
oh. Intresting. I thought of doing that for a potential illusion kind of spell, where the illusions copy the caster, so I'd need to array the illusions and then array the player (its my way of achieving MUI. Check my tut.) |
| 09-19-2006, 02:53 AM | #4 |
wait wait wait wait. What you want is actually Unit_Variable[1][2]. Isn't it? then that's not possible but it is perfectly possible. just make it so indexes 1 to 3 are illusions 1 to 3 for player 1 then indexes 4 to 6 are illusions 1 to 3 for player 2 and so and so then you just need arithmetic to get each illusion by player number and illusion number. But for units I guess an array of groups wouldn't hurt? |
| 09-19-2006, 02:56 AM | #5 |
true... I'm lazy and don't feel like remebering what number were for what players >.< So i just like to use "Player number of (Owner of unit (casting/triggering/whatever unit))" Thats what i was going for. But It was an idea. Maybe I will do it that way, idk. Thanks Vex. EDIT: Hmm what I sorta meant was like Shadow[ (this index is for the illusions) IntegerArray[(this is for player number)]] It puts the Illusions under array index 1-3, of Shadow, a unit array, which is indexed by player number of owner caster. Make sense now? I could be terribly wrong with what I'm going for. It made sense to me but I don't know shit about coding :) |
| 09-19-2006, 04:53 AM | #6 |
What you're after is a 2D Array, use Gamecache, it's far easier. |
| 09-19-2006, 09:34 AM | #7 |
It was an idea. I don't need it really, just wanted to see if it could be done should I need something of the sort. Plus, Game Cache doesnt work too well for multiplayer games (do they?) |
| 09-19-2006, 01:33 PM | #8 |
DotA seems to run fine, so does AoM(well the older, GC based versions), so I would guess its a safe bet :) |
| 09-19-2006, 02:23 PM | #9 |
All my Spells also work fine with 10 players, so i don't think there's a proplem (only when you use the gc correct) ![]() |
| 09-19-2006, 03:06 PM | #10 |
GC works great in multiplayer, just as good as it does in single player, the only problem is you cant save it (in multiplayer). |
| 09-19-2006, 03:59 PM | #11 |
Arrays > Gamecache by far in terms of speed. For this, a 2D array is fine. |
