- Joined
- Apr 9, 2004
- Messages
- 502
I have a couple questions regarding how I can manipulate functions to simplify some the systems I've been working on. I've just gotten into using a unit indexing system to build my systems (the one bribe made) and I'm wondering if there's an efficient way to allocate an array variable to an array unit.
For instance each unit has a custom value assigned within the system so I can recall any one property by simply looking up property[custom value of manipulated unit].
However what I'm trying to do is simplify the process for stacks of variables that could normally be grouped as arrays.
The specific example I'm looking at right now is for a cooldown system I'm working on.
At the moment I have to create a new variable for each specific cooldown instance that a unit is subject to. (i.e. a unit can have up to 6 unique spells they can cast, therefore I need 6 unique cooldown arrays)
So what i was going to do was simply create 6 arrays variables Cool1[]-Cool6[] and link them such that i manipulate Cool1/2/3/4/5/6[custom value of manipulated unit] to control each cooldown instance for the specific unit I'm manipulating at that very moment.
What I'm looking for is something where I can have an array for the cooldown and manage it by referencing back to the unit custom value for lookup, essentially an array within an array
so for instance my code would be something like
for each integer A from 1 to X
set Cool[A] related to unit[custom value of manipulated unit] to XXX
I want to do it this way because at the moment I'd have to individually check each instance of the Cool1-6[] arrays rather than use a loop command to handle this more efficiently.
I just want to know if there's a simple way to stack this, I can't think of one without using a more complicated system.
One thought I had considered was if there was a way to use and manipulate string data to lookup a variable name and get sort of the same effect that way instead (i'd have to use a specific naming convention and filters to get the actual integer information) but again I don't think it's possible.
Right now I'm stuck at a question that's probably been answered but I couldn't find even a remotely similar thread on the subject so it might be a simple "yes this is possible" or "no this is not possible" but I'd like to know if anyone knows how I can deal with this.
For instance each unit has a custom value assigned within the system so I can recall any one property by simply looking up property[custom value of manipulated unit].
However what I'm trying to do is simplify the process for stacks of variables that could normally be grouped as arrays.
The specific example I'm looking at right now is for a cooldown system I'm working on.
At the moment I have to create a new variable for each specific cooldown instance that a unit is subject to. (i.e. a unit can have up to 6 unique spells they can cast, therefore I need 6 unique cooldown arrays)
So what i was going to do was simply create 6 arrays variables Cool1[]-Cool6[] and link them such that i manipulate Cool1/2/3/4/5/6[custom value of manipulated unit] to control each cooldown instance for the specific unit I'm manipulating at that very moment.
What I'm looking for is something where I can have an array for the cooldown and manage it by referencing back to the unit custom value for lookup, essentially an array within an array
so for instance my code would be something like
for each integer A from 1 to X
set Cool[A] related to unit[custom value of manipulated unit] to XXX
I want to do it this way because at the moment I'd have to individually check each instance of the Cool1-6[] arrays rather than use a loop command to handle this more efficiently.
I just want to know if there's a simple way to stack this, I can't think of one without using a more complicated system.
One thought I had considered was if there was a way to use and manipulate string data to lookup a variable name and get sort of the same effect that way instead (i'd have to use a specific naming convention and filters to get the actual integer information) but again I don't think it's possible.
Right now I'm stuck at a question that's probably been answered but I couldn't find even a remotely similar thread on the subject so it might be a simple "yes this is possible" or "no this is not possible" but I'd like to know if anyone knows how I can deal with this.