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. We have recently started the 16th edition of the Mini Mapping Contest. The theme is mini RPG. Do check it out and have fun.
    Dismiss Notice
  4. Dismiss Notice
  5. The Highway to Hell has been laid open. Come along and participate in the 5th Special Effect Contest.
    Dismiss Notice
  6. 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.

Giving empty slots Computer AI

Discussion in 'World Editor Help Zone' started by Kaijyuu, Jun 15, 2018.

  1. Kaijyuu

    Kaijyuu

    Joined:
    Jun 2, 2004
    Messages:
    848
    Resources:
    0
    Resources:
    0
    When a player slot is set to Computer, then the game will automatically use some AI for it; particularly it will cause the units to use abilities like Stormbolt intelligently. I want to enable this when a player leaves the game. Can it be done?
     
  2. KPC

    KPC

    Joined:
    Jun 15, 2018
    Messages:
    89
    Resources:
    0
    Resources:
    0
    I think u need to modify this trigger:
     

    Attached Files:

    • 123.png
      123.png
      File size:
      11.6 KB
      Views:
      26
  3. TheLordOfChaos201

    TheLordOfChaos201

    Joined:
    Jul 2, 2011
    Messages:
    1,726
    Resources:
    0
    Resources:
    0
    I'm surprised no one has answered this very simple question yet. I stopped editing maps a few years ago but I believe I still remember enough. this is a process that can be set up in trig

    event: player leaves
    condition: none
    action: AI, set melee script

    it will be something to that effect. only you will need to create an AI for every hero type in order to use the spells intelligently. which means you will need an if statement in your action which cycles through all the hero types looking for the right AI match

    with the world editor you can make AI scripts to handle 3 heroes every script
     
  4. Kaijyuu

    Kaijyuu

    Joined:
    Jun 2, 2004
    Messages:
    848
    Resources:
    0
    Resources:
    0
    I attempted a simple:
    • AI - Start melee AI script for (Player(14)): map.ai


    on an empty player slot for testing, but the player's hero did not use potions or abilities like a computer controlled slot would.

    I certainly do not wish to code my own AI, since the base game already has one and I know how it works. If possible I'd just like to enable it for empty player slots/left players. If I can't do that, then oh well; I'll just tell players to use Computer slots if they want bots and let leaving player's stuff be braindead.
     
  5. TheLordOfChaos201

    TheLordOfChaos201

    Joined:
    Jul 2, 2011
    Messages:
    1,726
    Resources:
    0
    Resources:
    0
    I'm pulling out my laptop right now

    I'm on the case

    in the mean time in the object handler, add 1 auto cast ability to every hero...what I mean by this is the first row in the edit area in the object area of your hero
     
  6. Kaijyuu

    Kaijyuu

    Joined:
    Jun 2, 2004
    Messages:
    848
    Resources:
    0
    Resources:
    0
    Added a junk ability to Default Active Abilities (raise dead, which they don't have) and nuttin' either.
     
  7. TheLordOfChaos201

    TheLordOfChaos201

    Joined:
    Jul 2, 2011
    Messages:
    1,726
    Resources:
    0
    Resources:
    0
    Lol you have to add an ability they actually have or else they can't use it

    DUH :p

    Anyway it isn't hard to make AI. I was going to do it for you but soon as I opened my laptop I lost all inspiration to do it. It is very easy but takes time. Go to the AI section of your world editor, it and icon of zeros and ones, click on it and then select the tab heroes. Then according to the race you are using different heroes will be available to you. Once more warcraft automatically selects the abilities for you. From there you just need to save the ai for every 3 sets of heroes and then import them later
     
  8. Dr Super Good

    Dr Super Good

    Spell Reviewer

    Joined:
    Jan 18, 2005
    Messages:
    25,719
    Resources:
    3
    Maps:
    1
    Spells:
    2
    Resources:
    3
    Only slots that are Computer controlled can run AI. This means that slots that are empty, or human controlled cannot. One cannot enable Melee AI for a player who left.

    That said one can apply a trigger built AI to any player and it will work. A trigger built AI is an AI that is implemented entirely out of triggers and interacts with players only by issuing orders.
     
  9. TheLordOfChaos201

    TheLordOfChaos201

    Joined:
    Jul 2, 2011
    Messages:
    1,726
    Resources:
    0
    Resources:
    0
    that is factually incorrect

    you can even give computers control of your characters In game
     
  10. Dr Super Good

    Dr Super Good

    Spell Reviewer

    Joined:
    Jan 18, 2005
    Messages:
    25,719
    Resources:
    3
    Maps:
    1
    Spells:
    2
    Resources:
    3
    Yes you can transfer ownership of all units from a human or empty controlled player to a computer player and then get that computer player's AI to use them. However you cannot start an AI script for a non-Computer controlled player. If one could I am sure many more maps would be doing it.
     
  11. Kaijyuu

    Kaijyuu

    Joined:
    Jun 2, 2004
    Messages:
    848
    Resources:
    0
    Resources:
    0
    Confirmation of this is precisely what I wanted. Thanks.

    Too much of the map is built upon heroes not changing which player owns them to refactor at this point, so I'll probably just not worry about it.