SC2Mapster Forums

Development > Triggers

Add computer players after game start?

  • 20 posts
    #1 Jan 23, 2013 at 01:46 UTC - 0 likes

    I want to add computer players to a game after it starts. Or, as an alternative, hide computer players from the game lobby. These computers need to be something you can spectate as an observer or in replays, and it seems neutral and hostile computer players don't allow that.

    Has anyone dealt with this before? Have any ideas?

    #2 Jan 23, 2013 at 03:27 UTC - 0 likes

    There's quite a few ways you could add players after the game. You use dialogs that only the host can see or depending on the rest of your triggers/AI you could check if particular players are computers, maybe with some boolean variables (that are set at the beginning).

    For hiding players in the lobby you could just go:

    Map -> Game Variants -> Any Player -> Remove Computer

    #3 Jan 23, 2013 at 05:33 UTC - 0 likes

    @Trieva: Go

    I don't understand what you mean by: Map -> Game Variants -> Any Player -> Remove Computer

    This doesn't appear to be a way to hide computer players from the lobby...only to remove them?

    #4 Jan 23, 2013 at 06:13 UTC - 0 likes

    Map -> Game Variants -> Any Player -> Controller -> Computer -> locked
    at least i think he did. i don't know how to hide players in the lobby though.

    Last edited Jan 23, 2013 by willuwontu

    I'm a triggerer
    I can't make awesome terrains
    I dabble in data

    I suck at poems
    That is why i do haiku
    i suck at them too :(

    #5 Jan 23, 2013 at 07:26 UTC - 0 likes

    Whoops, my bad. willuwontu is right about where to go and that's how you remove computers from the lobby. I don't think there's a way to hide any player once they're part of the lobby.

    EDIT: It's how you remove the computer players or at least stop them from being added if that's what you wanted.

    Last edited Jan 23, 2013 by Trieva
    #6 Jan 23, 2013 at 07:47 UTC - 0 likes

    what my way does is lock the computer into their slots.

    #7 Jan 23, 2013 at 08:42 UTC - 0 likes

    Oh yeah. Mine doesn't end with lock but Computer under removed values needs to be ticked.

    #8 Jan 23, 2013 at 13:45 UTC - 0 likes

    What I want is for players to not see them in the lobby. I need them to be there...but I don't want people to see them because they will just confuse people.

    #9 Jan 23, 2013 at 17:36 UTC - 0 likes

    @rtschutter: Go

    Why do they need to be registered as computers? You can use a player number in triggers even if that player is not assigned a slot in the lobby. To my knowledge, the only things which wouldn't work are AI triggers and the player group presets.

    My Projects:
    Malum Ruina: SC2Mapster
    Eternal Exile: SC2Mapster
    Spine Crawler Madness: SC2Mapster
    Xeno Crisis: SC2Mapster

    #10 Jan 23, 2013 at 18:07 UTC - 0 likes

    I think he wants to have computer players without cluttering the lobby. You can't hide them i just spent an hour trying. maybe blizzard will add that feature in the future.

    #11 Jan 23, 2013 at 20:16 UTC - 0 likes

    Damn. Yeah they have to be actual players in the game because it's the only way you can spectate them in replays.

    #12 Jan 23, 2013 at 23:07 UTC - 0 likes

    If what you want is computer players but not have them in the lobby then BasharTeg has mentioned how it's possible. I don't agree that AI triggers wouldn't work but it's as easy as checking the player numbers and some other variable to prove they are computers. These checks are used before you run the AI.

    For example you could have dialogs set up, so after the game starts, the host can choose how many computers there are and which team they belong to. Every time a computer is added to the game just associate a boolean variable with that player number like Is Computer = True.

    The AI should work long as you have everything required. If the AI involves commanding units then that player must have units on the map.

    An easier solution might be setting up extra teams in the lobby which have computer players only. Then at map start you could just combine those teams with the player teams however you like.

    #13 Jan 24, 2013 at 12:33 UTC - 0 likes
    Quote from Trieva: Go

    If what you want is computer players but not have them in the lobby then BasharTeg has mentioned how it's possible. I don't agree that AI triggers wouldn't work but it's as easy as checking the player numbers and some other variable to prove they are computers. These checks are used before you run the AI.

    Okay, I thought that the AI stuff only worked with players flagged as computers before the game starts. Player groups would be an easy work-around... you would just have to assign a new variable to throw the computer players into.

    #14 Jan 25, 2013 at 00:20 UTC - 0 likes
    Quote from BasharTeg: Go

    @Trieva: Go

    Okay, I thought that the AI stuff only worked with players flagged as computers before the game starts.

    Ah, it depends on what we're talking about. If you mean those AI actions provided by blizzard then you could be right. I was talking about custom AI.

    #15 Jan 25, 2013 at 04:43 UTC - 0 likes

    @Trieva: Go

    My goal is to have no computer players in the lobby, but four computer players in the game which can be spectated via the normal observer interface and in replays. I don't need the ai to do anything, I don't even need them to exist except as camera players can switch to while observing.

    But, if in player properties or game variants I set a player to 'computer' they show up in the lobby, and if I set it to 'neutral' or 'hostile' they don't show up in the lobby but they also cannot be spectated. I am wondering if there is a way to have my cake and eat it too. I have been looking at the attributes file for map files and feel like there might be something here which determines whether a player appears in the lobby, and whether it appears as able to be spectated. The editor may not allow me to have both, but I might be able to manipulate the files themselves to allow it.

    That or maybe there is just a trigger which will cause a computer player to show up as something spectators can switch to. I tried the 'display in view menu flag' for neutral and hostile computers and it didn't work unfortunately.

    #16 Jan 25, 2013 at 07:53 UTC - 0 likes

    @rtschutter: Go

    Ah, thanks for more info. There's an action that lets players ally with other players and have shared vision (including computers). To give computers vision there's trigger actions for map revealers or you could simply give them observers. This won't require you to add computers in the lobby but they must exist so give them a unit on the map.

    EDIT: I'm not sure how you could hide them from the lobby but why not put them in a separate team that plyers can't join?

    Last edited Jan 25, 2013 by Trieva
    #17 Jan 25, 2013 at 09:36 UTC - 0 likes

    I am working on the GameHeart overlay, and my goal is of course to gain widespread adoption by major tournament organizations. I am concerned that having computer players in the lobby will confuse them or make them nervous and turn them away from using the overlay.

    #18 Jan 25, 2013 at 10:09 UTC - 0 likes

    Sorry for the edit in my last post. I was thinking about too many things at once XD. What I talked about in that post is how you can hide comps from the lobby. I've seen this happen in maps of mine.

    Giving them a unit on the map should make sure they exist. The comps might still work without that but I haven't tried before. Also make sure that human players cannot take that slot so maybe make the comps player 15, 14, 13, etc.

    #19 Jan 25, 2013 at 11:48 UTC - 0 likes

    That was a really clever idea but unfortunately it did not work. The computer players do not show up as observable in replays.

    #20 Jan 25, 2013 at 12:50 UTC - 0 likes

    @rtschutter: Go

    You may have to do some scripting to make this happen, or mod the editor/replay engine. Unfortunately, I can't tell you how to begin doing that :/

    You might have to settle for either eliminating the alternative camera idea or adding a computer player to the lobby.

  • 20 posts

You must login to post a comment. Don't have an account? Register to get one!