Workshop - Step 17

# Step 17:
Build in opponents

| Overview
| Predefine opponents (walking, shooting)
| Build in opponents into the level

Overview

### Overview

Within this step

- we define, how predefined opponents react (walking, shooting),
- we build in opponents right into the sectors (level).

Predefine opponents

### Predefine opponents

Ok, close again all opened dialogs, only the main window is on the screen. Open the dialog Predefined opponents using [Edit] [Predefined opponents].

Using the horizontal scrollbar you can set 32 different types of walking/shooting for opponents. The first opponent we set as follows:

- Set Graphic to index 0 (Radio Man).
- The opponent has an Energy of 15.
- We set the internal caption to Radio Man, energy 15.

- It's standard to set the movement type to walk on motion line.
- Every 50 VBL the opponents tests its walking direction.
- Approximate means, that when you build in this opponent type, the value 50 is changed up to 10 per cent. We recommend this checkbox to activate.
- Within a radius of 512 pixel the opponent walk in the direction of the player.

- The opponent shoots every 100 up to 180 VBL .
- Set the strength (shoot strength) to 0.

So we have created a first predefined opponent. Change to the second opponent using the horizontal scrollbar. We define a second one:

Click on the button Copy and insert in the appearing dialog the number 1 (first predefined opponent). The definition (values) of the 1st predefined opponent are now copied to this second predefined opponent. Make the following changes:

- Write in internal caption the text strong.
- Set energy back to 10.

- The opponent start shooting, when it has been hit for a first time (since hit first time).
- Set the time values to 110 up to 180.
- Set the strength to 2. So this opponent if stronger than the first one.

Close the dialog with OK.

Build in opponents

### Build in opponents into the level

Now we really start with the build in of opponents. Open sector 1. Change to the edit mode for Motion lines. Create 4 points for motion lines as shown (SHIFT key).

Mark (select) all four points (sequence from left to right!).

Call the popup menu with the right mousebutton. Select Create motion line. All points are now connected. With the left mousebutton just click somewhere in the room to deselect the four points again. The window now must look like this:

Mark (select) the point, where stands S 1 A 0. Call the popup menu and select Create opponent. The general dialog for the (really) build in opponents appears. In the combobox Apply from select Radio Man, energy 15. Just click on the button Apply, and the former defined opponent is copied. Of course you now can make changes - only if you want. Close the dialog with OK.

The sector now must look like this screenshot:

At the start and end of a motion line there are some numbers. When creating motion lines in the above described method, the values automatically are set correct.

- If an opponent reaches an end of a line it searches in the with S set sector for a motion line which start at the point the current line ends. If the value for S is the current sector number, the opponent just returns on the current motion line.
- The letter A follows a number. This number stands for the number of the motion line of the sector. If there's one motion in the sector, it has A 0. If there are two motion lines in the sector, the first motion line gets A 0 and the second A 1.

Tip I: If you clear one motion line or parts of a motion line, it's better to clear ALL motion lines. Then create the new design of the motion lines within the sector.

Tip II: If you clear motion lines, an opponent onto the motion line is NOT CLEARED. You must do so before you clear a motion line.

Create a new opponent on a new motion line. For that you have to create a new motion line (create points, select points, create motion line). Mark (select) point S 1 A 1 and create a new opponent. Use the stronger predefined opponent for that.

If you need to change the height (floor height) of the motion line, mark the motion line (with the CTRL key) and call the popup menu.

That's it. Compile again the level using ([File] [Create Falcon030 level]). This time you only have to copy the file level.rld to your Falcon.

## End of the workshop

Back | Home | Info | Concepts | Workshop | Reference | Next