I have a more general/approach question, but of course, if you have concrete answers or solutions at hand, feel free to share them :)
How to you instruct an AI to build and maintain a small base with fixed building locations and a fixed unit regiment? Do you approach this using the data, trigger or AI editor? I think I can do it with triggers, but it would be insanely complicated and would include a lot of manual stuff. I am hoping that someone can tell me that there is a more automated/built-in/generic solution to this.
What I mean by that is: I need a trigger/script which says: OK, start now build a base in this area. CC goes here, Refinery there, raxx and bunker here. If something along the build process get's interrupted or destroyed, try again until it is done. If you lose the refinery, rebuilt it. If your raxx can't be placed, try again in 3 seconds. Once the base is up and running, do nothing (except mine resources or sth) until something get's destroyed.
The AI should build and _maintain_ a fixed set of structures and units in a small area indefinitely, for example, re-build razed structures during/after an attack.
Resource shortage or tech tree problems are excluded and don't need to be part of the equation. Attackers can also be ignored. It just needs to periodically check if the base it where it needs to be and if not, (re-)build until it is complete again.
write an action (flag threaded checked) for every single building (with conditions : need cc , and retry after x seconds).
run all actions at start, if condition is met it will be executed and terminates the action.
then have an event for "building is destroyed" and run the corresponding action each time
Place the buildings and units that the AI should build. Select all, press enter and go to object properties, then go to the AI tab. There you can uncheck "initially created" so that buildings aren't created when the game begins. "Available for attack waves" are up to you. In difficulty you can select how many times the different difficulty level ai shall rebuild the units/buildings. Set to always (or a set number up to 13)
Make a region around the base and when you want the AI to attempt to build the base create a trigger with the action "AI - Activate bullies in region for player"
Place the buildings and units that the AI should build. Select all, press enter and go to object properties, then go to the AI tab. There you can uncheck "initially created" so that buildings aren't created when the game begins. "Available for attack waves" are up to you. In difficulty you can select how many times the different difficulty level ai shall rebuild the units/buildings. Set to always (or a set number up to 13)
Make a region around the base and when you want the AI to attempt to build the base create a trigger with the action "AI - Activate bullies in region for player"
The AI must be running by this point.
I'm pretty sure this would work.
OK, I understood only 3/4 of what you just said, but I'll try that. What do you mean by AI is running? Preferably I don't want the AI to be doing anything else. Well, I guess I could limit their choices by shaping their tech tree.
Just place the base in the editor as you want the base to appear when it is completed by the AI. Then select each unit in this base and press enter. In the menu that comes up there is three tab options, general, ai and textures. Go to ai.
Do the things I said there, unselecting "initially created" and setting the rebuild count to always. The units should appear purple now.
You have to enable the ai to run in order for it to build anything. Don't worry, if you don't make attack waves for the computer player it wont actually attack. Set up a trigger for when you want the computer to build and add these actions:
AI - Start the campaign AI for player 2
AI - Activate bullies in region "Player 2 Base" for player 2
Remember to give the computer (in my example player 2) enough resources and scvs/drones/probes to be able to build anything.
Sorry if I'm unclear, I'm not really good in English. Hope this works :)
Just place the base in the editor as you want the base to appear when it is completed by the AI. Then select each unit in this base and press enter. In the menu that comes up there is three tab options, general, ai and textures. Go to ai.
Do the things I said there, unselecting "initially created" and setting the rebuild count to always. The units should appear purple now.
You have to enable the ai to run in order for it to build anything. Don't worry, if you don't make attack waves for the computer player it wont actually attack. Set up a trigger for when you want the computer to build and add these actions:
AI - Start the campaign AI for player 2
AI - Activate bullies in region "Player 2 Base" for player 2
Remember to give the computer (in my example player 2) enough resources and scvs/drones/probes to be able to build anything.
Sorry if I'm unclear, I'm not really good in English. Hope this works :)
Yay, thanks a lot. Got it to work. However, there is one problem I haven't figured out in a clean way: How do you do this for refineries? I am now trying to place both the refinery and the geysir and modify the required placement for the refinieries. Is there a cleaner way to do this?
I'm a bit uncertain. Perhaps you can try to place the refinery, unselect the initially created and such so that it's purple, then place a geysir on top of it. You can place it above the refinery if you press shift. Have you tried that?
I'm a bit uncertain. Perhaps you can try to place the refinery, unselect the initially created and such so that it's purple, then place a geysir on top of it. You can place it above the refinery if you press shift. Have you tried that?
Didn't work.
Can I somehow influence the order in which things are rebuilt? The AI does rebuild, but very slowly and often times in an order which doesn't make sense.
Can I somehow influence the order in which things are rebuilt? The AI does rebuild, but very slowly and often times in an order which doesn't make sense.
Solved partially: the AI was macroing so hard, it ran out of resources. My bad.
Still can't find a way to influence the order besides may be creating a ton of artifical requirement (trees).
You can Disallow the unit you don't want the AI to build and Allow it again once it is time. Or, instead of activating all bullies in a region, you can timely activate them one by one at specific times. It is a lot more tedious to implement than letting the AI have its way, though.
Hello, I have a related question on this topic.. I am trying to basically do the same thing using bullies, they start working at first.. but the moment when I add a condition, for example build when worker count = x.. the default AI kicks in and does what ever he wants.. Does anyone know what exactly is wrong with it..
Im adding a screen shot of one of the many versions i tried to do.. but i just cant seem to get the exact way to do it.. Can someone give me any pointers..
vakuu, your first action there ("Train 4 units of type SCV") is not completed instantly.
The AI will build those SCVs whenever it feels like it.
So the next line, "Set Workers = ...", will return 0.
What you want to do is to register for "Unit - Any Unit training progress is Completed" and if the "Triggering progress unit" is of unit type SCV, then "Enable script control for unit" and add it to some group.
The AI will not use those SCVs until you do "Disable script control" on them.
The player must be computer controlled (not empty, neutral or player, it has to be a computer). You then need to start the AI. I would recommend campaign AI unless you want to do some hackery on the melee AI (needs Galaxy expertise).
After specifying a base, you can issue AI commands to it.
Turning stocking on and setting certain building stocks for a base will instruct the AI to build (or rebuild) up until the stock is reached. Stock orders can be queued up and will be fulfilled in sequence. It is recommended you periodically clear and re-order stocks as they are occasionally forgotten by the AI.
Turning on bully replacement allows you to set buillies. A bully is a unit which will be automatically replaced when killed up to the specified number of times (possibly infinite). When it is replaced it will be placed exactly where it was made a bully, so buildings will be rebuilt and units will walk back to their guard post.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Hi folks,
I have a more general/approach question, but of course, if you have concrete answers or solutions at hand, feel free to share them :)
How to you instruct an AI to build and maintain a small base with fixed building locations and a fixed unit regiment? Do you approach this using the data, trigger or AI editor? I think I can do it with triggers, but it would be insanely complicated and would include a lot of manual stuff. I am hoping that someone can tell me that there is a more automated/built-in/generic solution to this.
What I mean by that is: I need a trigger/script which says: OK, start now build a base in this area. CC goes here, Refinery there, raxx and bunker here. If something along the build process get's interrupted or destroyed, try again until it is done. If you lose the refinery, rebuilt it. If your raxx can't be placed, try again in 3 seconds. Once the base is up and running, do nothing (except mine resources or sth) until something get's destroyed. The AI should build and _maintain_ a fixed set of structures and units in a small area indefinitely, for example, re-build razed structures during/after an attack.
Resource shortage or tech tree problems are excluded and don't need to be part of the equation. Attackers can also be ignored. It just needs to periodically check if the base it where it needs to be and if not, (re-)build until it is complete again.
What is the best way/practice to implement this?
Regards, BlacKcuD
how i would do it => triggers:
write an action (flag threaded checked) for every single building (with conditions : need cc , and retry after x seconds). run all actions at start, if condition is met it will be executed and terminates the action. then have an event for "building is destroyed" and run the corresponding action each time
I think bullies would be a nice way to do this.
Place the buildings and units that the AI should build. Select all, press enter and go to object properties, then go to the AI tab. There you can uncheck "initially created" so that buildings aren't created when the game begins. "Available for attack waves" are up to you. In difficulty you can select how many times the different difficulty level ai shall rebuild the units/buildings. Set to always (or a set number up to 13)
Make a region around the base and when you want the AI to attempt to build the base create a trigger with the action "AI - Activate bullies in region for player"
The AI must be running by this point.
I'm pretty sure this would work.
OK, I understood only 3/4 of what you just said, but I'll try that. What do you mean by AI is running? Preferably I don't want the AI to be doing anything else. Well, I guess I could limit their choices by shaping their tech tree.
Just place the base in the editor as you want the base to appear when it is completed by the AI. Then select each unit in this base and press enter. In the menu that comes up there is three tab options, general, ai and textures. Go to ai.
Do the things I said there, unselecting "initially created" and setting the rebuild count to always. The units should appear purple now.
You have to enable the ai to run in order for it to build anything. Don't worry, if you don't make attack waves for the computer player it wont actually attack. Set up a trigger for when you want the computer to build and add these actions:
AI - Start the campaign AI for player 2
AI - Activate bullies in region "Player 2 Base" for player 2
Remember to give the computer (in my example player 2) enough resources and scvs/drones/probes to be able to build anything.
Sorry if I'm unclear, I'm not really good in English. Hope this works :)
Yay, thanks a lot. Got it to work. However, there is one problem I haven't figured out in a clean way: How do you do this for refineries? I am now trying to place both the refinery and the geysir and modify the required placement for the refinieries. Is there a cleaner way to do this?
Glad it worked :)
I'm a bit uncertain. Perhaps you can try to place the refinery, unselect the initially created and such so that it's purple, then place a geysir on top of it. You can place it above the refinery if you press shift. Have you tried that?
Didn't work.
Can I somehow influence the order in which things are rebuilt? The AI does rebuild, but very slowly and often times in an order which doesn't make sense.
Solved partially: the AI was macroing so hard, it ran out of resources. My bad.
Still can't find a way to influence the order besides may be creating a ton of artifical requirement (trees).
@BlacKcuD: Go
You can Disallow the unit you don't want the AI to build and Allow it again once it is time. Or, instead of activating all bullies in a region, you can timely activate them one by one at specific times. It is a lot more tedious to implement than letting the AI have its way, though.
Hello, I have a related question on this topic.. I am trying to basically do the same thing using bullies, they start working at first.. but the moment when I add a condition, for example build when worker count = x.. the default AI kicks in and does what ever he wants.. Does anyone know what exactly is wrong with it..
Im adding a screen shot of one of the many versions i tried to do.. but i just cant seem to get the exact way to do it.. Can someone give me any pointers..
Cheers
vakuu, your first action there ("Train 4 units of type SCV") is not completed instantly. The AI will build those SCVs whenever it feels like it.
So the next line, "Set Workers = ...", will return 0.
What you want to do is to register for "Unit - Any Unit training progress is Completed" and if the "Triggering progress unit" is of unit type SCV, then "Enable script control for unit" and add it to some group. The AI will not use those SCVs until you do "Disable script control" on them.
The player must be computer controlled (not empty, neutral or player, it has to be a computer). You then need to start the AI. I would recommend campaign AI unless you want to do some hackery on the melee AI (needs Galaxy expertise).
After specifying a base, you can issue AI commands to it.
Turning stocking on and setting certain building stocks for a base will instruct the AI to build (or rebuild) up until the stock is reached. Stock orders can be queued up and will be fulfilled in sequence. It is recommended you periodically clear and re-order stocks as they are occasionally forgotten by the AI.
Turning on bully replacement allows you to set buillies. A bully is a unit which will be automatically replaced when killed up to the specified number of times (possibly infinite). When it is replaced it will be placed exactly where it was made a bully, so buildings will be rebuilt and units will walk back to their guard post.