PDA

View Full Version : AI construction Tutorials


Zancloufer27
08-31-2007, 06:42 PM
The first one, making teams:

First make a script that allows the player (CPU) to build units.
Then make make a subroutine script active, and deactivated upon success, that does NOTHING(null operation) Thats the prerequisite for the team. Make the Requirement what you want, but the action if true must be NULL OPERATION!
Give them a way point called what ever you want it to be. Something like Infantry team one point, etc
Make sure the team is always reinforced, AI recurtable, and does assorted actions.
Have a script that is subroutine, and active, but stays active. That script will be what they do after being built. The prerequisite has to be nothing, but the Action if true can be anything under the teams option. You can use all the behavior lists, like the follow a path, until they see an enemy, then they attack them. You can also make them retreat if injured.
Make sure they have a Barracks/War Fac/Airfield plus power, and money.

Next time: Build list, the AI makes a base.

chaoscontrol512
10-08-2007, 09:40 PM
A couple of things to add to your tutorial Zan:

The subroutine that has the Null Operation goes in the Condition tab for the team that is going to be built (in the Teams window, in case it wasn't clear). The subroutines that tell the team what to do upon being built go in the On Create tab.

LizardmanPC
11-26-2009, 10:32 AM
The first one, making teams:

First make a script that allows the player (CPU) to build units.
Then make make a subroutine script active, and deactivated upon success, that does NOTHING(null operation) Thats the prerequisite for the team. Make the Requirement what you want, but the action if true must be NULL OPERATION!
Give them a way point called what ever you want it to be. Something like Infantry team one point, etc
Make sure the team is always reinforced, AI recurtable, and does assorted actions.
Have a script that is subroutine, and active, but stays active. That script will be what they do after being built. The prerequisite has to be nothing, but the Action if true can be anything under the teams option. You can use all the behavior lists, like the follow a path, until they see an enemy, then they attack them. You can also make them retreat if injured.
Make sure they have a Barracks/War Fac/Airfield plus power, and money.

Next time: Build list, the AI makes a base.

i'm sry but i didn't understand a word of it, could you give the actual scripts, like type them up......sry,


thanks if you can help:dunce:

chaoscontrol512
11-27-2009, 03:48 PM
I must admit, when I first saw this tutorial years ago, it took me a few read-throughs to figure it out, and a lot of people that I've sent it to have been confused by it also. So to help out the newbies, I'm going to post something a bit more detailed, complete with screenshots. It might seem confusing at first, but it all comes together at the end.
1) First order of business is fairly simple, it allows the AI to be able to build units in the first place (this script is found under Player -> Build). This script is NOT a subroutine, should be active, and deactivated upon success.
"Script 1"
*** IF ***
True.
*** THEN ***
Player 'Player X' is able to build units.

2) This next one tells the AI to actually begin building the team, however it's a little different from regular scripts, more on that in a little bit. This script is a subroutine, active, and deactivated upon success.
"BuildTeam1"
*** IF ***
True
*** THEN ***
Null operation (Does nothing)

3) I think the best way to do this one is to show you the script and then explain it later. This should NOT be a subroutine, it should be active, and deactivated upon success.
"StartBuildingTeam"
*** IF ***
Player 'Player Y' has units in area 'BasePerimeter'
*** THEN ***
Run subroutine 'BuildTeam1'
A subroutine is a script that is called upon by another script. In this case, when a certain condition is met, the AI will run the subroutine that builds the team.

4) (Optional) Place a waypoint somewhere on the map. This is the team's rally point, i.e. where the units will go upon coming out of the barracks/war factory.

5) Now you need to create subroutines that tell the team what actions to take should all members of the team are done building, if the team is fully destroyed, if it encounters an enemy, etc. These scripts are subroutines, active, and should NOT deactivate upon success.
"MoveTeam1"
*** IF ***
True
*** THEN ***
Move team 'Team1' to waypoint 'Team1MovePoint'
The action can be anything you want, but the condition must be true.

6) Open the Teams window and create a new team. The Edit Team Template should open automatically, but if it doesn't, double-click the team. I think it's easiest to explain this part via screenshots:
http://i207.photobucket.com/albums/bb150/chaoscontrol512/AITutorial1.png
The Condition should be the subroutine from Step 2 that builds the team. The Home Position should be the rally point. Finally, Execute Associated Actions must be checked.
http://i207.photobucket.com/albums/bb150/chaoscontrol512/AITutorial2.png
This is mostly self-explanatory. The subroutines from Step 5 are called from here.

Hopefully this makes more sense. If it doesn't I'll upload a map that has these scripts implemented.