accomplice
  • accomplice
  • 80.75% (Honored)
  • Private Topic Starter
16 years ago
Hi, me again, loaded with more nubi questions.

This time it's about the team tool, which seems to be quite a complex tool that can help automate the AI to build units and send them around.

I would need some help to understand some of its features, so here goes:
  1. Home Position: Will it determine which factory builds the units of the team? As for the closest factory to the position will build the units, or would it be distributed between different factories anyways?
  2. Automatically Reinforce: Does it mean that each lost unit of this team will get immediately rebuilt?
  3. What exactly does the option "Build for x frames" do, and how exactly does the "priority" option work?
  4. What does that "Execute associated actions" option do? What actions could I possibly associate with a team?
  5. Do I have to check the option "AI recruitable" if that team is meant to be used for the AI? Or would that rather disturbed predefined behaviour scripts for the team?
  6. If I want a team to start following a path once created, and attack everything on the way, do i have to make the routine "team follow path" + "team hunt"?
  7. If I want a team to just hold a position and only shoot at units in their range, but not chase, how would I do that?

Lots of questions i know, hope most of them are easy to answer 🙂
Sponsor
Drummin
16 years ago
1. Home position is simply a waypoint you want the team to rally at while it's being built.

2. When it's selected, the AI attempts to bring reinforcements to this team on a unit by unit basis. This would take units from a team that has the AIRecuitable box checked as you asked about.

3. There are maybe 50 frames per-second on average depending on the PC running the game. I find this way too non-precise for me and don't use it.

4. This not too clear to me. The manual says, "When it's checked, the AI executes the actions of the script referenced as the Condition. By default, the script's actions are ignored. The condition checked under Production is examined when the team has been authorized to be built. If you are referencing a subroutine through the Condition drop-down, that subroutine must contain a condition, as the subroutine may fire before the team is actually produced. To execute the associated actions of that subroutine, check the box next to Execute associated actions."

My take on this: If the condition of the production subroutine script is to check if the AI has a barracks, then this condition would be checked before the team is authorized to be built.

5. Not exactly. Think of this team as a warehouse team. Say you have some attack teams that you want to go after the player at the beginning of the mission but it takes too long to build these teams. In the team section you can make a team called for example "warehouse" and set this team to be AI recruitable. Place a bunch of units on the map belonging to this team. As each attack team is called to be created, it would then pull individual units out of this "warehouse" team to make the team. If units are not found it would then build units at the factories. For this to work, I would also make a subroutine script for this warehouse team to be used as the "On Create" action.
*** IF ***
True.
*** THEN ***
Team '' sets their willingness to join teams to TRUE

6. I would make two subroutine scripts.
Script Name: Hunt
*** IF ***
True.
*** THEN ***
Team '' begins hunting.

Script Name: FollowPathX
*** IF ***
True.
*** THEN ***
Have Team '' EXACTLY follow Waypoint Path 'PathwayX' , as a team is FALSE

On the Behavior page I would set the following scripts.
On Create: FollowPathX
On Enemy Sighted: Hunt
On All Clear: FollowPathX
On Idol: Hunt

So when the team is made they will follow the path. If they see an enemy they will hunt until the enemy is out of range or taken out. They will then resume their path. When they reach the end of the path they will be idol without further instructions so the hunt script kicks in. Note: Always use '' on subroutine action scripts so they can be used by all teams.

7. Really, sitting there is a units default action. It would be more effective to have the team guard an area. For example a defending team is sitting and an enemy comes and attacks on of them. Because the attacker is not in range of all these team members they could pick them off one-by-one with little resistance. If on the other hand you make an area for this team to guard, as soon as the enemy enters this area, the whole team will respond and when clear, return to the center of this area.
accomplice
  • accomplice
  • 80.75% (Honored)
  • Private Topic Starter
16 years ago
Those were some insightful answers, thanks again :)

About a team priority, it seems to have a quite big range (can enter integers up to 1000 or higher..).

