- Joined
- Mar 23, 2007
- Messages
- 302
Hi,
hey there, i need some ideas/help solving this problem:
So we have a Unit called u
Red vaule called R
Green vaule called G
Blue vaule called B
6 Skills that are distributed like this
R rb B bg G gr
so when "u" gets a specific total number of (R+G+B)
the Triggers Check what is the biggest amount of it OR what 2 biggest amounts are.
if R dominates, then u Get the skill saved under R, easy so far.
All this is true for the other stuff. If B and G are equal (and the total numbers
are set to have a maximum of 2 equal vaults) the u get the abilit under "bg".
ok i did this and it works well.
Now i want to repeat this step.
The specific total number is now bigger.
there is no problem in check what amount and so on.
But problem is in Giving Abilities.
If this unit already has this ability, it would gain the next closest Ability
So
R rb B bg G gr
and if R is used alread but R vaule is still the biggest u get either "rb" or "gr"
-------------------------------------------------------------------------
sofar whats about, ok im about to do all this in If-Else statments,
but isnt there any other better solution?
I thought about 3 Arrays (bacause i want this step to be repeatet 2 times, so that a unit would could have any combination of 3 out of 6)
1 Array for every check, so if that array would have already a 1 somwhere
it couldnt be in the same position on the other arrays, but this would
again lead to a mass of If-Else.
ehm, mb its just late and i cant conzentrate.
Anyway, i say THX to all those that help me
greets equal
hey there, i need some ideas/help solving this problem:
So we have a Unit called u
Red vaule called R
Green vaule called G
Blue vaule called B
6 Skills that are distributed like this
R rb B bg G gr
so when "u" gets a specific total number of (R+G+B)
the Triggers Check what is the biggest amount of it OR what 2 biggest amounts are.
if R dominates, then u Get the skill saved under R, easy so far.
All this is true for the other stuff. If B and G are equal (and the total numbers
are set to have a maximum of 2 equal vaults) the u get the abilit under "bg".
ok i did this and it works well.
Now i want to repeat this step.
The specific total number is now bigger.
there is no problem in check what amount and so on.
But problem is in Giving Abilities.
If this unit already has this ability, it would gain the next closest Ability
So
R rb B bg G gr
and if R is used alread but R vaule is still the biggest u get either "rb" or "gr"
-------------------------------------------------------------------------
sofar whats about, ok im about to do all this in If-Else statments,
but isnt there any other better solution?
I thought about 3 Arrays (bacause i want this step to be repeatet 2 times, so that a unit would could have any combination of 3 out of 6)
1 Array for every check, so if that array would have already a 1 somwhere
it couldnt be in the same position on the other arrays, but this would
again lead to a mass of If-Else.
ehm, mb its just late and i cant conzentrate.
Anyway, i say THX to all those that help me
greets equal