1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. The Lich King demands your service! We've reached the 19th edition of the Icon Contest. Come along and make some chilling servants for the one true king.
    Dismiss Notice
  4. The 4th SFX Contest has started. Be sure to participate and have a fun factor in it.
    Dismiss Notice
  5. The poll for the 21st Terraining Contest is LIVE. Be sure to check out the entries and vote for one.
    Dismiss Notice
  6. The results are out! Check them out.
    Dismiss Notice
  7. Don’t forget to sign up for the Hive Cup. There’s a 555 EUR prize pool. Sign up now!
    Dismiss Notice
  8. The Hive Workshop Cup contest results have been announced! See the maps that'll be featured in the Hive Workshop Cup tournament!
    Dismiss Notice
  9. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

How to make an AI for your map

Discussion in 'Trigger (GUI) Editor Tutorials' started by sentrywiz, Dec 18, 2013.

  1. Mirage1

    Mirage1

    Joined:
    Oct 31, 2015
    Messages:
    61
    Resources:
    0
    Resources:
    0
    Very good tutorial. There could be more of them on hive. I would like some help with a problem in my AI. When a hero who is in the AI group is controlled by a Computer player (Set by filling the player's slot with a Computer) some of the "default AI" commands are activated conflicting with the triggered commands.

    I tried to create a null AI in AI Editor without orders, builds, attack groups, hero skill selection or anything and run it in these players. Made it entirely blank to not send any order as flee or use items. But it did not work. The AI still used items and skills.
    Anyone know how to solve this? In Dota Allstars the AI is placed by computer slots and I doubt they interfere in the commands. What I need is a way to nullify these "default" commands of Warcraft so that they do not conflict with my triggered ones.

    I searched for hours in the Hive and found nothing related. Any help is welcome.
     
  2. I hope you like the term "better late than never" because this is a 2 year reply :p

    Sorry.

    Yes the default AI commands cannot be controlled without triggers.

    But you'd have to share your map or something in order to see whats wrong.
     
  3. Mirage1

    Mirage1

    Joined:
    Oct 31, 2015
    Messages:
    61
    Resources:
    0
    Resources:
    0
    Thx dude. But i don't even remember which map I was talking about haha
     
  4. Yeah :D you might have solved the problem so far.
     
  5. Daffa the Mage

    Daffa the Mage

    Map Moderator

    Joined:
    Jan 30, 2013
    Messages:
    7,731
    Resources:
    28
    Packs:
    1
    Maps:
    8
    Spells:
    17
    Tutorials:
    2
    Resources:
    28
    Reminds me of my Game Design and Digital Circuit courses. An approach with Finite State Machine logic for Game AI.
     
  6. Tbh, I left hive for a while, and now that I'm reading my own material after years ...
    I'm learning a new game engine now to create my own games from scratch and this tutorial
    reminded me of how easy it can be to make an AI (since everything's new for me in the engine)

    Well finite is relative. I'm guessing you can also add a dynamic state that makes its own patterns
    but the logic has to be defined somewhere... or maybe you'd like a chaotic unpredictable system.

    Great reply thanks.
     
  7. Guillekon

    Guillekon

    Joined:
    Oct 16, 2019
    Messages:
    1
    Resources:
    0
    Resources:
    0
    someone helps me to find this detonator line in the mapeditor that I can't find for boolean



     
  8. Daffa the Mage

    Daffa the Mage

    Map Moderator

    Joined:
    Jan 30, 2013
    Messages:
    7,731
    Resources:
    28
    Packs:
    1
    Maps:
    8
    Spells:
    17
    Tutorials:
    2
    Resources:
    28
  9. GA3758-in-hiveworkshop

    GA3758-in-hiveworkshop

    Joined:
    Sep 16, 2016
    Messages:
    8
    Resources:
    0
    Resources:
    0
    thanks for tutorial mate, but I have a better idea to let the AI heroes learn different skills when they gained a level.

    1. Creating & storing variables data:
    - AIhero[arrayed] (unit)
    - SkillLearningChance[arrayed] (integer)

    2. Here's the trigger
    Events - A unit <gains a level>

    Conditions - <Leveling hero> is <a hero> equal to true /OR/ <Leveling hero> equal to <AIhero[Player number of <Owner of <Leveling hero>>]>

    Actions -
    IF,THEN,ELSE multiple actions
    ->IF Hero level of <Leveling hero> not equal to 6
    ->THEN Set SkillLearningChance[Player number of <Owner of <Leveling hero>>] = Random number between 1 and 3.
    ->IF,THEN,ELSE multiple actions
    ->->IF SkillLearningChance[Player number of <Owner of <Leveling hero>>] equal to 1
    ->->THEN Learn <Skill1> for <Leveling Hero>
    ->->ELSE Do Nothing
    ->->IF SkillLearningChance[Player number of <Owner of <Leveling hero>>] equal to 2
    ->->THEN Learn <Skill2> for <Leveling Hero>
    ->->ELSE Do Nothing
    ->->IF SkillLearningChance[Player number of <Owner of <Leveling hero>>] equal to 3
    ->->THEN Learn <Skill3> for <Leveling Hero>
    ->->ELSE Do Nothing
    ->ELSE IF,THEN,ELSE multiple actions
    ->->IF Hero level of <Leveling hero> equal to 6
    ->->THEN Learn <Skill4> for <Leveling Hero>
    ->->ELSE Do Nothing

    That's pretty much it :), but where's the buying items to AI trigger? :'(
     
    Last edited: Nov 19, 2019