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.

[AI] Simple AI problem

Discussion in 'Triggers & Scripts' started by Krakenn99, Apr 16, 2018.

  1. Krakenn99

    Krakenn99

    Joined:
    Jun 26, 2014
    Messages:
    480
    Resources:
    1
    Maps:
    1
    Resources:
    1
    So here's the problem, the game doesn't recognize when I add a Computer when hosting my map, instead it registers him as a User.
    • If - Conditions
      • ((Player((Integer A))) controller) Equal to Computer

    On Player Properties I've set all my players to user and when I make a game on LAN and add Computers they're still registered liked Users.

    I tried turning on and off the Fixed Player Settings on the Forces tab but it still won't fix it.

    • AI Team 1 Hero pick
      • Events
        • Time - Elapsed game time is 1.00 seconds
      • Conditions
      • Actions
        • Set AI_Hero_Type[1] = Demolisher
        • Set AI_Hero_Type[2] = Engineer
        • Set AI_Hero_Type[3] = Medic
        • Set AI_Hero_Type[4] = Pyro
        • Set AI_Hero_Type[5] = Soldier
        • For each (Integer A) from 1 to 6, do (Actions)
          • Loop - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • ((Player((Integer A))) controller) Equal to Computer
              • Then - Actions
                • Set temp_point[0] = (Center of Hero Human Pick <gen>)
                • Unit - Create 1 AI_Hero_Type[(Random integer number between 1 and 5)] for (Player((Integer A))) at temp_point[0] facing Default building facing degrees
                • Player - Set name of (Player((Integer A))) to (Proper name of (Last created unit))
                • Custom script: call RemoveLocation (udg_temp_point[0])
              • Else - Actions


    When I changed the User to Computer from the Player Properties tab it fixed the problem but then people won't be able to play because the slots will be occupied by bots.
     
  2. WaterKnight

    WaterKnight

    Joined:
    Aug 18, 2009
    Messages:
    4,033
    Resources:
    5
    Maps:
    1
    Tutorials:
    4
    Resources:
    5
    Works for me. Moreover, you are testing for computer there, not user. There are more than these two options, too.
     
  3. Daffa the Mage

    Daffa the Mage

    Map Moderator

    Joined:
    Jan 30, 2013
    Messages:
    7,685
    Resources:
    27
    Packs:
    1
    Maps:
    8
    Spells:
    16
    Tutorials:
    2
    Resources:
    27
    I recommend use the pick player group instead though.