The thing is my abilities sometimes learn it around 2,3,6,9 which i wanted to be like 1,3,5,7
And it sounds to me you don't want the player to be able to learn rank 1 at any other level besides level 1? Because in WC3 you could learn rank 1 at any level, rank 2 at any level above level 3, etc., meaning you can learn a rank 1 ability at level 2. But if this is not what you want then you need to make sure that the "Level1" behavior is removed from the unit as soon it gains the "Level2" behavior.
Anyways, if that doesn't work, I don't know. Best of luck to you.
From my understanding (which isn't much) is that that function is intended to count a behavior obviously, so the piece of code I have quoted from you is going to essentially turn into an integer, but you don't have any operators (+, /, <, ==) next to it, so that part is written incorrectly. I also see you have written there "Level1" as your behavior, do you have a separate behavior for every level? If that's the case then you'd have to write > 0 following every CountBehavior() function you have. At that point it would probably work, or you may need to add an extra set of parenthesis around each set of functions combined by your && operators.
However, the editor already has a Veterancy behavior which is a whole leveling up system you can add to your units, instead of creating your own behaviors. If you were to use the Veterancy behavior your code could instead look something like this:
@TeamWinning: Go
Did you try adding the parentheses, and you still might need the operator for the CountBehavior() function? Try making it look like this:
( (CountAbil(Bolt,CompleteOnlyAtUnit)[TechTreeCheat] < 1 && CountBehavior(Level1,CompleteOnlyAtUnit)[TechTreeCheat]) > 0) || ( (CountAbil(Bolt,CompleteOnlyAtUnit)[TechTreeCheat] < 2 && CountBehavior(Level3,CompleteOnlyAtUnit)[TechTreeCheat]) > 0 ) || ( (CountAbil(Bolt,CompleteOnlyAtUnit)[TechTreeCheat] < 3 && CountBehavior(Level5,CompleteOnlyAtUnit)[TechTreeCheat]) > 0 ) || ( (CountAbil(Bolt,CompleteOnlyAtUnit)[TechTreeCheat] < 4 && CountBehavior(Level7,CompleteOnlyAtUnit)[TechTreeCheat]) > 0 )
And it sounds to me you don't want the player to be able to learn rank 1 at any other level besides level 1? Because in WC3 you could learn rank 1 at any level, rank 2 at any level above level 3, etc., meaning you can learn a rank 1 ability at level 2. But if this is not what you want then you need to make sure that the "Level1" behavior is removed from the unit as soon it gains the "Level2" behavior.
Anyways, if that doesn't work, I don't know. Best of luck to you.
From my understanding (which isn't much) is that that function is intended to count a behavior obviously, so the piece of code I have quoted from you is going to essentially turn into an integer, but you don't have any operators (+, /, <, ==) next to it, so that part is written incorrectly. I also see you have written there "Level1" as your behavior, do you have a separate behavior for every level? If that's the case then you'd have to write > 0 following every CountBehavior() function you have. At that point it would probably work, or you may need to add an extra set of parenthesis around each set of functions combined by your && operators.
However, the editor already has a Veterancy behavior which is a whole leveling up system you can add to your units, instead of creating your own behaviors. If you were to use the Veterancy behavior your code could instead look something like this:
CountBehavior(MyVeterancyLevels.CompeteOnlyAtUnit)[TechTreeCheat] >= (CountAbil(Bolt.CompeteOnlyAtUnit)[TechTreeCheat] + CountAbil(Bolt.CompeteOnlyAtUnit))[TechTreeCheat]
And that would be all you would need, no matter how many levels your units were to gain.