• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Making AI selecting custom hero skills

Status
Not open for further replies.
Level 4
Joined
May 1, 2011
Messages
81
Hi guys. I'm a World Editor veteran for 3 years already. However, what I do not have the knowledge to do is, AIs.

I have notice when I use my custom skills for most default units, the AI seems to just use any of them. But this is not the case when it comes to Heroes, as when I set custom skills, they seem to ignore and not choosing the skills, although they were leveled up.

So, I was wondering how you get computer heroes to select custom abilities when they level up. I heard AI editor can't do shit cuz its limited level is 10. Mines 25. How the hell to make them choose skills like Attribute Bonus, just like how the DotA team did it to the AIs, where they will choose their custom abilities as soon as they level up? Any help would be greatly appreciated.
 
Level 9
Joined
Dec 26, 2010
Messages
475
  • AI Learn Skill
    • Events
      • Unit - A unit Gains a level
    • Conditions
      • ((Owner of (Triggering unit)) controller) Equal to Computer
    • Actions
      • For each (Integer A) from 1 to (Unspent skill points of (Triggering unit)), do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Triggering unit)) Equal to Ex-Captain of the 9th Division
            • Then - Actions
              • Hero - Learn skill for (Triggering unit): |CFF20C000Suzumushi[Q]|r
              • Hero - Learn skill for (Triggering unit): |CFF20C000Suzumushi Nishiki: Benihiko[W]|r
              • Hero - Learn skill for (Triggering unit): |CFF20C000Spiritual Sense[E]|r
              • Hero - Learn skill for (Triggering unit): |CFF20C000Cero[R]|r (Kaname Tousen)
              • Hero - Learn skill for (Triggering unit): |CFF20C000Bankai: Suzumushi Tsuishiki: Enma Korogi[T]|r
            • Else - Actions
?
 
Level 6
Joined
May 11, 2010
Messages
236
http://www.hiveworkshop.com/forums/jass-ai-scripts-tutorials-280/ai-editor-29314/

This tutorial is quite useful, it taught me a fair bit about the AI Editor. Also, if you import custom data into the AI editor, (All your custom units including your heroes and spells) you can go to the AI editor and select the hero tab, it will allow you to select your custom heroes where it says "heroes used" which will be the order in which they train their heroes. You can also modify what spells they'll learn each level and in what order, down the bottom where it shows the hero list. The tutorial has pictures anyway, hoped this helped.
 
Level 4
Joined
May 1, 2011
Messages
81
Yeah I did exactly what you said. But here's the problem, take for example I change the default Archmage hero into the DotA's Crystal Maiden, and so do the Hero's skill, which I change into the one in DotA (Crystal Nova, Frostbite etc. and also the Attribute Bonus). And I export out my custom Object's data. Then, when using AI editor, I import the custom Object data. But what the results came out is only the name "Crystal Maiden", but all skills, remain the same old Archmage's skill (Blizzard, Water Elemental, Mass Teleport etc., no Attribute Bonus). Besides, like I said, the AI editor can only go up to Level 10, but mines up to Level 25. So how would I do that if consider AI editor is the best way to edit AI's learning Hero skill, or should I use trigger editor?
 
Level 6
Joined
May 11, 2010
Messages
236
Did you export and import custom data from your abilities section? Because mine shows my custom abilities, you have to go the the abilities tab, go to edit and click "export ability settings" that should carry your custom ones into the AI section. (sorry for the late response)
 
Level 4
Joined
May 1, 2011
Messages
81
I exported the ability under Abilities section at the menu bar's File --> Export Ability settings, then I save up. Then how to import the abilities into the AI editor? (Doesn't matter whether late response, I just need solution only)
 
Level 6
Joined
May 11, 2010
Messages
236
I made a mistake, you only have to export object data, just be sure it says "Export all object data" then import it into the Ai editor, has a button on the first page that allows you to. It should show your abilities in there after that, not sure why it wouldn't. That's exactly how I did it and it worked : /
 
Level 4
Joined
May 1, 2011
Messages
81
Hey no worries!!! Thanks a lot my friend. I finally manage to appear my Hero's skill. This is how I randomly did, where I set into another Race, then set back to the Crystal Maiden's race. In other words, I'm refreshing the old page for the skill, and it shows all the Maiden's skill. :thumbs_up:

And just for one more thing, how to increase the level to 25 in the AI editor?
 
Level 6
Joined
May 11, 2010
Messages
236
Oh so it was working :D you just had to refresh it. I'm actually not sure, there may be away but i'm definitly not aware of it, however I used triggers. I let the Ai editor get the hero to level 10, and then have a trigger to detect when it reaches level 11 and spends it's point for it, you could do that till 25 but not sure how efficient the method is for lots of heroes. So kinda what Marc showed above, but onward from 10 I suppose.
 