Assumed the AI player has only 1 team that it's supposed to build from a factory, will a low priority value result in the AI not building the team right away, and delay rebuilds on team destroyed?

What would be a good setting to make the AI player immediately recreate a team when it has been completely destroyed? Or would I have to control that via scripts, rather than using team window options?

And one more thing, if I give an AI player factories from different factions (like one china WF, and one US WF), and assign teams consisting of US and China units, will the AI actually make use of the "foreign" factory?

Drummin
16 years ago
The priority is based on all teams for this player and does not in itself delay the build. Teams with a higher priority will be built first. So if there is one team, a value of 1 or 1000 will make no difference.

All teams should be made with a subroutine script called for in the production condition section. This script in most cases would be a blank script set at [S A nd].

Script Name: TeamOne
*** IF ***
TRUE
*** THEN ***
Null operation. (Does nothing.)

I would normally make another normal script that checks for conditions to start my teams. For example at the end of the intro movie, I'll set a flag to say the intro is done.
Then this script would say,
*** IF ***
Flag named 'IntroDone' IS TRUE
*** THEN ***
Run Subroutine 'TeamOne'.

I'll then make another subroutine script to run this team creation script again if it's taken out. Settings [S A nd]

Script Name: RunTeamOne
*** IF ***
TRUE
*** THEN ***
Run Subroutine 'TeamOne'.

So on the "on destroyed" part of the behavior page, I'd put the script "RunTeamOne".
Note: On the "Maximum Quantity" text-box, set the number to one if you only want one copy of this team at any one time. If however, you want the team to start being recreated at 50% (or a fraction of 100%) set the number to two (or more).

As far as the different factions... I've never tried that. However I have made missions with two enemy players. So you could have these two players "working" the same base area and building teams together.
accomplice
  • accomplice
  • 80.75% (Honored)
  • Private Topic Starter
16 years ago
Good points.
Basically, if I assign a team's creation to a subroutine, and then run that subroutine, the team will be created, right? If the subroutine is just "sitting there doing nothing", the team will not be created?

Oh and that "on create" thing, does the applied subroutine come into effect for each unit individually as it is built, or only when the whole team has been built?

Oh and I just tried cross tech building, it works! 🙂
Drummin
16 years ago
Yes. I always "Run" my creation scripts with a separate script. However this could be what that "Execute associated actions" option is for. You could try putting the condition in the creation script itself and checking the "Execute associated actions" box. I'd be curious if that works.

The action "On Create" happens after the team is done and applies to the whole team. So for our example, when the team is finished being built they would follow the path. If an enemy is spotted by any member of the team they will hunt.

So you're saying that if you have buildings of different factions for one player, mixed teams will be built, correct? That's cool!
accomplice
  • accomplice
  • 80.75% (Honored)
  • Private Topic Starter
16 years ago
Ok, tested following:

- Extra [ns] script to run the subroutine for creation
- run associated actions NOT checked
=> works. Makes my teams

- No extra [ns] script to run creation subroutines
- run associated actions CHECKED
=> Still works, no difference apparently

- No extra [ns] script
- run actions NOT CHECKED
=> Works.

In my very very first test runs (before I came here asking dumb questions), I had the same settings as in the 3rd case, the AI did not build the teams.
Since then, I have changed
- set AI able to build units
- make AI hostile towards me instead of neutral
- set me hostile versus AI

so I am not quite sure yet which one of these 3 changes actually did the trick.
Going to try to remove the AI able to build units just to see what happens. :)
[edit]

Ok, now it's not building stuff again. Apparently, as long as you have the AI able to build units, you don't even need a build condition o0
Drummin
16 years ago
You absolutely need the "AI able to build units" script and make sure they have funds to build. Relationship doesn't matter for production. Only hunting actions.

I'm wondering about test three... Do you have the "On Destroyed" subroutine script in this test? I think that if you start piling on teams you'll find that others won't be created without adding the Run scripts.
accomplice
  • accomplice
  • 80.75% (Honored)
  • Private Topic Starter
16 years ago
Shiny. Glad to have found such a knowledgable teacher here 🙂