News Center
-Current
-Submit news

Com Center
-Forums
-Email

Map Tutorials
-Introduction
-Foreword by RVMECH
(Getting Familiar)
Chapter 1: Part 1
Chapter 1: Part 2
Chapter 1: Part 3
(Sculpting Tools)
-Chapter 2
(Texture Tools)
-Chapter 3
(Object Tools)
-Chapter 4
(
Misc. Map Tools)
-Chapter 5
(
String Files)
-Chapter 6
(
Scripting Teams)
-Chapter 7
(
Making Trains)
-Chapter 8

FIRST MAP
-Part 1
-Part 2
-Part 3
-Part 4
-Part 5


Site Staff
Webmaster
-LionKeypr
Map Staff
-RVMECH



 


Chapter 7: Scripting Pre-Built Teams

 

You've made your map and you want to spice it up a bit by adding a moving car or maybe some neutral infantry. I will explain to the best of my ability how you may accomplish this. This is a tutorial for BASIC teams. A more advanced tutorial will be forthcoming for the more advanced map makers amongst us. This is for a very simple team to get you started, and familiar with the team and script editor.

We will be assembling a team of Veteran Civilian Militia tanks and have them patrol around a waypoint path. The tanks will be prebuilt, or preplaced, on the map.

Ok, lets get started. First off select the Team Editor from the Edit menu (See the Screenshot), and the editor will appear.

Next click on the faction you want to add your team to. In this example we will be adding a team to the civilian faction. After clicking on the civilian faction the team template will show up. The first page you see is the Identity page. This is where the team name and members are documented. . Start off by naming your team, or you may use the default names provided by the editor. I prefer to use names that mean something to me as numbers mean little if anything to me, unless I have a lot of teams going on for a singleplayer mission, in which case I number them and keep a separate listing as to what they are and what they consist of. Because the team will be pre-placed we can forego a lot of the information that is normally needed when spawning a team. Give your team a name, check and make sure the owning faction is the civilian faction, check the box for singleton team (this means the team is only created once). If you'd like too, you can give the team a short description in the box provided to help jog your memory "as to what the heck does this team do".

The other pages have a few bits of info that we can also incorporate in our simple team. Click on the Reinforcement tab. This page is for user provided info as to how and where a team will be reinforced. The team we are creating is a singleton team that does not deploy from a transport, so we will not be using any params for these first 2 settings. we do, however, want to make them vets. Scroll down the page and open the dropdown menu labeled "Veterancy Level" and select "Veteran." The other page we need to enter info on is the Behavior page, click on the behavior tab to get there. This page is used to determine the behavior, or mind set, of the team. As we are not making a mission we have no need to make any behavior type scripts, so we can skip the majority of these params and get straight to the one we are going to use, Initial Team Behavior. Here we have 5 options, Sleep, Passive, Normal, Alert, and Aggressive. When a team is in the sleep mode they are just that....comatose. They neither defend themselves nor go on the offensive, as a matter of fact they don't move. Passive mode allows the team to move around but it pays no attention to threats that it may encounter. Normal mode is the normal routine and the team will answer the defensive call when threatened and will give chase for a short distance when retaliating. Alert mode wakes the team up a bit and it will go on the defense a bit faster and will pursue a bit further. Aggressive is just that, the team will go out of its way to pick a fight with any enemy unit in its vision range. For our team we will use Alert.

Close the template and then click the OK box at the bottom of the main editor dialogue. Your team is now documented, it can now be implemented.

It is assumed that you have completed or are close to completing your map and that you know where the waypoint tool is located. Start by making a waypoint then drag the path line to the location where your patrol path will begin. We will be placing the tanks near the first waypoint we place. Next we make the loop. Drag the path along, placing waypoints at areas of movement, I.E. corners, angles, around obstacles, etc. After doing this name the waypoint path. This one is labled simply Militia. See the Screenshot.

Select the Militia Tank from the Civilian vehicle menu and place a couple of them near the first waypoint that we have in our path. Now select the team members by capturing them with your cusor and the Object Properties box will materialize. After the box is opened select the team "Militia" from the team selection menu. See the Screenshot Your team is now ready to be scripted.

Open the script editor and start a new script for the Civilian faction and name it Militia, If your lost look at this Screenshot. Next enter the Script Conditions. For this example I want the tanks to patrol from the opening of the game, so I opt to use the default setting "true" See the Screenshot. Go to the "Actions if True" tab, selecting the action [Team] Set to follow a Waypoint path from the action selection list. Fill in the params for the action. Select the team "Militia" from the list. Select the waypoint path "Miltia" from the list. The param asking whether it should follow the path as a team "True" or "false" can be explained easily. Different type units move at different speeds. If you select follow as a team "false" the faster units will run on ahead of the slower units. If you select follow as a team "true" then all units in the team will move at the speed of the slowest unit. For this example I am choosing "true" even though they are both of the same type. Again if you are lost look at this screenshot.

Exit out of the editor by selecting each of the ok boxes in each of the opened windows. Save your work!! Start up the game and the tanks will move along the waypoint path and enter the loop, following the direction of the path and then re-circling when the path you created closes. Good luck!

 

« Chapter 6 (String Files) | Chapter 8 (creating trains) »