Level 4
Joined
May 1, 2011
Messages
81
For Marc's trigger editor suggestion, the action "For each (Integer A) from 1 to (Unspent skill points of (Triggering unit)), do (Actions)"

Do I have to change into "For each (Integer A) from 11" "instead of "For each (Integer A) from 1"?

And should I use the Map Initilialization or Elapse time to activate this trigger, or should I use any variables to do this?
 
Level 6
Joined
May 11, 2010
Messages
236
This is an example, I dont have my data on this comp yet. I also dont remember exactly how mine is so I used Marc's a bit

  • Skills
    • Events
      • Unit - A unit Gains a level
    • Conditions
      • (Owner of (Triggering unit)) Equal to Player 4 (Purple)
      • (Level of (Triggering unit)) Greater than or equal to 11
    • Actions
      • For each (Integer A) from 1 to (Unspent skill points of Mountain King 0000 <gen>), do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Triggering unit)) Equal to Mountain King
            • Then - Actions
              • Unit - Set level of Bash for (Triggering unit) to 4
              • Unit - Set level of Avatar for (Triggering unit) to 2
              • Unit - Set level of Thunder Clap for (Triggering unit) to 4
              • Unit - Set level of Storm Bolt for (Triggering unit) to 4
            • Else - Actions
              • Do nothing
 
Level 4
Joined
May 1, 2011
Messages
81
I don't get your Condition "(Owner of (Triggering unit)) Equal to Player 4 (Purple)" how does this apply to AIs as this is for both AIs and Players?
 
Level 6
Joined
May 11, 2010
Messages
236
Idk, I just put that there as an example to a player, as in if the computer player was play 4 lol. You can remove that if you want, it'll then just apply to all players, and check which one has the hero. Switch it with

  • (Player 4 (Purple) controller) Equal to Computer
That way if it is a computer controlling that slot it'll use the trigger, probably an easier way of checking if each hero is being controled by an Ai though, im not sure really.
 
Last edited:
Level 4
Joined
May 1, 2011
Messages
81
Hey thanks again! The computer has finally instantly learn their skill RIGHT AFTER they up one level! Damn, so many bugs needed to be fixed, but if you can do patiently!
 
Level 4
Joined
May 1, 2011
Messages
81
Are you kidding with me? Of course that's a big no. They only learn one level one skill like what normal hero does.
 
Level 4
Joined
May 1, 2011
Messages
81
Anyway I finally manage to solve this problem already. Thanks to both Drazhar and Marc Mamales for helping me solve the AI hero skill issue. I owe you guys one, I mean really.

This case is now declared "Close".
 
Level 16
Joined
May 2, 2011
Messages
1,345
hey,I have similar Issue
my custom hero has three skills(one four levels and two with three levels)
when I try to make an AI and choose my hero, It detects the skills ,but each with three levels only,and level 6 skill is unknown,thats not the only problem
when I try to test the AI it says error compiling at line XX(I figured out that it is exactly the line of level 6 skill)
what should I do now
the other problem is that I couldn't select my hero from his race.I only could select him from a custom race,is that how it should be?
 
Level 14
Joined
Dec 12, 2009
Messages
1,027
hey,I have similar Issue
my custom hero has three skills(one four levels and two with three levels)
when I try to make an AI and choose my hero, It detects the skills ,but each with three levels only,and level 6 skill is unknown,thats not the only problem
when I try to test the AI it says error compiling at line XX(I figured out that it is exactly the line of level 6 skill)
what should I do now
the other problem is that I couldn't select my hero from his race.I only could select him from a custom race,is that how it should be?

Don't use the AI editor unless you're doing a melee-like maps. You're better off triggering everything for arena's, AoS, and RPGs.

If you do use the AI editor, and change one of the hero abilities after creating it, you'll have a hard time getting the new ability to show up in the 'learn skill' list, as it won't update even if you import new OD. Make sure you don't change the hero skills or be ready to entirely remake the AI editor file. You should use a custom race instead one of the preset, it's easier to work with.

//\\oo//\\
 
Level 16
Joined
May 2, 2011
Messages
1,345
first, I am doing a melee like map
2ndI made a custom hero (based on garithos,and of course I will change his abilities)and the new abilities showed up already,but the AI editor yet don't recognize that my hero only has 3 abilities and for that he put the forth unknown.
3rd well I am ready remake it again because I didn't really start making it
thanks for the replay
 
Status
Not open for further replies.
Top