Tutorial How To: Making Computer Players Not Show-up in Lobby Like DotA

Lightstalker

New Member
Reaction score
55
Foreword: I decided to make this tutorial because it seems a few people have asked on how to do this lately, and many others don't know how to do it. In this tutorial, I will be assuming you are making an AoS with 2 teams of 5 human players each. Players 6 & 12 will be our "invisible" computer players. Of course, after reading the tutorial you'll be able to figure out for yourself how to make it work for any map for any number of players.

Hint: DotA does not use Neutral players!

Chapter 1: Player Properties

1. Go to Scenario > Player Properties.

2. For every human player you'll have in your map, change "Controller" to "User''. For Player 6 & 12 (our Computer players), change "Controller" to "None". When you're done, it should look something like this:

jj.png

3. Now, go to the next tab, "Forces", and check "Use Custom Forces". Create a 2nd Force and divide your players into 2 teams.

Like this:

ll.png

Hint: Another benefit of not having Computer players show-up in lobby is that you don't have to check "Use Fixed Player Settings", allowing players to choose their race for UI and Music purposes (and possibly others).

Chapter 2: The Triggers

1. Go to your Map Initialization trigger and add the following 2 actions:

Trigger:
  • Player Group - Add Player 6 (Orange) to CPU_Force
    • Player Group - Add Player 12 (Brown) to CPU_Force


These actions will "create" and add Computer players to the Computer Player Force.

2. Next, add those actions:

Trigger:
  • For each (Integer A) from 1 to 5, do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Player((Integer A))) slot status) Not equal to Is playing
        • Then - Actions
        • Else - Actions
          • Player - Make (Player((Integer A))) treat Player 6 (Orange) as an Ally with shared vision
          • Player - Make Player 6 (Orange) treat (Player((Integer A))) as an Ally with shared vision


The loop runs from 1-5 because Team 1 is made-up of human players 1-5. The condition saves performance and only sets-up that player if s/he is playing.

As of now, we've finished setting-up Team 1. Setting Team 2 is just the same, except you're going to make the loop run from 7-11 instead of 1-5:

Trigger:
  • For each (Integer A) from 7 to 11, do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Player((Integer A))) slot status) Not equal to Is playing
        • Then - Actions
        • Else - Actions
          • Player - Make (Player((Integer A))) treat Player 12 (Brown) as an Ally with shared vision
          • Player - Make Player 12 (Brown) treat (Player((Integer A))) as an Ally with shared vision


There! We're done! :) A demo map is attached to give you an idea of how it is done.
 

Attachments

  • No CPU in Lobby.w3x
    10 KB · Views: 275

Sevion

The DIY Ninja
Reaction score
413
Some screenshots of before and after would be nice. And maybe a demo map?

I know it's a short trigger, but a demo map is still nice ^_^
 

Dest

New Member
Reaction score
26
Well, can you add a new trigger to make the CPU forces to ally ALL of people in the game? o_O
 

Lightstalker

New Member
Reaction score
55
Some screenshots of before and after would be nice. And maybe a demo map?

I know it's a short trigger, but a demo map is still nice ^_^

Done & Done! :)

Well, can you add a new trigger to make the CPU forces to ally ALL of people in the game? o_O

Run the loop from 1-12 and set your computers as players 11 & 12. :)

Trigger:
  • For each (Integer A) from 1 to 12, do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Player((Integer A))) slot status) Not equal to Is playing
        • Then - Actions
        • Else - Actions
          • Player - Make Player 11 (Dark Green) treat (Player((Integer A))) as an Ally with shared vision
          • Player - Make (Player((Integer A))) treat Player 11 (Dark Green) as an Ally with shared vision
          • Player - Make Player 12 (Brown) treat (Player((Integer A))) as an Ally with shared vision
          • Player - Make (Player((Integer A))) treat Player 12 (Brown) as an Ally with shared vision


EDIT: @Cake I realized I posted the wrong trigger (not in the tutorial, but the one right in this very post). I just fixed it.
 

Leazy

You can change this now in User CP.
Reaction score
50
So, with this I wont need an opponent in the other team in order to start? +rep if that's the case :)
 

Lightstalker

New Member
Reaction score
55
So, with this I wont need an opponent in the other team in order to start? +rep if that's the case :)

No. You just won't see the AI slots in lobby. You'll still need someone to start with because the AIs are only made during initialization.
 

Leazy

You can change this now in User CP.
Reaction score
50
How do they do in DotA then, where you can start without having a enemy?
 

Lightstalker

New Member
Reaction score
55
How do they do in DotA then, where you can start without having a enemy?

I'm sorry I can't help you I've never tried to play DotA without an enemy.
Maybe I'll try it when/if I get the newest version of DotA and post a tutorial on that.

Also uploaded a new map, made for 1 player. It's not what I did in the tutorial exactly, but it is just there to give you an idea of what I am talking about.
 

Rainther

I guess I should write something of value here...
Reaction score
61
Creating a computer at the opponent side perhaps (Manually before start, not in map)? Then simply make a trigger at start to tell the computer to bugger off? :p

Anyhow this is a nice solution indeed, tried it before. However it may not always be the best answer, cause if you want enemies to auto-cast slow for istance they won't do it automaticly as "none" but will as "computer". You can of course trigger AI if you want to though.
 

jwallstone

New Member
Reaction score
33
I seem to be having a problem with this. I've set it up exactly the way described, but the problem is that the player can still choose to be the Player designated as the CPU. For example, the CPU is supposed to be Orange (Player 5), and the slot is set to None. But in the lobby, the player can still choose to be Orange.

EDIT: I guess this really isn't that big of a problem, as they don't gain control of the units. It's just that the colors could get confusing, with the player and the CPU both being the same color. I guess I can just add a trigger to change all the CPU's colors.
 

waaaks!

Zinctified
Reaction score
255
Please don't forget to tell people that they need to rename the players that are removed from the lobby, because it turn out to be Player 1 and Player 7 instead of The Beholder and The Defiled (my version).
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top