| 01-14-2006, 12:22 AM | #1 |
Hi, I haven't done much work with JASS, and i can grasp the basics of it by looking at tutorials, but I can't be bothered to learn the whole language just to solve my one problem. Help would be appreciated. What I'm trying to do is make a map where at the start, you choose each of your hero's abilities individually, its primary stat, and ranged/melee. What I have so far is this: A dialogue box appears saying "Choose a nuke", then with buttons for 4 different skills to choose from. Same thing for an aura, a spell and an ult. After the player clicks on the button, i have no trouble assigning the chosen ability to a variable, but what I can't do is assign the skill stored in the variable to a certian hero. I have 2 variables each with a specific hero stored in it (using the "Last Created Unit" action), and I have 8 ability variables (rednuke, bluenuke, redaura etc etc), and the GUI has an action for giving a unit an ability, but it assigns it as a normal unit ability on level 1, which can't be levelled, rather than as an unlearned hero ability. I've tried everything I can think of using the GUI and there doesn't seem to be a way to get it to work, so I was hoping someone could give me some JASS script for this. |
| 01-14-2006, 12:34 AM | #2 |
You cant do it with gui to add hero abilites, only with jass and use ability arrays instead of rednuke,bluenuker... etc. It is a problem i am researching as well and so far there are no posts, a mediocre alternative would just be to let the hero level up 4 or 5 dummy abilites that are item abilites so it won't show up and apply the researched ability respectivly to each one of the dummy abilites. |
| 01-14-2006, 01:44 AM | #3 |
The answer to your question is the 'ANeg' (Engineering Upgrade) ability. You don't need JASS to accomplish this. Here's a small summary: The engineering upgrade finally solves the problem of not levelable trigger added hero skills. It allows to add hero skills with triggers and to still have them in the levelup menu. Therefore the hero needs to have dummy hero skills that can then be replaced by the actual skills. The placeholder skills need to have the same amount of levels and level skip requirements that's why you will probably need one for ultimates and one for normal hero skills. I usually base my placeholder skills off of Arpb (Replenish) but the base skill really shouldn't matter. The placeholder with 3 levels and 2 levels skip can simply be given to the hero several times. Then the placeholder skills must be disabled for all players at map initialization, so they don't show up in the levelup menu at first. Then you will just need an adder ability based off of engineering upgrade for each skill that you might want to have on the hero. The upgrade will replace the skills in the order of their ability upgrade field when it's added, and replace them backwards when it's removed. So if you want to abuse the engineering upgrade but don't want the passive upgrade icon on the unit you can simply have an engineering upgrade with the abilities B, A in the upgrade field and then when you add and remove it on a unit that has A it will then have B. That's because adding it will do nothing as B is not there, but removing it will replace A with B. As soon as a hero ability has been added that way it will be learnable in the levelup menu. SIDENOTE: Replacing skills only works well for unlearned hero skills. Replacing learned skills or normal unit skills will not actually replace them, it will just update the fields like range, area of effect, duration, icon, targets allowed, and so on, but will not change the hardcoded part of the ability. For example changing an aura to the heal ability will only change the icon, tooltips, range and probably some other fields, but it will still be an aura. If the ability that is being replaced is disabled at the time the results become even weirder. Also the engineering upgrade only works for heroes, adding it to normal units will crash the game for some reason. |
| 01-15-2006, 03:18 AM | #4 |
Thanks heaps, that works perfectly. I'd heard people referring to an "Engineering Upgrade trick", and thought it might be able to help, but I didn't know how it worked or what exactly it did. |
| 01-15-2006, 07:59 AM | #5 |
i love pitzer mike |
