XSkriptTutorial.Kapitel6-1
Search:
print pdf

Chapter 6 - The creation of a ground combat missionXScript-tutorial6.2 - How to change ground combat missions

MissingLink für Verweise auf noch nicht erstellte Abschnitte:

Begriffe, für die auf eine Definition verwiesen wird; Altes grün 33AA11

Chapter 6.1 - A simple ground combat mission


markieren
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
program Mission;
  
procedure StartMission;
var
  Einsatz : TEinsatz;                              // Individual variable for a ground mission
  dummy : Integer;
begin
  Einsatz := einsatz_api_generateeinsatz;       // Produces a ground mission
  Einsatz.AddAlien(alien_api_GetRandomAlien);  // Adds a random alien to the ground mission
  Einsatz.Start;                                  // Start the ground mission
  mission_win;
end;

begin
  MissionName := 'Ground mission';
  MissionType := mzUser;
end.

To store and access a ground mission we need a variable of the type TEinsatz (line 5). We can produce the ground mission with einsatz_api_generateeinsatz. To be able to access the mission with the script we must store it in a variable, as previously with the UFOs. Unlike in the case of the UFOs this is always necessary, since a newly produced mission has no Aliens yet. For the player that would be very annoying, because he could start the mission - but with no alien he could shoot, the mission would never end.

In order to get an alien in the script, we can use alien_api_GetRandomAlien. This function returns a variable of the type TAlien (an alien from the play set). This will only provide aliens which are 1. activated, and 2. allowed to appear at the current date. With the method AddAlien we assign the alien to the ground mission (line 9). Now all requirements are fulfilled, and we can call the method Start. The method examines whether there are aliens assigned to the mission. If there are a message on the new mission is sent in the game, otherwise the entire mission is deleted (it could not even be accessed using the variable Einsatz).

In the next chapter we will see how to manipulate the ground mission in more detail.


Recent Changes - Edit Menue
Page last modified on 17.02.2008, 06:11 by Ulzgoroth
Edit Page - Attributes - Page History