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
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
|
program Mission;
procedure StartMission;
var
Einsatz : TEinsatz;
dummy : Integer;
begin
Einsatz := einsatz_api_generateeinsatz;
Einsatz.AddAlien(alien_api_GetRandomAlien);
Einsatz.Start;
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.