People leaving then there units become Comp

Synthetics

New Member
Reaction score
7
Hey guys.
I was wondering if anyone knew how i could make units that belong to a player become computer controlled in a non melee map.

So if a player left they computer takes over and does things that a normal player would do

If anyone knows it'd be much appreciated :D
 

Cheddar

This is the way it was meant to be.
Reaction score
126
Well, for that you'd need to implement an AI system for a computer to do all human things, and I have no idea where to find that. Then you'd use the AI triggers to do stuff.
 
Z

Zell

Guest
You would indeed need to create your own custom AI via a series of triggers. As for the first part, that is simple.
Code:
Player Leaves
    Events
        Player - Player 1 (Red) leaves the game
        Player - Player 2 (Blue) leaves the game
        Player - Player 3 (Teal) leaves the game
        <etc, one for each player in the game>
    Conditions
    Actions
        Set UnitGroup_Variable = (Units owned by (Triggering player))
        Unit Group - Pick every unit in UnitGroup_Variable and do (Actions)
            Loop - Actions
                Unit - Change ownership of (Picked unit) to Player 12 (Brown) and Change color
        Custom script:   call DestroyGroup(udg_UnitGroup_Variable)
 
Z

Zell

Guest
There's nothing after the custom script... That trigger will change every unit controlled by a leaver to player 12 (or whichever is your computer). You need to make triggers to simulate AI, which can be GUI.
 

Synthetics

New Member
Reaction score
7
hmm ok i guess ill have to experiment with the best way to emulate heroes with triggers, but the thing is all player slots are used, but i have seen in a map called hulks heroes when players leave the comp takes over and all slots are used.

my map is kinda like a melee map but units are bought not trained and you must steal other peoples buildings


thanks for your help guys
 
Z

Zell

Guest
You can't do this unless you have a computer slot. If all 12 slots are players, the only ones left are Neutral, and they can't have allies (except themsleves).
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
> Neutral, and they can't have allies

???
Where you got that one from?

And, just because a player left, doesn't mean that player isn't available anymore.
Player owned units can be ordered around too.
 
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