Chapter 5 - cmbasnett/Blitzkrieg2EditorManual GitHub Wiki
Creating a mission
Creating a mission – is the process of filling the previously created map with the objects and events, setting up the parameters and objectives, creating the map name, description etc.
In case of single player mission, an important part of the process is setting up the computer opponent (AI General) and scripting the mission.
The experienced users and enthusiasts can link the self-made music play lists to the map for the custom soundtrack. Creating in-game engine movies is also possible.
Player’s parameters
The group of parameters Players is responsible for all settings of the playing sides. Further we will consider in details only those parameters, which are not described in the special sections.
| Property | Description |
|---|---|
Camera |
Setting the start camera (For details see Chapter 5-03-1 Setting Start Cameras) |
General |
Setting AI General (For details see Chapter 5-08 – AI General) |
PartyInfo |
Choosing the side of the player in the single player game. Also chosen when creating a new map. |
ReinforcementsPoints |
Reinforcements points (For details see Chapter 5-05 Reinforcements) |
ReinforcementsTypes |
The types of reinforcements available in the mission (For details see Chapter 5-05 Reinforcements) |
DefaultRank |
The military rank given to AI General in the single player game or to the player in the multiplayer game. |
DiplomacySide |
Choosing the side of the player. You can between 0,1,2. Teams (and players), assigned as 0 and 1 – are always enemies. At that 0 is always assigned to the user (the side, for which the user will play in the single player game). Accordingly, in the multiplayer game the players who have the same value (0 or 1) will play in one team. “2” is always used to specify the neutral side. |
RecycleTimeCoefficient |
assigns the coefficient of reinforcements recycle time. For example, the standard alert of the reinforcements for call, after calling medium tanks, is 30 seconds. If the coefficient preset is, for example, 0.8, the player’s alert for calling these reinforcements, after calling medium tanks, will be 24 seconds |
ReinforcementCalls |
the number of the reinforcements calls available to the player (For details see Chapter 5-05 Reinforcements) |
LocalizedPlayerNameFileRef |
used for identifying the side as, for example, a historic personality, the user or AI General can play for. |
MPStartPos |
used to mark flags coordinates on the mini-map in the multi-player game (For details see Chapter 5-03-2 Setting Multiplayer Start Position) |
ScriptReinforcements |
not used |
ScriptReinforcementsTextID |
used to give a name to the units, which can be called by this name in the script afterwards. |
SuperWeapon |
using this parameter you can make the call of the ultimate unit as reinforcement available to the certain side (For details see Chapter 5-05 Reinforcements) |
Also, the item PlayerBonusObject refers to the player’s parameters, its functions and settings are described in Chapter 00-00 Reinforcements.
Start Cameras & Multiplayer Start Position
When creating any map, for a single or multiplayer game, you should appoint positions of the start camera for the players.
The start camera defines the position, where the player starts a game, and is set for every player separately.
For the single player game it is reasonable to set the start camera only for Player 0 and in the multiplayer game – for all players, whose positions are specified in the editor.
At the beginning of the multiplayer game the start positions of one side are distributed randomly between the players of this team.
Setting Start Cameras
To set the position of the start camera, choose the tab Start Cameras in the section Gameplay of the toolbar.
Choose the player, for whom you set the position of the start camera.
After that orient the view of the map so that you want the player to see it at the beginning of the game.
Then press the button Set. The marker, which identifies the position of the start camera for the player, will be displayed on the map in the centre of the visible space.
In the same tab you can choose one of the two variants:
Set Only Position for Camera – when setting the start camera only the camera coordinates are saved. Accordingly – the user will start the game in these coordinates with the standard height of the camera. Set All Params For Camera – when setting the start camera the coordinates and the height of the camera above the map are set.
All parameters of the start cameras are also displayed in the field Players\Camera in the table of the map properties. Vary them only if you are an experienced user.
Setting Multiplayer Start Position
In the multiplayer maps properties you should specify the coordinates of the flag, highlighting the start position of the player of the team, if he participates in the game.
You can do it varying the value of MPStartPos parameter in the parameters group of the player present on the map.
The parameter MPStartPos has only two values – coordinates x and y – it is enough for displaying the flag on the minimap.
Enter the values of the coordinates of the main (start) reinforcements points or key buildings, belonging to the player, in round figures.
Final Positions
When creating singleplayer missions it is recommended to show the player, what was the reason for the victory or defeat. I.e. to show the spot on the map or the object, which the player captured / destroyed or, on the contrary, did not defend. Otherwise, after completing the missions the automatic camera shows the spot of the map, which the player saw, when he was completing the mission.
To do it use the special parameter Final Positions in map properties.
Final Positions – points, which will be automatically displayed in the view of the script movie when the player is winning or losing in the mission.
Reinforcements
In the mission the Player (or the other participating side) can get the extra mechunits and forces for command.
There are two main ways of transferring units for one side’s control – calling units from the reinforcements pool with reinforcements call interface or transferring units for one side’s control with the script.
Further we will name the units, called by the player from the reinforcements pool, reinforcements, and the units, transferred for the player’s command with the script – bonus units.
The number of the calls and reinforcements types available for every mission cannot be changed during the mission.
To allow the player to call reinforcements in the game – for every map (mission) reinforcements types and staff, available in this mission, their number and reinforcements respawn points must be indicated.
Also the recycle time coefficient for reinforcements can be given.
Choosing reinforcements types from those available
To choose the reinforcement’s type and staff switch to map properties and find the players’ (sides’) settings present on the map.
Choose the player, whose list of available reinforcements will be edited.
Choose the line ReinforcementsTypes
Add as many reinforcements as needed – every reinforcement added specifies the type and the staff of the reinforcements group, which can be called.
Left-click in the column Value for the reinforcement needed to specify the type and staff of this reinforcement.
Press the button with the ellipsis to choose the type of reinforcements from those available or the button new to create a new type of reinforcements.
In case the new type of reinforcements is being created you need to enter its name. For the further setting the reinforcements of this type it is necessary to press the button with the ellipsis (For details of creating the new type of reinforcements see below).
In the window opened the list of all reinforcements as the tree is displayed.
As qualitative and quantitative units staff has been changed significantly during WW2 all reinforcements types in this list are in the folders of missions, chapters and campaigns of the corresponding historic periods.
Important note: Be careful when using reinforcements assigned for B2 missions! If you change the reinforcement attached to the mission, it will affect the gameplay. So, if you want to change the reinforcements type – first copy it to the other file and only then edit it.
Creating your own reinforcements type
Besides reinforcements, created by B2 designers, you can create you own reinforcements types.
Information on reinforcements and their parameters to be set consist of the following (the information given further concerns only the parameters, changing and setting which is reasonable):
Type
In B2 game all units store the experience. After completing the mission the experience, stored by different units is accounted to that TYPE which these units were assigned to.
For example, if you create a reinforcement and specified its type as LIGHT TANKS, but included assault infantry squads, all experience got by this infantry will be accounted to the type light tanks. As this method is not correct, it is recommended to set up correspondence between the reinforcement’s type and their staff.
If the unit is on the map initially, the experience saved will also be given to the corresponding reinforcements type. The correspondence table is available in
AIGameConsts.
To choose the reinforcements type – left-click in the column value for the Type parameter and choose the type needed in the list-box.
There are 21 reinforcements types in the game
Important Note: Changing the following parameters is recommended only for creating MODs (IconTexture, LocalizedNameFileRef, TooltipFileRef, LocalizedDescFileRef)
If you are working with the reinforcement just created, it is necessary to add as many entries in this field, as many units you are planning to include in this reinforcement
Setting reinforcement units parameters (in the field Entries)
MechUnit
This field is used for the mechunits – armored units, artillery, air forces etc. – you should identify the unit in the line.
Squad
Identify the infantry squad in this field.
Important note: you cannot identify a mechunit and an infantry unit in one Entry simultaneously!
LinkIndex
In the case, when the units staff includes units, acting together or depending on each other (for example, artillery, needing to be towed, or paratroopers, needing to be transported), you should identify LinkID, which value must be entered in the field LinkWith of the unit, which is dependent on this one. In case, when the value of this field is -1, linking is not possible.
LinkWith
You should enter the value of the parameter LinkIndex of the unit, to which you want to link the current unit. If the value in this field is -1, linking is not possible.
In the picture you can see two units, one is linked to the other (the value of the field LinkWith of one unit is equal to the value in the field LinkIndex of the second one).
Defining the number of reinforcements calls
To appoint the number of available reinforcements calls, find the line ReinforcementsCalls in the map properties and set the value you want.
Recycle Time Coefficient
Setting the RecycleTimeCoefficient you can vary the recycle time of the next reinforcements call after processing the previous call.
For every reinforcements type there is a defined recycle time of the next reinforcements call.
By default the field RecycleTimeCoefficient has the value 1. It means that recycle time of the reinforcements call for this player is 100% of the time fixed by developers. If this parameter is equal to 0.4, accordingly, the reinforcements recycle time for this player will be 40 %, (i.e., 2.5 times faster).
Reinforcement Points
To give the player the possibility to call reinforcements, at least one reinforcement point must be shown on the map.
During the game all reinforcements called arrive through the nearest available reinforcement point.
For calling reinforcements on the map there must be one reinforcement point at the minimum
Placing reinforcement points on the map
For placing reinforcement points on the map switch to the section Gameplay in the Tools Window and open the tab Reinforcement Points.
Reinforcement Points are unique for every player (side), so make sure, that you have chosen the desired side when placing reinforcement points.
To add a reinforcement point on the map, press the button Add to the left of the player’s options field.
The reinforcement point will be displayed on the map automatically. The picture shows that the new reinforcement point was added to the list (point 2), at that in the field Deploy template there is no appointed template of reinforcement call in this point.
The reinforcement point is the circle of a small diameter with one control point (point 1 in the center), which defines the reinforcement point coordinates, a vector of orienting datum line y of the deployment template (point 2) and a special airforces respawn point (point 3), which is connected with this reinforcement point, but can be placed at any distance from it.
The reinforcement point center (the control point in the center) is the origin of coordinates for the deployment template of the reinforcement called. I.e. the reinforcement point center will be the zero coordinates for the deployment template. (for the details of the deployment template parameters see below)
In most cases, especially on the multiplayer maps, reinforcement points are linked with key buildings. About linking reinforcement points and key buildings see below.
Reinforcement point parameters
Besides parameters described above, every reinforcement point has such characteristics as Deployment template, attribute to the player and Typed Template.
The most important of them are the Deployment template and the Attribute to the player.
Deployment Template
Using deployment template you can set any units formation in the reinforcement called.
For example, when the reinforcement called appears on the road, and it is needed that the units form a column to be adequate for moving along this road. The opposite example, when the reinforcement called must march in deployed formation on the open area.
To set the deployment template for the reinforcement point choose the point in the list of the points already deployed on the map and press the button Deploy Template.
In the list displayed choose Common DeployTemplate and press OK. In most cases assigning the other or additional Deploy Templates are not required.
However, if you want to appoint the deploy template separately, use the function Typed Template (see below).
The attribute to the player (The parameter is default)
Every reinforcement point can be assigned by default as belonging to the player from the beginning of the mission. To do it in map properties in the setting reinforcement points for the player in the line IsDefault enter true. Then the reinforcement point will belong to the player from the beginning of the mission.
The point with IsDefault = true is available to the player when starting the map, even if the key building does not belong to him. After the first capture the point will work in a usual way.
Important note: As a rule, on multiplayer maps only one reinforcement point initially belongs to the player (i.e., the parameter
IsDefaultistrue).
Typed Template
Typed Template is used when the map designer is not satisfied with Common_DeployTemplate for some reasons. Assigning Typed Template for the reinforcement point is not necessary.
To assign Typed Template press the button Typed Templates. The list Typed Template will be displayed for this reinforcement point. Press Add to add a new template.
In the window displayed choose the type and reinforcement respawn template for this reinforcement.
You can choose several typed templates for this reinforcement point, if you need to.
Key Building
As most reinforcements points on the map do not usually belong to the player from the beginning of the mission, it is necessary to capture them and transfer for the player’s control. Therefore, the mechanism of capturing them is needed.
In Blitzkrieg 2, acquiring additional reinforcements is triggered by capturing key buildings.
To create a link to a key building and a reinforcement point you will need three elements:
| /images/image-125.jpg |
|---|
| A key building (1), a flag (2), and a reinforcement point (3) |
Deploying a key buildilng
To create a key building you need to deploy one of the buildings available in the tab map objects in the section objects of the tool window on the filter buildings (except the object "Pig").
Now you need to deploy a special object - flag - which will be captured by different players. To do it in the tab map objects choose the filter flags (objects filter group). Choose the first (blue) flag from the list and put it next to the building, which will be the key one.
Deployment of the flag at the great distance from the key building, it is linked with, may cause problems when setting the map balance.
The map will look like this:
Linking the key building with the flag
To link the key building and the flag, captured which the player will get the control of the key building, you should enter the value of the flag LinkID parameter in the line LinkWith.
I.e. – we see the value of the flag LinkID and enter it in the line LinkWith in the properties of the building linked with it.
Assigning a bonus object
To complete the creation of the link “key building + reinforcement point”, you should specify the key building in the map properties as a bonus object and add reinforcement points connected with this object.
To do it find the line PlayerBonusObjects in the map properties.
Add the bonus object
The information on the bonus object will be as follows:
The values of the parameters of the bonus object are the following:
| Property | Description |
|---|---|
LinkId |
to enter the value of the parameter LinkId of the key building (which was created before). |
PlayerBonuses |
to enter the reinforcement points, one for each side, reinforcement points, linked with this key building (see below). |
Storage |
is chosen to indicate if this key building an ammunition depot or not. |
Setting Player bonuses
To give the players control of the reinforcement point when they capture this bonus object you need to specify for every player PointID of the reinforcement point, which the player will take over.
In the line PointID you should enter the ordinal number of the reinforcement point of this side. If you do not want to give the player control of the reinforcement point – leave the value of this field -1.
Note, that for every side you can add only one reinforcement point linked with this bonus object.
To complete the creation of the bonus object enter the LinkID and specify if this building an ammunition depot or not.
If everything has been done correctly, you have the bonus object ready, after capturing it the sides will get control of the fixed reinforcement points.
Unit Start Commands
To make the map active at the beginning of the mission (for example, to build entrenchments, attack with the allies forces or the enemy forces, show some events etc.) you can set start commands to the units. For every unit you can appoint several commands, which it will execute according to the queue.
The player can take back the control of the units, which are executing start commands. The same is true for the computer opponent’s units, which were transferred to AI General’s control.
Important note: If the start commands are assigned to the computer opponent’s units, it is recommended not to give these units to AI General’s control.
Assigning start commands
Start commands can be assigned only to the units already deployed on the map.
To assign start commands switch to the tab Unit Start Commands in the section Gameplay of the Tool window.
Select the unit, to which a start command will be assigned (you cannot assign the start command to the unit without selecting the unit).
Press the button Add for adding the command.
In the window displayed in the list-box type select the command you want to assign to this unit.
If the command presumes the target or the point on the map (for example – attack unit or move to point) – without closing the window of assigning start command left-click on the map surface and point the target or the destination point on the map. The target or destination coordinates will be displayed in the field Target of the start command window.
After that confirm the assigning the command pressing the button OK.
The list of assigned start commands
All assigned start commands appear in the list in the same tab. You can see both all assigned commands and commands for every unit (you should select the unit, whose commands you would like to see).
The list includes start commands for the units of all sides participating on the map. You cannot see start commands of the units of only one side.
When choosing the command in the start command list you can see the destination point or the target of this command.
You can vary the queue of the start commands both in the general list and in the command list of the unit. To do it use the buttons Up and Down.
For deleting a command from the queue use the button delete.
AI General
AI General is the enemy’s artificial intelligence, which is capable to fulfill a number of tasks and to work with the definite zones of attention. AI General uses the same means and possibilities, which the map designer assigns it with the help of scripting and map editor functions.
The map editor function “AI General” is the main and the most commonly used tool for forming and setting the basic actions of the computer opponent in the single player game.
Only the computer enemy can possess AI General, i.e. neither the player nor his allies, not to mention the neutrals, can possess AI General.
AI General's functions
AI General's abilities
AI General can call the reinforcements and manage the units, which are under its command, estimate the situation on the map, check the state of the attention zones, defend itself and attack.
At the same time AI General can manage artillery, air force, mobile combat and auxiliary units, but it cannot use infantry, antitank artillery, ships and recon aircraft.
AI General can repair mobile combat units and resupply their ammunition.
Map estimation
AI General can estimate the situation on the map. For that the entire map is divided into relative squares and for each in real time the level of the potential danger is estimated, based on the total cost of the ground-based troops or enemy’s artillery in it. The aircraft are not taken into account when considering the danger for the squares (in case there are enemy bombers/attack aircraft on the map, AI General always tries to call fighters).
AI General can discover enemy troops and artillery as the player – “visually” for all types of the units and also “by ear” for the heavy artillery.
The cost of every unit is estimated on the basis of the default “price” for all units of these combat arms, and also the unit’s quality itself. For example, let us consider a medium tank M4A1 Sherman. The default price for all medium tanks is 70, the multiplier of Sherman’s quality is 1.
Accordingly, the price of the tank Sherman is 70 points. So, if there are 10 tanks Sherman in one square, the danger level for this square will be estimated by AI General as 700 points.
The information on the cost of all units is in the file
consts.cfg, in the folder<Blitzkrieg2>\Data\Profiles.
AI General makes the decision what to do with every square taking into consideration the danger level, set to every square. The decisions are made with the definite periodicity, in equal periods of time.
There are two main levels of danger:
The first one is low danger. This category includes those squares, in which the number of the discovered enemy troops was not very big (total cost up to 300 points). Having discovered such squares AI General tries to direct the long-range bombardment at them.
The second one is high danger. The average number of the enemy troops (total cost from 300 points). First the air force is sent, and then the artillery bombardment starts.
Mainly, the tactical decisions on the ground-based troops are made by AI General on the basis of the specific zones, assigned by the map-designer at the stage of designing a map. For details see below (Chapter Setting AI General).
In the presence of several danger squares, the AI General always chooses the square with the highest priority and starts to process it. The square is considered to be processed after all the possible actions were performed for it: the air force was sent and the bombardment was completed. Note that the duration of one bombardment is regulated by a constant (see the file consts.cfg).
The estimation of the map is made by General with the definite recurrence. At the same time, at the end of every cycle, the General "forgets" about the levels of danger for every square. It is done with the purpose of avoiding endless processing of the squares by General on the basis of stale data.
Reinforcements query
The AI General can call any available reinforcements any time it has such an opportunity. Also, the General checks every second call – if there is a query for the air force call, and, if there is such a query, it calls the corresponding air force instead of the ground-based troops.
The General can call any types of reinforcements, at the same time it can use only tanks, self-propelled guns and aircraft (bombers, attack planes and fighters). Accordingly – General cannot use infantry, artillery and so on, although it can call them.
Therefore, it is recommended to assign for AI General as reinforcements only those he can make use of – tanks, self-propelled guns and aircraft.
On every map the maximum available number of calls is established for the General, after having used up which, General cannot accomplish reinforcements calls (equal to the restricting the number of the calls in the missions for one player or in Blitzkrieg 2 campaigns).
At the same time it is recommended to restrict also the maximum of the number of AI General’s units on the map. To do so, put an appropriate value in the field MaxMobileTanks.
For example, if the number of General’s available calls is 20 and there are no restrictions, the General will spend all the available calls one after another. But if the number of the already called reinforcements on the map is restricted by ten (MaxMobileTanks = 10), General will call, for example, 5 of their reinforcements by 2 tanks and after that it will wait for the change of the number of the units, which are already on the map.
Troops in the called reinforcement get into the reserve, from which they can be called to fulfill some task. All the reserve troops are directed by the AI General to the reserve build up zones. (For more details about different zones, assigned by map-designers when setting AI General, see below).
The query for the air force call is made in two cases: if there is a square with the danger level needed (bombers/attack aircraft are called), or, if the enemy bombers/attack aircraft were detected on the map – fighters.
Called aircraft can fly in swarm mode from the respawn point to the target point, therefore, the air force respawn point for the computer is better to be placed close to the ground-based troops respawn point.
In the swarm mode air force attack all the targets on its way.
It is necessary to minimize the duration of the flight above the player’s territory; otherwise, on the way there can be some targets unknown to the General before, which will distract the called aircraft from their main task, what will decrease efficiency of General’s actions.
For example – if the AI General’s air force respawn point is located in the place easy to reach by the enemy – coming air force can be easily engaged in the fight, and, thereby, it will diverted from the fulfillment of its main task.
Important note: When calling the air force, the AI General does not consider the presence of the players' anti-aircraft artillery on the map.
Attention zones
Attention zones are the zones set in the map editor, demanding the AI General’s attention according to the coefficient of significance.
The attention zone is the universal zone either for the attack or defense. Each attention zone has the constant starting significance coefficient by default. This coefficient defines priority of the zone under other equal conditions. The actual coefficient of significance of the zone is assessed on the basis of the starting significance coefficient minus amount of all values of General’s units in the zone plus amount of all values of Player’s units in the zone multiplied by two (the multiplier *2 is used by the AI General for creating the decisive advantage in the zone).
If the significance coefficient of the zone is higher than the amount of all General units in the zone, General will send additional forces to the zone in the presence of spare forces (reinforcements calls or units as reserve), at that the actual amount of the forces to be sent will be equal: (The zone’s starting significance coefficient – General’s amount of forces) + amount of Player’s forces*2(the coefficient of the desired advantage), where signifies the number of the times General’s forces must exceed Player’s forces to provide the guaranteed victory.
For example: we have the attention zone with the significance coefficient
1000. In this zone there are General’s forces of the amount200and Player’s forces of the amount1000. On the basis of calculations(1000-200)+1000*2General will try to send forces of the amount2800to this zone.
In case General actions processing the zone turned out to be ineffective (General troops were destroyed), General launches a new attack. In case General’s actions processing the zone turned out to be effective (all enemy’s troops were destroyed in the zone), the amount of forces equal to the zone’s starting coefficient remains in the zone, and others are called to the reserve zone.
Reserve zone is the zone where General builds up surplus of the called ground-based forces (which are not required at the moment). This zone type does not possess the starting significance coefficient, also, General’s or Player’s forces presence in this zone is not taken into account, i.e. General will react at the enemy forces presence in the zone as at the usual squares of the map. If General has several reserve zones, spare forces will be distributed among them evenly.
With the certain periodicity, the General defines if there is a query for the help from some attention zone. If so, the General defines the reserve forces nearest to it and sends them to the corresponding zone. At the same time, reserve forces can be as called reinforcement, as well as forces which were initially on the map and assigned as mobile reinforcements.
If there is the query from several attention zones simultaneously, first General processes the query from the attention zone with the higher actual significance coefficient.
If the General possesses forces to satisfy queries only from one zone, all reserve forces will be sent to that zone, and the rest zones will be ignored until the next estimation of priorities.
In case all the actions to the attention zones are accomplished and AI General has spare units, it can launch an attack at the nearest bonus object (key building) or, if enemy’s units are detected, launch an attack at them.
Units management
Besides units management during attack, defense and reserve, the AI General has the ability to repair mobile combat units and resupply them. To do this, the General must have units with appropriate abilities in the mobile reinforcements. When it is necessary to repair or resupply any of the General’s units, one of the support units will be selected and sent to fulfill the corresponding task.
The fact that General has no ability to manage absolutely all units of the specific combatant is especially worth mentioning. The AI General can manage only those units which are given to it as mobile reinforcements, called as reinforcements or passed to it with the help of the script (for details see mobile reinforcements).
All the units called by AI General as reinforcements automatically get under its control.
AI General tool assignment
The AI General setting tool in the editor simplifies setting the tasks, the most often used for scripting actions of computer opponent’s AI General are Zone defense, Zone attack and Units (mobile combat units) management. In the editor there is a function of setting AI General exactly for facilitation of scripting these actions of the computer opponent.
AI General setting consists of the following steps:
- Assigning the units managed by AI General from the very beginning of the game (mobile reinforcement)
- Attention zones settings and defining
- Reserve zones defining
For AI General setting open the tab AI General in the section Gameplay on the Tools window.
Before you start setting AI General make sure that you have chosen the appropriate side. The AI General cannot belong to player, their allies or neutrals.
In single-player missions, the player’s opponent is the side which has a
DiplomacySideof1. Accordingly, the player with aDiplomacySideof1can have an AI General.
When setting AI General make sure that the player chosen is not the Player’s opponent.
Mobile reinforcement
Mobile reinforcements are the units which are under AI General command or are transferred to its command.
Altogether, there are three ways or transferring units to the AI General's control: the Mobile reinforcements Tool in the map editor, scripting, and calling reinforcements by the AI General itself during the game.
Mobile reinforcements assigning with the help of the map editor
Mobile reinforcements are assigned by putting their ScriptID in the list MobileScriptIDs on the tab AI General in the section Gameplay of the Tools window.
You can put mobile reinforcements in this list both before placing objects on the map and afterwards. But in any case all units planned to be transferred to the General must have ScriptID, different from the value -1.
All operations of placing units on the map and assigning ScriptId to them must be performed with the help of the tab Objects, section Objects of the Tools window.
To add script group to the list of General’s mobile reinforcements press the button Add to the right of mobileScriptIDs in the upper part of the tab AI general.
In the opened window Mobile Reinforcements enter ScriptID of the corresponding unit or the script group.
The line with the sequence number of mobile reinforcements transferred to General appears in the list of mobile reinforcements.
Transferring units for General’s control using scripts
Besides assigning mobile reinforcements with the help of map editor, when the units being transferred for General’s control are already on the map, there is the possibility to transfer units for General’s command using script.
But at the same time ScriptID of all units planned to be transferred for General’s control must be registered in the section Mobile Reinforcements of the map editor.
For more details about transferring units for General’s command see section Scripts.
Zones assigned with the map editor
With the help of the map editor, it is possible to assign and set attention and reserve zones for the AI General.
On every map there must be placed at least one attention and one reserve zone, so that the AI General could be in command of the transferred to it or called as reinforcements units.
Important note: Maps without attention zones and reserve zones can operate incorrectly for the AI General! For example – when calling reinforcements and in the absence of calls for their usage AI General will not know what to do with them.
Assigning and setting attention zones
Attention zones are universal zones, used for assigning AI General such tasks as defense and attack. In principle there is no difference between the zones, designed for defense or attack, this division is absolutely relative. AI General performs the same actions for attention zones
assigned both for defense and attack, so their difference is only in the degree of availability and initial filling with the General’s or enemy’s forces.
Accordingly – if you want to assign defense zone for General – provide AI General with the possibility to fill it with the forces before the enemy forces arrive. And the attack zone must be initially placed on the enemy’s territory and filled with the forces, hostile to AI General.
The whole process of assigning and setting attention zones is divided into four stages:
- Placing attention zone on the map
- Defining zone type
- Defining zone’s significance coefficient (if it is a Defense zone)
- Assigning preferable positions within the zone for occupying them with the forces
Placing attention zone on the map
To place AI General’s attention zone on the map in the bottom part of AI General tab press the button Add to the right of the heading Parcels.
The red contour of the future zone will appear on the map automatically, provided with two guiding points – in the center and on the border. With the help of them it is possible to move and change the size of the attention zone as during placing units or other objects on the map.
Defining zone type and significance coefficient
After placing the zone on the map it is necessary to define its type. Zones without the definite type remain red. Attention and reserve zones are green and yellow correspondingly.
For that, double left-click on the corresponding line in the column Type.
In the opened window it is necessary to choose the zone type. By default the new zones are defined as unknown. All zones of this type are not identified or processed by AI General. For defining AI General’s attention zone choose zone type defense.
In the following line set the zone’s significance coefficient. This coefficient will be basic for estimation of the total cost of the forces, which General should bring to this zone. If the zone’s significance coefficient is not set (i.e. equal to 0), the AI General will direct its forces to this zone only in the case when the enemy’s forces are detected.
After pressing OK this zone must becomes green on the map surface.
Assigning preferable positions within the zone
Within the zone it is possible to assign several positions, which are the most suitable for placing AI General’s forces according to the map designer.
These positions do not restrict the quantity of AI General’s units, which can be sent to the current zone, they are of a recommended character. The quantity of units, which AI General will send to the zone, will be estimated on the basis of the zone’s significance coefficient.
To assign a position right-click within the existing attention zone. You will also be able to define direction, in which the AI General’s unit, occupied this position, will be oriented.
Reserve zones differ from attention zones by three things: AI General reacts at the presence in the reserve zones enemy’s forces in the same way as at the other map squares; for reserve zones significance coefficient is not considered and the color of the zone on the map surface is yellow.
For assigning a reserve zone it is necessary to do the same actions as for assigning an attention zone, but choose reinforcements type.
All AI General parameters set with the help of visual tools are reflected in the map properties in the corresponding field.
Besides units under AI General command or managed with the script, there are units, which the map designer placed as belonging to the same side, but did not transfer them to AI General command and does not use them in the script.
Such units are completely effective and possess enough intelligence, which allows to attack the enemy and pursue them within the borders of a certain zone.
The possibility not to transfer units for the AI General’s command is set for map designers.
After completing all operations on setting and assigning attention and reserve zones the AI General’s list of the zones will be as follows:
The colums are:
Column | Description
| Zone number
Points | The number of unit positions in this zone Position | Zone coordinates on the map Importance | Zone value (the total cost of the units, which will be counted by AI General – how many units to send here) Type | Zone type (DEFENSE, REINFORCE or UNKNOWN)
Making script
Script and writing it is the invisible part of an iceberg when working on missions for a single player game. All you want to see in missions as events, sides’ actions, objectives, given to the user, or even the victory or defeat is described with the script.
Important Note: For creating a multiplayer map scripting is NOT needed.
Using script in B2 editor you can do practically everything – place / remove the objects, plan attacks and different events on the map, define the victory and defeat conditions and the so called triggers – events launching the chain of the other events.
As compared to writing script for B1, when all work, in fact, was done in the text file, B2 editor has the special script editor, which makes scripting missions easier – the new editor highlights script syntax, reports on the function having been typed incorrectly and displays the list of functions available after typing several first letters.
Important Note: All script functions are case sensitive.
B2 scripts are based on the modified language LUA. So, if you already know this language, writing scripts for B2 will be much easier.
Important Note: This manual cannot cover all information on scripting for B2, so only the main information is represented in it. To learn more – visit the Blitzkrieg 2 official site and forum.
Writing and editing the script
To run the script editor and start writing a script for your mission, find the line ScriptFileRef in map properties (MapInfo).
Create a new script or open one of the ready ones (as a template).
The script editor with the script loaded looks like this.
All further information on scripting missions you can find in Appendix - Script Functions or at the official forum of the game.
Script Areas
When creating single player missions script areas are used almost in all cases when scripting events and objectives of the user.
Creating script areas
To create a script area, open the tab Script Areas in the section Script on the Tools toolbar.
Choose the area type – a circle or the rectangle.
Left-click on the map to mark the center of the future script area (a little red circle will be displayed on this place).
After that set the radius (if the type of the marked area is a circle) or the distance from the center to the corner or the area (if it is a rectangle).
Two red circles will be displayed on the map, connected with a line, and you will be offered to give a name to the new area.
You can give a name to this area both in figures and in letters. At that, if you are creating several script areas, you should give them unique names to use them when scripting missions.
After creating a script area its name and type is displayed in the list in the same tab.
There are two buttons above the list, Delete and Select. Using them you can delete an area from the list or find it on the map quickly.
Moving the area and changing its sizes
After placing the area it can be moved as any other object on the map or its sizes can be changed.
You can do it with two control points in the center and border of the area.
Objectives
When creating a single player map one of the key moments is giving current objectives to the user during the mission.
Creating and setting the objectives, given to the user in the game, consists of the two main stages:
- Creating and setting an objective in map properties (
MapInfo) – the parameterObjectives. - Describing the functions of this objective in the script (
ScriptFileRefin the map properties).
Creating Objectives in the map properties
Find the parameter Objectives in the map properties.
Add one or two objectives.
Choose the objective you will fill and left-click in the column Value of the corresponding line.
Create a new objective and enter the file name, where the objective parameters will be saved.
Now you should set objectives parameters. Switch to object properties. The list of the parameters to set will be displayed.
HeaderFileRef and DescriptionFileRef
These parameters usually specify the objective name and its description, they are filled as usual.
BriefingFileRef
Not used.
IsPrimary
This parameter defines if this objective is of top-priority. At present this parameter must always be true, as the value false is not used.
MapPosition
To display markers, indicating the place of buildings, on the map you should add these markers to the parameters group MapPosition. Add as many markers as you need.
After that you should assign coordinates to every marker, which will define its position on the map and minimap. Coordinates are typed according to the place of the object on the map or approximate coordinates of the region. To get to know the coordinates point the cursor on the place you need in the editor and the mouse cursor coordinates will be displayed in the right bottom corner of the editor – in the status bar.
Experience
Using this parameter you can define how much experience the player will get after fulfilling this objective within the campaign. When creating maps for the single player game or multiplayer – it does not matter.
Describing objective functionality in the script
To make the objective function it must be fully described in the script with the other available commands (For details see Appendix - Script Functions).
The main functions needed for making this objective work are GiveObjective and CompleteObjective.
To describe the objective functionality you often need to use either objects ScriptID, which are mentioned in the objective description or script zones TextID, set with the editor.
For studying script commands and the rules of describing script events see Chapters 5-12.
Making Script and Appendix - Script Function of this manual and visit the official forum of Blitzkrieg 2.