Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Making AI selecting custom hero skills

Discussion in 'World Editor Help Zone' started by myronbeg, May 1, 2011.

  1. myronbeg

    myronbeg

    Joined:
    May 1, 2011
    Messages:
    81
    Resources:
    0
    Resources:
    0
    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.
     
  2. Marc Mamales

    Marc Mamales

    Joined:
    Dec 26, 2010
    Messages:
    450
    Resources:
    1
    Spells:
    1
    Resources:
    1
    • 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

    ?
     
  3. Drazhar

    Drazhar

    Joined:
    May 11, 2010
    Messages:
    213
    Resources:
    0
    Resources:
    0
    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.
     
  4. myronbeg

    myronbeg

    Joined:
    May 1, 2011
    Messages:
    81
    Resources:
    0
    Resources:
    0
    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?
     
  5. Drazhar

    Drazhar

    Joined:
    May 11, 2010
    Messages:
    213
    Resources:
    0
    Resources:
    0
    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)
     
  6. myronbeg

    myronbeg

    Joined:
    May 1, 2011
    Messages:
    81
    Resources:
    0
    Resources:
    0
    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)
     
  7. Drazhar

    Drazhar

    Joined:
    May 11, 2010
    Messages:
    213
    Resources:
    0
    Resources:
    0
    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 : /
     
  8. myronbeg

    myronbeg

    Joined:
    May 1, 2011
    Messages:
    81
    Resources:
    0
    Resources:
    0
    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?
     
  9. Drazhar

    Drazhar

    Joined:
    May 11, 2010
    Messages:
    213
    Resources:
    0
    Resources:
    0
    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.
     
  10. myronbeg

    myronbeg

    Joined:
    May 1, 2011
    Messages:
    81
    Resources:
    0
    Resources:
    0
    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?
     
  11. Drazhar

    Drazhar

    Joined:
    May 11, 2010
    Messages:
    213
    Resources:
    0
    Resources:
    0
    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
     
  12. myronbeg

    myronbeg

    Joined:
    May 1, 2011
    Messages:
    81
    Resources:
    0
    Resources:
    0
    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?
     
  13. Drazhar

    Drazhar

    Joined:
    May 11, 2010
    Messages:
    213
    Resources:
    0
    Resources:
    0
    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: May 2, 2011
  14. myronbeg

    myronbeg

    Joined:
    May 1, 2011
    Messages:
    81
    Resources:
    0
    Resources:
    0
    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!
     
  15. Drazhar

    Drazhar

    Joined:
    May 11, 2010
    Messages:
    213
    Resources:
    0
    Resources:
    0
    What do you mean? Do you mean they're learning ALL the skills after one level?
     
  16. myronbeg

    myronbeg

    Joined:
    May 1, 2011
    Messages:
    81
    Resources:
    0
    Resources:
    0
    Are you kidding with me? Of course that's a big no. They only learn one level one skill like what normal hero does.
     
  17. Drazhar

    Drazhar

    Joined:
    May 11, 2010
    Messages:
    213
    Resources:
    0
    Resources:
    0
    Sorry, misunderstood what you meant, you said it was bugging
     
  18. myronbeg

    myronbeg

    Joined:
    May 1, 2011
    Messages:
    81
    Resources:
    0
    Resources:
    0
    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".
     
  19. Map Designer

    Map Designer

    Joined:
    May 2, 2011
    Messages:
    1,176
    Resources:
    2
    Maps:
    1
    Spells:
    1
    Resources:
    2
    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?
     
  20. Boris_Spider

    Boris_Spider

    Joined:
    Dec 12, 2009
    Messages:
    728
    Resources:
    6
    Icons:
    3
    Maps:
    2
    Tutorials:
    1
    Resources:
    6
    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//\\