On November 16 2012 10:32 Quakecomm wrote:
Did you try putting the A.I. in in the map editor instead of adding them in the lobby?
Just a thought, I don't know if it would under mind your map.
Yes, I have game variants for 1v1 vs comp and 1v1 vs player, the variant forces the computer player to the second team. I suppose i could try hard coding the player property to a computer, however I am really looking to make it to where you can add an AI player or invite a friend regardless of which variant you choose. I've noticed that YABOT maps do this. You can add a computer player and every trigger fires regularly, however they use the Green Tea AI suite, so maybe that has something to do with it. I'm currently digging through their tens of thousands of lines of code to try and figure out how they are doing what I seem to be unable to accomplish.
On November 16 2012 11:33 The_Frozen_Inferno wrote:
SC2mapster is probably a better place to go than here or Bnet. . . the skilled mappers don't really frequent Bnet or TL.
Yea, I kinda felt that SC2Mapster seemed dead. I'll try posting there and pray for a response.
I'm not sure about all the details of your map, so some of this might not apply:
And I'm no expert at triggers, but if it's just getting the units to go to do standard melee stuff, use the default built-in start triggers.
F6 to open trigger menu:
Event: Map initialization (or map restart, or whatever event you have going on)
Action: set melee starting resources for all players
Action: create melee starting units for all players
Action: start the melee AI for all computer players
Action: set default melee options for all players
If I recall correctly, initializing the melee AI only gets it ready for use (for example, if a human player leaves the game, you have to initiate the AI for that player if you want a bot to take over for that player.) But you have to actually 'start' the AI for it to take effect and start doing stuff. And there are 2 different sets of default AI that you have to specify between (melee of campaign)
When you add an AI player in the lobby, it already initializes the AI, so the basic melee triggers just start it. But if you just spawned a base after game initialization for player N, then you have to initialize the AI for player N and then after that start the melee AI.
And you also have to make sure that you set the proper melee options and resources for the AI or it doesn't know what to do.
Also, did you add proper starting location markers for each player? If you don't, the melee AI doesn't work properly either.
A little background on my map: It is a terrain port of Cloud Kingdom. I have the hopes of creating a customizable script that I just import to any terrain map and then the system I am implementing will work on said map. This way I can easy add new map pool maps to the system. So all the start locations are accounted for. The first screen the player sees is a menu where they are able to choose between the three races, a league goal (this sets constraints such as # of supply blocks allowed and max energy per energy unit), and then a step of the training system that restricts tech. After a person chooses a step, the game begins. Here is my AI init function
void InitAI() {
if(numberOfPlayers == 1) {
playerRaces[1] = RandomRace();
CreateStartingUnits(2);
Wait(3.0, c_timeReal);
Log("Starting AI");
MeleeInitAI(); //This is the "Init Melee AI for All Players" trigger
AIStart(2, false, 200); // Starts melee AI for player 2 with 200 apm
}
}
So i make a random race for the computer. Creating their melee starting units (base + 6 workers). I put in a wait because I thought there might be a chance that the units weren't ready, so initing the AI wasn't having the effect, but this didnt work either. Then I init the melee AI, and start a new melee ai for player 2.