• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

Spell icons help

Status
Not open for further replies.
Level 4
Joined
Oct 11, 2008
Messages
90
I have a unit that can learn lots of spells during level up, but it can only have 4 spells at once. It learns the first spell at lvl 1, second at lvl 3, third at lvl 7, fourth at lvl 10. The fifth spell must be learned at lvl 13, but to do so the player must give up on one of the previous spells to learn the new one. So, if he types is -change 1, the first spell will be changed, if he types -change 2, the second will be changed, and so on until the fourth spell.
Let's say the palyer types in -change 2 to change his second spell.
To do so, i used
  • Events
    • player types is -change 2
  • Conditions
    • these are not important right now
  • Actions
    • Unit - Remove Ability2 from (Picked Unit)
    • Unit - Add NewAbility to (Picked Unit)
The problem is that the abilities icons will change like this:
- first spell remains the same
- second spell is replaced with the third spell
- third spell is replaced with the fourth spell
- fourth spell is the new learned spell

I have the Art - Button position to 0,2 so that each spell will be moved towards bottom left corner.

So how do i do that the abilities won't swap places any more?
 
Well, it can't be altered, i reckon. Only if you make one spell per position. OR! a trigger can help it! make 4 variables (or an array of 4) of the type 'ability' And, when they learn the first 4 abilities, they are set to the respective numbers. When you want to change one, set 'newabilty' to the number of spell the player wants replaced! Then remove all the abilities, and add all of them in the right order BAM your spells work ;) sorry for the late reply, had to take a long break ^^
 
Level 4
Joined
Oct 11, 2008
Messages
90
Gamecrafter, i have thought at this idea before.
I used 4 ability variables and set the first 4 abilities in their variables. When the fifth spell would show up, the player would type in -change 2. When this happens i set remove all 4 spells (ability1, ability2, abilty3 and ability4), after that i set ability2=(New learned spell), and add ability1, then ability2, then ability3 then ability4 to the unit, in the exact order. Now...surprise! The spells are set in the scrwewd up order just as before, with the new ability always being the fourth. Preety weird, huh? I don't know why this won't work.
 
Level 4
Joined
Oct 11, 2008
Messages
90
If i add the Wait between removing and adding the spells, the spells will be removed, but they won't be added anymore.
 
Level 6
Joined
May 1, 2009
Messages
215
Mmm this is a tricky one. I would hazard that likely, you will need to have multiple versions of this replacable spell with the different button positions. When player does remove 2, the ability that is removed should be replaced with the proper version of the replaced spell. This could get very complicated as then you would probably have to give all other spells button positions, requiring that all spells have 4 versions of them selves (0,2 1,2 2,2 3,2) or that certains spells can only be learned at level 1, level 3, level 7, etc.. Perhaps there is a JASS solution to this?
 
Level 4
Joined
Oct 11, 2008
Messages
90
I tested with 0.2 seconds Wait and it didn't work. 2.5 is a long time. I can't use that.
 
Status
Not open for further replies.
Top