Ил-2 Штурмовик: Битва за Британию. Скрипты. Скрипты для чайников. Часть 1 - Загрузка подмиссий — различия между версиями

Материал из АвиаВики
Перейти к: навигация, поиск
Строка 60: Строка 60:
  
 
<code>
 
<code>
ямвм
+
using System; 
ячмяч
+
using maddox.game;
 +
using maddox.game.world;
 +
public class Mission : AMission
 +
 +
    public override void OnBattleStarted()  {  base.OnBattleStarted();
 +
    MissionNumberListener = -1; 
 +
    GamePlay.gpPostMissionLoad("missions\\Single\\Samples\\TestSubmissions\\TestSubMission1.mis");         
 +
    GamePlay.gpPostMissionLoad("missions\\Single\\Samples\\TestSubmissions\\TestSubMission2.mis");
 +
    GamePlay.gpPostMissionLoad("missions\\Single\\Samples\\TestSubmissions\\TestSubMission3.mis");
 +
    } 
 +
}
 
</code>
 
</code>
  
 
[[Файл:Sfdp1-2.png|100%|thumb|left|описание]]
 
[[Файл:Sfdp1-2.png|100%|thumb|left|описание]]
  
 
<code>
 
ямвм
 
ячмяч
 
</code>
 
  
  
 
[[Категория:Ил-2 Штурмовик: Битва за Британию. Скрипты]]
 
[[Категория:Ил-2 Штурмовик: Битва за Британию. Скрипты]]

Версия 18:54, 4 октября 2011

Автор: FG28_Kodiak
Ссылка: Перейти (перевод Google)

Cliffs of Dover with the help of the scripting language provides the ability to missions in ongoing missions to load. This is an interesting turn for online server, on the other hand, this results in even very interesting possibilities for offline missions. One can make the game world as living by existing missions to the current charges, or give the missions a certain amount of randomness by randomly selecting one of several submissions and invites you to take. Also, this example is stored in the possibility of a ground battle in one submission at the right moment to load via triggers, so that the player not only matters when everything is over, etc.

Invite us to a mission, the gameplay, the class method void gpPostMissionLoad (string filename) are available.

Usage example:

GamePlay.gpPostMissionLoad ("missions \ \ music \ \ samples \ \ test submissions \ \ TestSubMission1.mis"); 

The double \ \ in C # is necessary to demonstrate the system to the \ character is meant to be, because the \ in C # also introduces control sequences.

It is also possible to use the normal slash. GamePlay.gpPostMissionLoad ("Missions / Single / samples / test submissions / TestSubMission.mis");

Suppose you want a couple of submissions at the beginning of the mission to load.

At the beginning of the Mission Cliffs of Dover, the method public virtual void OnBattleStarted () (is AMission of Campaign and others made available) is called. This we can overload our submissions and invite as equal at the start.

So:

public override void OnBattleStarted () 
{ 
base.OnBattleStarted (); 
MissionNumberListener = -1;
GamePlay.gpPostMissionLoad ("missions \ \ music \ \ samples \ \ test submissions \ \ TestSubMission1.mis"); 
GamePlay.gpPostMissionLoad ("missions \ \ music \ \ samples \ \ test submissions \ \ TestSubMission2.mis"); 
GamePlay.gpPostMissionLoad ("missions \ \ music \ \ samples \ \ test submissions \ \ TestSubMission3.mis"); 
} 

Explanation: base.OnBattleStarted () serves the original method call once to initialize properly at all.

MissionNumberListener = -1 sets the script is also responsible for all the events charged Submission. Otherwise, you could specify here the (get the first loaded the mission number one, the second number 2, etc.) only the events of the currently running mission (mission number listener = 0) or only a certain SubMission Cinema. If you want to have to consider all the events of the missions mission number one listener to assign a negative value, eg -1.

So really we have already all that is needed to load the submission at the beginning.

Nor to the rest of the script and you're ready:

Code:

using System;  
using maddox.game; 
using maddox.game.world;
public class Mission : AMission 
{   
   public override void OnBattleStarted()  {  base.OnBattleStarted(); 
   MissionNumberListener = -1;  
   GamePlay.gpPostMissionLoad("missions\\Single\\Samples\\TestSubmissions\\TestSubMission1.mis");          
   GamePlay.gpPostMissionLoad("missions\\Single\\Samples\\TestSubmissions\\TestSubMission2.mis"); 
   GamePlay.gpPostMissionLoad("missions\\Single\\Samples\\TestSubmissions\\TestSubMission3.mis"); 
   }  
}  

As mission designers really need to customize only the number of submissions to be loaded and the path and name.


But since it is known can never harm an example . We modify our previous lesson from the already well-known example:

using System; using maddox.game; using maddox.game.world; public class Mission : AMission {

   public override void OnBattleStarted()  {  base.OnBattleStarted(); 
   MissionNumberListener = -1;  
   GamePlay.gpPostMissionLoad("missions\\Single\\Samples\\TestSubmissions\\TestSubMission1.mis");          
   GamePlay.gpPostMissionLoad("missions\\Single\\Samples\\TestSubmissions\\TestSubMission2.mis"); 
   GamePlay.gpPostMissionLoad("missions\\Single\\Samples\\TestSubmissions\\TestSubMission3.mis"); 
   }  

}

описание