0_Index

Blitzkrieg Map Editor Application:

This application allows to create and edit maps for Blitzkrieg game. The maps are saved to hard disk in one of two formats:

  • BZM - internal maps format; maps saved in this format can be edited only with this Blitzkrieg Map Editor
  • XML - external maps format; maps saved in this format can be edited both with this map editor and external XML-file editors
To use created/edited maps in the game, they must be stored in \data\maps\ sub-directory of the game directory.

To use certain functions of the editor (scrolling through various lists or searching for files), the resources must be unpacked.

The application title bar shows the name of the file, its type (XML or BZM) and the size of the map measured in patches. One patch equals 16x16 VIS tiles. Star in title bar indicates that you should save the map.

Hot keys:

  • Ctrl + N - create new map
  • Ctrl + O - load map from hard disk
  • Ctrl + S - save map to hard disk into curent format
  • Ctrl + X - save map to hard disk into XML format ( XML-file )
  • Ctrl + B - save map to hard disk into BZM format ( BZM-file )
  • Ctrl + U - update map objects according to changes made to ground heights
  • Alt + F4 - Exit map editor
  • F1 - Call up help contents

When you create new map, there are a number of things you should worry:

  • Save often.
  • Blitzkrieg Map Editor load and save BZM maps more faster then XML maps.
  • If you have only BZM map, you can edit it only in Blitzkrieg Map Editor. It's a bad idea to edit XML version of your map with other XML editors.
  • Blitzkrieg Map Editor have no "Copy / Paste" and "Undo / Redo" features.
  • Many operations takes a lot of time on huge maps ( more then 16x16 ).
  • Don't forget setting appropriate diplomacy settings for your map.
  • Don't forget setting right troop descriptions for each player.
  • Set at least one appear point in troop descriptions for each player. Appear points can be added by double clicking on "Player[x]->Aviation->Appear points" leaf for player x.
  • Set right script path for your map. Only script file name ( without path ) is important, script file must be placed in your map folder.
  • Set appropriate initial viewing points for all players.
  • Each unit have a player number. Set the right player for all units!
  • To update objects and units vertical positions while editin terrain heights use the Update Button, or set immediate update mode.
  • Check objects' relationships (Check map button) to get a diagnostic message if any errors present.
  • To create game minimap image, press "Create" button in Minimap Bar. Game minimap image will be placed to map folder. Minimap image is in "TGA" format.
  • Try to use AI Settings on single players maps.
  • Always use width 6 for railroads
    • .
  • If you can't select particular unit by selection rectangle, please press Check map button.
    • .
  • Don't create circle-linked trains ( by dragging wagons over train ). Create only chain-linked trains.
    • .
  • All Composers ( menu "Tools" ) are used to create data for random map generation.
  • You may try to create your own "Field" to fill arbitrary regions with it. Also you can always use predefined "Fields".
  • Finally, Your must use your map created by Blitzkrieg Map Editor in some your custom mission created by Blitzkrieg Resource Editor. Your custom mission contains information about objectives, texts, music, etc.

Color dots on minimap displays object's positions. For every player there is a certain color:

  • 0
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6 White
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • last Neutral units

Blitzkrieg Map Editor © 2003 Nival Interactive. All rights reserved. Blitzkrieg is a trademark of Nival Interactive. Published by CDV Software Entertainment AG.

The following trademarks of other companies may appear in this manual:

Microsoft, Windows, Windows 98, Windows NT, Windows 2000, Windows XP, Excel, Excel 97, Excel 2000, Excel 2002, UDA, OLE DB and ODBC are registered trademarks of Microsoft Corporation in the United States and/or other countries.

Alias|Wavefront and the Alias|Wavefront logo are trademarks of Alias|Wavefront, a division of Silicon Graphics Limited.

Maya is a registered trademark and the Maya logo, Maya Artisan, Maya Complete and Maya Paint Effects are trademarks of Silicon Graphics, Inc., exclusively used by Alias|Wavefront, a division of Silicon Graphics Limited.

All other trademarks are the property of their respective owners.


1_Index

Blitzkrieg Map Editor services:

  • Create new map
  • Open existing map
  • Edit loaded map
  • Save map to hard disk
  • Create random map
  • Save references to previously opened maps (allows to open them again quickly)
  • Exit the editor
  • Fill map with particular terrain type
  • Set initial viewing point (camera position) for current player
  • Edit number of players, game type and diplomatic relations between players
  • Edit each player's troops properties
  • Set path to the file containing map script
  • Check objects' relationships
  • Update objects' positions in relation to ground
  • Set update mode (immediate or deferred)
  • Set objects levelling mode in relation to AI grid
  • Add new start command to selected unit's start commands pool
  • Edit selected unit's start commands pool
  • Set editing mode for artillery units' combat positions
  • Show/hide various map layers. The layers include:
    • Terrain
    • Grid
    • Wire frame
    • Depth Complexity
    • Terrain Microtexture
    • Black Stripes (removes protruding objects)
    • Units: (tanks, infantry squads ...)
    • Objects (buildings, hills, trees ...)
    • Bounding Boxes for 3D models (tanks, self-propelled guns, artillery units ...)
    • Shadows
    • Haze (shadowing remote scene edge)
    • Units Passability (passability of terrain to units)
    • Unit Fire Ranges (ranges and arcs of fire for selected group of units)
    • Selector
  • Show/hide various interface elements
  • Run Blitzkrieg with loading current map
  • Call up help contents
  • View information about the application, its developer and copyright
  • Edit terrain type within selected area
  • Edit ground heights, create 3D landscape
  • Fill selected region with predifined "tiles, objects and heights set" ( "Field" )
  • Set, position and remove objects, units, buildings, trees and etc.
  • Set, position and remove fences
  • Set, position and remove bridges
  • Set, position and remove trenches
  • Set, position and remove roads and rivers
  • Set, edit and remove script areas
  • Set, edit and remove groups of units (reinforcements)
  • Set AI parameters


1_0

Create new map

Click on "File", then "New…". Alternatively, use appropriate "File" toolbar button or Ctrl + N hot key.

Specify map size (1 - 32 patches); one patch equals 16 VIS Tiles:

  • "Size X" - for square map ("Square Map" box checked)
  • "Size X", "Y" - for rectangular map
Enter name of the map: "Name". If you do not specify full path, the map will be stored in "…\data\maps\" sub-directory.

Specify terrain type (season): "Season" (Africa, Spring, Summer, Winter).

Enter filename extension (BZM or XML). If no extension is specified, XML will be used by default.


1_1

Open existing map

Click on "File", then "Open…". Alternatively, use appropriate "File" toolbar button or Ctrl + O hot keys.

You can use "Tool 2" and "Tool 3" in "Tools" menu to create all maps lists in "..\data\data.pak". Enter obtained map name and map will be opened from packed "..\data\data.pak" file.

File type is determined by extension.


1_2

Edit loaded map

When the map is loaded, the application switches to editing mode according to selected section of the main toolbar. There are no general rules for editing maps; each mode has its own specific features. Please refer to appropriate sections of this document.


1_3

Save map to hard disk

Click on "File", then "Save". Alternatively, use appropriate "File" toolbar button or Ctrl + S hot key.

To save into another file, click on "File", then "Save As…".

To save into XML format ( XML-file ), click on "File", then "Save in XML" or press Ctrl + X hot key.

To save into BZM format ( BZM-file ), click on "File", then "Save in BZM", or press Ctrl + B hot key.


1_4

Create random map

Click on "File", then "Create Random Map...".

Enter template name in "Template" field; templates are stored in "…\scenarios\templates\" directory. To create list of existing game templates, click on "Tool 0" button in "Tools" menu. The list will also show the number of graphs in each template.

Enter context name in "Context" field; these are stored in "…\scenarios\chapters\..." directory. Each chapter has its own context. To create list of existing game contexts click on "Tool 1" button in "Tools" menu.

Enter graph number in "Graph" field (or -1 for random graph). If wrong number is specified, a random graph will be used.

In "Setting" field select setting for patches. Please be careful: if you select a setting not supported by specified template, the map will not be created. Selected template name (season) and context name usually suggest appropriate setting.

"Direction" - turns the graph at specified angle.

"Difficulty" - level of enemy units.

"Save as BZM" - if you check this box, the map will be saved in BZM format.

"Save As DDS" - if you check this box, mini-map for the map will be saved in DDS format (allows not to create another mini-map when the map is used in the game).

Enter name of the map in "Map" field (extension doesn't matter).

When the map is successfully created, it must be loaded into map editor in the usual way.

Map will not be created if you entered wrong path to any of its parameters (context, setting) or the template doesn't support specified setting.


1_5

Save references to previously opened maps (allows to open them again quickly)

To access recently opened maps list, click on "File", then "Recent Blitzkrieg Maps".


1_6

Exit the editor

Click on "File", then "Exit"; alternatively, use Alt + F4 hot key.


1_7

Fill map with particular terrain type

Click on "Map", then "Fill Entire Map". Alternatively, use appropriate "File" toolbar button.

Before you do that, switch to "Terrain" section, click on "Tiles" tab of the main toolbar and select tile type.


1_8

Set initial viewing point (camera position) for current player

Click on "Map", then "Player Camera". Alternatively, use appropriate "Map" toolbar button.

Before you do that, specify the player's number (either in "Settings" toolbar or in "Simple Objects" section of the main toolbar).

The camera will be placed in the centre of the screen.


1_9

Edit number of players, game type and diplomatic relations between players

Click on "Map", then "Diplomacy". Alternatively, use appropriate "Map" toolbar button.

"Players" command calls up list of players. In Single Player mode there are three players (0 - the human player, 1 - AI, 2 - neutral objects). In other game modes there can be any number of players (2 - 17). The last number is reserved for neutral player; i.e. if there are several players, there will be one less actually playing the game. If players are removed, all game objects not "owned" by a valid player (present in the list) will be attributed to the last (neutral) player.

"Add", "Remove": edit the list of players.

"Side 0"/"Side 1" - set the side selected players will fight on. There are two opposing sides in the game; players fighting on the same side have common war-fog. Units belonging to players of the same side do not attack each other.

"Game Type":

  • Single Player - One player against AI.
  • Sabotage - Multiplayer game. "Attacking side" must capture and hold one of the flags; the other side must not allow to capture any of the flags.
  • Flag Control - Multiplayer game with score (the more flags are captured, the higher the side's score).


1_10

Edit each player's troops properties

Click on "Map", then "Units Creation Info". Alternatively, use appropriate "Map" toolbar button.

The following properties can be edited for each player's troops (double-click on the value to change it):

  • Aviation - everything to do with aircrafts and airfields
    • Aircrafts - everything to do with aircrafts.
      • Scouts - edit scouts' properties
      • Fighters - edit fighters' properties
      • Paradropers - edit properties of aircraft used to transport paratroopers
      • Bombers - edit bombers' properties
      • Attack planes - edit attack aircrafts' properties
        • Name - aircraft type (any aircraft)
        • Formation size - number of aircraft of this type leaving at the same time for a mission
        • Count - total number of aircraft. If all aircrafts have been brought down, such aircrafts will not be flying anymore. If the remaining number of aircrafts is less than the one specified in Formation Size, only the available ones will fly
    • Paratroop squad name - specify the squad to be dropped off the aircraft
    • Paratroop squads count - specify number of squads to be dropped off the aircraft during one flight (for each aircraft)
    • Relax time - specify time span between flights in seconds (applies to all aircrafts)
    • Appear points - edit list of airfields (randomly selected points where aircraft will appear). The coordinates are measured in VIS tiles (VIS tiles grid)
  • Party Name - specify general style for special units (engineers, artillery crew etc.) and the player's type in multiplayer game

    •


1_12

Check objects' relationships

Click on "Map", then "Check Map". Alternatively, use appropriate "Map" toolbar button.

"Check Map" command is invoked automatically every time you save the map, but no diagnostic message is displayed.

The following is checked:

  • Links between objects (soldiers in trenches or buildings, lorries with cannons, steam engines and carriages between themselves)
  • Identical objects placed at the same point (it happens if an object is placed at the same point as the previous one)
  • Valid "ownership" of objects (if players were deleted, there may be objects "owned" by removed players)
After the map is checked, a diagnostic message will be displayed; the results will also be recorded in …\data\checkmap_log.txt file.


1_13

Update objects' positions in relation to ground

Click on "Map", then "Update Map". Alternatively, use appropriate "Map" toolbar button.

Updates objects coordinates in relation to ground. This operation takes time but recommended. If you expiriensed problems with roads or rivers editing - press "Update Map".


1_14

Set update mode (immediate or deferred)

Click on "Map", then "Instant Update Map Mode". Alternatively, use appropriate "Map" toolbar button.

When this button is pressed and ground heights change, objects will also go up or down accordingly.


1_15

Set objects levelling mode in relation to AI grid

Click on "Map", then "Fit Objects To Grid". Alternatively, use appropriate "Map" toolbar button.

When this button is pressed, objects are levelled using grid twice as dense as VIS tiles (to display it, click on "Layers", then "Grid").

It's recommended to keep this button pressed at all times.


1_16

Add new start command to selected unit's start commands pool

Click on "Unit", then "Add Start Command". Alternatively, use appropriate "Unit" toolbar button.

Before you do that, switch to "Simple Objects" section of the main toolbar and select the appropriate unit(s).

The following properties can be edited in the "Unit Start Commnad Property" window (double-click on the value to change it):

  • Command - Command type. Determines which of the other fields will be available
  • Units - Number of units the new start command will apply to. Cannot be changed; displayed for information only
  • Position: x and y - Coordinates of the point the command is linked to. Measured in VIS tiles
  • Parameter - Command parameter; value depends on command type
Please refer to Map Editor Formats: Start Commands, for list of command types.

If a unit has several start commands, they will be executed sequentially.

When you edit start commands, you can click on the map to set the point the command is linked to.


1_17

Edit selected unit's start commands pool

Click on "Unit", then "Start Commands List". Alternatively, use appropriate "Unit" toolbar button.

Before you do that, switch to "Simple Objects" section of the main toolbar and select the appropriate unit(s). If the menu command (toolbar button) is grey, it means the selected unit(s) do not have start commands.

You can't sort the commands list - they are listed in the order of execution in the game.

When you start editing selected command, commands list closes.


1_18

Set editing mode for artillery units' combat positions

Click on "Unit", then "Artillery Positions". Alternatively, use appropriate "Unit" toolbar button.

Before you do that, switch to "Simple Objects" section of the main toolbar.

When you switch to this mode, the existing links are shown with green lines: vehicle, artillery unit - combat position. Self-propelled artillery units do not have vehicles. Train-based artillery units also can be assigned combat positions.

If you set combat position for artillery unit and it needs to fire (according to AI decision), it will first move to the specified point and then open fire. Afterwards the artillery unit will return to original position. This is to avoid return fire by the enemy (artillery or other - e.g. bombers). Artillery unit may have only one combat position. Initially units are not attached to vehicles unless you specify differently (please refer to Set, Position and Remove Simple Objects).


1_19

Show/hide various map layers.

All layers are switched on/off via "Layers" menu. Each of them are described in more details below:

  • Terrain - Ground, roads and rivers
  • Grid - grid with step of one VIS tile
  • Wire frame - frame model of the whole map
  • Depth Complexity - texture depth; the deeper the red colour, the more textures this particular point has
  • Terrain Noise - micro-texture of ground
  • Black Stripes - black stripes around terrain; removes protruding objects
  • Units - tanks, soldiers, squads ...
  • Objects - buildings, hills, trees ...
  • Bounding Boxes - For 3D models only (tanks, self-propelled artillery units ...)
  • Shadows - shadows (all objects and units have them)
  • Haze - shadowing remote scene edge
  • Units Passability - terrain passability to units. Areas where the ground is painted green are impassable to some units. The deeper the green, the less passable the terrain is. Units are listed below in ascending order of their ability to negotiate difficult terrain:
    1. Wheeled vehicles - cannot move on any green ground
    2. Half-track - can move on light-green ground
    3. Tanks, SPG... - can move on green ground
    4. Squads (Infantry) - can run on dark-green ground
    Nobody can move (drive or walk) on the ground painted the deepest green (for example, swamps for summer set).
  • Unit Fire Ranges ranges and arcs of fire for selected group of units. Also displayed on mini-map. Select group of units in "Simple Objects" section of the main toolbar (or to the right of "Unit Fire Ranges" button on "Settings" toolbar). The list of unit groups at "Settings" toolbar also includes a group named "SELECTION". If you choose this group, fire range will be set only for selected units. To display fire range again (e.g. when you selected another group of units), simply click on "Unit Fire Ranges" button a couple more times
  • Selector: when you select objects ("Simple Objects" section of the main toolbar is active), the hit bar is highlighted. You can also draw a white circle around the object's zero point. This layer shows those white circles


1_11

Set path to the file containing map script

Click on "Map", then "Script". Alternatively, use appropriate "Map" toolbar button.

Only the script file name is actually used; the path is taken from the map name. Please place the script in the same directory as the map to avoid glitches.


1_20

Show/hide various interface elements

"View" menu commands show/hide various elements of the application interface.

"Customize" - customise the application toolbars.


1_0

Run Blitzkrieg with loading current map

This option available only on Windows 2000, Windows XP series.

Click on "Tools", then "Run Blitzkrieg". Alternatively, use appropriate "View" toolbar button.

Blitzkrieg map must be placed in "data\maps\" folder. Map file name must not contain whitespace or space characters.

You can specify additional command line parameters in Oprions dialog ( Menu "Tools",menu item "Options...").
Common command line parameters:

  • "res<width>x<height>"
    • - set screen resolution (default - 1024x768)
  • "windowed"
    • - windowed mode
  • "dxt"
    • - use DXT compression for textures (off by default)
  • "freq<##>"
    • - set refresh frequency (60, 70, 85, 100, etc).
  • "16", "32"
    • - force 16 bit or 32 bit color depth (default - 16)


1_21

Call up help contents

Click on "Help", then "Contents". Alternatively, press F1 hot key.


1_22

View information about the application, its developer and copyright

Click on "Help", then "About Blitzkrieg Map Editor".


1_23

Edit terrain type within selected area

 To switch to editing mode, click on "Terrain" section of the main toolbar, then on "Tiles".

"Tiles" - tile type.

Select brush size to fill terrain (red square on the map) in "Settings" toolbar (values range from 1x1 to 16x16). Brush size is measured in VIS tiles.

Press and hold the left mouse button and draw.

Alternatively, you can fill the entire map quickly by clicking on "Map", then "Fill Entire Map".

In this editing mode mini-map shows tile colours.

When you click on this tab, mini-map automatically switches to "show tile colours" mode.


1_24

Edit ground heights, create 3D landscape

To switch to editing mode, click on "Terrain" section of the main toolbar, then on "Heights".

"Brush size" - set area to edit heights (red map grid with central red tile).

"Level To" - the height to which all other heights will be levelled:

  • "Zero" - set all heights to zero
  • "Click Tile" - level to the height of the central tile (from which the levelling has been started).
  • "Instant Average Height" - level to average height within the red brush grid (calculated at each levelling step).
  • "Click Average Height" - level to average height within the grid (calculated at the beginning of levelling).
"Level" - average height of the brush measured in VIS tiles. During levelling: the height to which the ground will be levelled.

"Height speed" - speed of increasing/decreasing heights measured in relative units. Default value: 1. Cannot be equal to or less than zero.

"Level ratio" - speed of levelling as percentage of the gap between current and desired heights. 100% value means instant levelling to desired height. Default value: 3. Cannot be equal to or less than zero.

"Hills", "Rocks", "Desert Dunes" - height generation types.

"Granularity" - step of height generation measured in relative units. The less this value, the more uneven will be generated surface.

"Max Z", "Min Z": maximum and minimum heights.

If map generation resulted in a lot of red areas on the mini-map, try to decrease gap between heights or increase granularity.

To change heights:

  • Left Click + Move - increase height
  • Right Click + Move - decrease height
  • Left Click + Right Click + Move - level to selected height
  • Mid Click + Move - level to selected height
You cannot set a "wrong" height (red areas on mini-map) when you edit them. To edit heights in red areas, press Ctrl key.

"Generate" - create (generate) random heights.

"Update" - update object heights.

"Set Zero" - set all ground heights to zero.

In this editing mode the mini-map shows heights map in black and white; the lighter the colour, the bigger the height. Maximum and minimum heights are always displayed as white and black dots, respectively. In this editing mode the mini-map may also have red areas. It means that in this area the grid is inclined too steeply. Excessively steep inclines have one snag: they look visually wrong. Red areas may appear when you generate random ground heights, or when you edit heights in unconditional mode. When this tab is selected, the mini-map automatically switches to "show heights" mode.


1_24

Fill selected region with predifined "tiles, objects and heights set" ( "Field" )

To switch to editing mode, click on "Terrain" section of the main toolbar, then on "Fields".

"Available fields" - all predefined "Fields". Use it carefully, for summer maps use only summer "Fields", for example "scenarios\fieldsets\summer\field00", and so on.

"Randomize Polygon" - randomize region edges you entered, randomization params:

  • "Min Length" - minimal edge length, all edges over then minimal length will be splitted with new vertex shift
  • "Width" - relative value ( 0 - 0.5 ) * edge length. Minimal shift from edge vertices for new vertex position.
  • "Disturbance" - relative value ( 0 - 1 ) * edge length. Maximum shift from edge (at right angle to the edge) for new vertex position.

"Fill Terrain" - fill terrain by "Field"

"Place Objects" - place objects by "Field"

"Modify Terrain Heights" - modify terrain heights by "Field"

"Check Passability" - before place object, check passability under it

"Update Map" - update objects' heights, after filling region

Before fill region, you shoud mark polygon on map, to do it use left mouse button. You may delete last point by pressing right mouse button. Press "Enter" or "Space" to approve polygon, you can also use left double-click to approve polygon. After that you can modify polygon vertices positions by clicking on it and dragging by left mouse button. While vertex is selected, you can press "Delete" or "Insert" buttons to remove or add vertices. After all, you must press "Enter" or "Space" to fill region, also left double-click must be working. If you press "Escape", region do not fill.


1_25

Set, position and remove simple objects

To switch to editing mode, click on "Objects, Fences, Bridges" section of the main toolbar, then on "Simple Objects".

"Filter" - set controls for creating list of units. To change the name of the list on button, use Ctrl + Click.

"Player" - number of the player who "owns" the object.

"Angle" - set turning angle in relation to O-Y axis (up and right), only for units.

"List", "Thumbnails" - toggle list of objects' display mode.

Double left-click on object icon in objects list - show object info.

  • HP - number of hit points, only for units and buildings.
  • Armor(f,s,r,t) - unit's armor ( front, side, rear, top ), only for units.
  • Gun(d,p) - unit's main gun parameters ( damage, armor penetration ), only for units.
  • Crew - number of gunners, only for artillery.
  • Passengers - number of passengers for one unit ( for trucks, armors etc.), only for units.
  • Type - squad type, only for infantry squads.
  • Units - number of soldiers in one squad, only for infantry squads
  • Formations - number of formations for squad, only for infantry squads.
  • Type - building type, only for buildings.
  • Entrances - number of entrances, only for buildings.
  • Unit slots - building unit capacity, only for buildings.

Left-click on map - set object.

To select objects on the map, left-click (if you press and hold the left mouse button, you can select other object under the mouse cursor by right-clicking).

To frame-select: Left Click + Move - rectangular frame. Ctrl + left click + move - diamond-shaped frame.

To edit object properties: Space bar or Enter key, or left double-click.

  • Units - number of units linked to object.
  • Angle - turning angle in relation to O-Y axis (up and right).
  • Script ID - value assigned to the object. Used in scripts.
  • Scenario Unit - set units as scenario or non-scenario ones (scenario units are painted blue).
  • Player - player's number.
  • Health - initial number of object's hit points, as percentage of maximum possible number.
  • Formation - unit formation. Used only for infantry squads.

When unit is being dragged, a vertical arrow may appear over objects; this means the unit is linked to the object. To unlink object, call up object properties and double-click on "Units" (value of this field). When objects are moved, all units linked to them also move. Possible links include:

  • Infantry squads in buildings, trenches, lorries or on tanks
  • Vehicles are linked to cannons (taking into account the cannon's weight)
  • Carriages are linked to each other and to the train. Make sure there are no circle links. Each carriage must be linked to just one other carriage (the next one)


1_26

Set, position and remove fences

To switch to editing mode, click on "Objects, Fences, Bridges" section of the main toolbar, then on "Fences".

To set a fence, left-click and drag.

After the fence is set, it can be edited as a simple object.


1_29

Set, position and remove bridges

To switch to editing mode, click on "Objects, Fences, Bridges" section of the main toolbar, then on "Bridges" tab.

To set a bridge - Left Click + Move.

To remove a bridge - place the cursor over it and press Delete key.

To set a bridge to "future build" state - place the cursor over it and press Enter key. These bridges are highlighted in blue. Only big wooden brigdes may be set to "future build state."


1_27

Set, position and remove trenches

To switch to editing mode, click on "Entrenchments, Roads, Rivers" section of the main toolbar, then on "Entrenchments" tab.

To set a trench:

  1. Specify points (left-click on the map)
  2. Set trench at specified points (double-click on them)
To remove a trench: place the cursor over it and press Delete key.


1_28

Set, position and remove roads and rivers

To switch to editing mode, click on "Entrenchments, Roads, Rivers" section of the main toolbar, then on "Roads" or "Rivers" tab.

To set a road (river):

  1. Specify points (left-click on the map; right-clicking deletes the last point)
  2. Set road - press Enter ol double-click on left mouse button

To edit road (river):

  1. Select a road - left-click on it (if you press and hold the left mouse button, you can select various roads by right-clicking on them). The selected road will be fringed with light-green, yellow and red lines. Light-green lines are the road's "ribs"; yellow ones are the "ribs" where you can change the road's width and transparency. The red line is a broken line connecting the road's basic points; by moving the red line you can move the road
  2. Move red dot (press and hold the left mouse button and drag) to change the road's position
  3. Move yellow dot (press and hold the left mouse button and drag) to change the road's width
  4. Press and hold the right mouse button on yellow dot and move the mouse up or down to change the road's transparency
  5. Select red dots to add/remove road's basic points (Insert/Delete keys)
  6. When you move road in "Multi Point" mode, all road points from the end of the road and to the selected point will be moved; if you press and hold Ctrl key, all road points from the beginning of the road and to the selected point will be moved
  7. If you press Delete key while no road point is selected, the whole road will be deleted. To unselect road points, press Space bar or Enter key

"Single Point" - all operations apply to selected point only.

"Multi Point" - all operations apply to several points (depends on the operation).

"All Points" - all operations apply to all points.

"Width" - road's width measured in VIS tiles. In "All Points" mode changing the value of this field changes the width of the whole road.

Opacity - road's transparency (percentage). In "All Points" mode changing the value of this field changes transparency of the whole road.


1_30

Set, edit and remove script areas

To switch to editing mode, click on "Map Tools" section of the main toolbar.

"Damage Tool" - mechanism for changing initial number of objects' hit points.

  • "Damage to Add" - number of hit points subtracted from object as percentage of total number. Green stripe above the object shows its hit points.

    Decrease hit points by specified number - Left-Click on unit.

    Increase hit points by specified number - Right-Click on unit.

    Restore hit points to maximum - Mid-Click on unit.

    Hit points can be set to 0 only for buildings.

  • "Script Area Tool" - mechanism for creating named areas (square or round). These areas are used in scripts.

    To set a script area - Left-Click + move.


1_31

Set, edit and remove groups of units (reinforcements)

To switch to editing mode, click on "Reinforcement Groups" section of the main toolbar.

In this mode you cannot edit anything on the map; but if you check the box opposite a group of units, it will be removed from the map (i.e. it will not be displayed, but the units will remain).

Groups of units are reinforcements which appear after the period of time specified in script.

"Groups" - list of reinforcement unit groups;

"Group Property" - list of units' script ID (included in selected reinforcement).


1_32

Set AI parameters

"Side 0", "Side 1" - select the side to edit AI for. In single player mode AI parameters are usually set for Side 1 only.

"Mobile Reinforcements" - script ID of units belonging to mobile reinforcements. These may include tanks, anti-tank self-propelled artillery units and other mobile combat units (for examle, motorcycles).

"Positions" - list of AI positions. There are two kinds of positions:

  • Reinforce (yellow) - initial reinforcements' positions; from here they move on to defensive positions to provide support, and return back after the operation is completed
  • Defence (green) - defensive position; must have several common units to be considered "hold". Mobile reinforcements will move on to these positions to provide support
Each position consists of centre, direction and placeholders for individual units. Units from mobile reinforcement groups are placed to units' placeholders.

To create position - Left-Click on the map.

To move position - Left-Click on central point and drag.

To edit position size and direction - Left-Click on edge point and drag.

To add unit placeholder - Left-Click on a point within the position.

To move unit position - Left-Click on unit position's central point and drag.

To edit direction of unit position - Left-Click on unit position's edge point and drag.

In "Mobile Reinforcements" table:

  • N - Script ID number
  • Script ID - units' script ID (belonging to Mobile Reinforcements)
  • Units - number of units with this script ID meeting mobile reinforcements requirements (tanks, self-propelled artillery units etc.)
  • Invalid or Enemy Units - number of units with this script ID not meeting mobile reinforcements requirements (tanks, self-propelled artillery units etc.)
  • Squads - number of squads with this script ID

In "Positions" table:

  • N - position number
  • Type - position type
  • Radius - position size measured in VIS tiles
  • Center - position coordinates expressed in VIS tiles
  • Direction - position direction in relation to OY axis
  • Placeholders - number of unit placeholders within position
In this mode, if you place the cursor over unit its name and script ID will be displayed in status bar (makes creating mobile reinforcements easier).


Untitled

Scenario scripts:

To write scenario scripts we use script language Lua.
Lua home page: www.lua.org

Custom Functions:

RunScript
Suicide
KillScript
GetNUnitsInCircle
GetNUnitsInArea
GetNScriptUnitsInArea
GetNUnitsInScriptGroup
LandReinforcement
Win
Draw
Loose
GiveCommand, Cmd
GiveQCommand, QCmd
ShowActiveScripts
ChangeWarFog
EnableAviation
DisableAviation
ChangePlayer
God
SetIGlobalVar, SetFGlobalVar, SetSGlobalVar
GetIGlobalVar, GetFGlobalVar, GetSGlobalVar
GetObjectHPs
GetNUnitsInParty
GetNUnitsInPartyUF
GetNUnitsInPlayerUF
ChangeFormation
Trace
DisplayTrace
ObjectiveChanged
GetNAmmo
GetPartyOfUnits
DamageObject
GetUnitState
GetSquadInfo
IsFollowing
GetFrontDir
GetActiveShellType
RandomFloat
RandomInt
GetMapSize
IsPlayerPresent
GetObjCoord
GetScriptAreaParams
SwitchWeather
SwitchWeatherAutomatic
GetNUnitsInSide
AddIronMan
DeleteReinforcement
ViewZone
IsStandGround
IsEntrenched
GetAviationState

Units commands:

0 - move to location
1 - attack unit
2 - attack non-unit object
3 - swarm to point (x, y))
4 - load units / attach for towing
5 - unload units / detach from towing
6 - enter to building/trench
7 - leave building/trench
8 - rotate to point
9 - stop all actions
13 - stop and guard position
50 - stand ground
14 - switch to ambush
15 - range area (zeroing)
16 - supressive fire
19 - call bombers
20 - call fighters
21 - call scout planes
22 - call paradrop planes
36 - call ground attack planes
23 - resuply units
24 - repear units
29 - officer use spyglasses
31 - hitch artillery
32 - deploy artillery
34 - disband squad
35 - form formation
39 - follow
43 - resuply soldiers in squads
45 - entrench self
46 - change shell type

Script file example: (We must defend script area with name "Base" from enemy units. We must destroy all units with ScriptID 100.)

function ToWin()
if ( GetNUnitsInScriptGroup(100) <= 0) then
Win(0);
Suicide();
end;
end;

function TobeDefeated()
if ( GetNUnitsInArea(1, "Base") > 1) then
Loose();
Suicide();
end;
end;

function Init()
RunScript( "ToWin", 3000);
RunScript( "TobeDefeated", 3000);
end;

Custom functions details:

  • RunScript

    RunScript (strScriptFunctionName, iPeriodicity [, iNumberOfRepetitions]);

    Starts strScriptFunctionName script function every iPeriodicity milliseconds. Optional iNumberOfRepetitions parameter sets number of repetitions.

    Example: RunScript ("Objective12", 3000, 3);

  • Suicide

    Suicide ();

    If Suicide is called up in the body of function started via RunScript, the function will not be repeated after its completion.

  • KillScript

    KillScript (strScriptFunctionName);

    Kills active (started at least once) script with strScriptFunctionName name.

  • GetNUnitsInCircle

    GetNUnitsInCircle (iPlayer, X, Y, Radius)

    Returns number of iPlayer player's units in circle with (X, Y) centre and Radius radius. Coordinates and radius are set at script points (SCRIPT in editor).

  • GetNUnitsInArea

    GetNUnitsInArea (iPlayer, strScriptAreaName)

    Returns number of iPlayer player's units in strScriptAreaName script area set in Map editor.

  • GetNScriptUnitsInArea

    GetNScriptUnitsInArea (iScriptID, strScriptAreaName)

    Returns number of units with iScriptID script group in strScriptAreaName script area set in Map editor.

  • GetNUnitsInScriptGroup

    GetNUnitsInScriptGroup (iScriptID [, iPlayer])

    Returns number of units in iScriptID script group. Optional iPlayer parameter sets the number of units in iScriptID script group for iPlayer player. The second parameter is useful when the script group includes cannons (if all gun crew members were killed, the gun becomes neutral).

    Example: a = GetNUnitsInScriptGroup(102, 1); - get the number of player 1 units in 102 script group.

  • LandReinforcement

    LandReinforcement (iReinfID);

    Drops iReinfID reinforcement created in Map editor (in Groups section).

  • Win

    Win (iParty);

    • Single player: Player with iParty number wins.
    • Multiplayer: iParty side wins. The other side is automatically notified that they lost.

  • Draw

    Draw ();

    • Multiplayer: Draw for all players.

  • Loose

    Loose ();

    • Single player: Defeat.

  • GiveCommand, Cmd

    GiveCommand (iAction, iScriptID [, params, …]);

    Issues iAction command to unit with iScriptID script group. Mandatory params parameters must be separated by commas. "Cmd" equals "GiveCommand". Commands are issued to units immediately. See unit commands, For command values. All coordinate values are in SCRIPT points.

    Example: GiveCommand (9, 1002); Cmd (3, 1001, 2756, 9678);

  • GiveQCommand, QCmd

    GiveQCommand (iAction, iScriptID [, params, …]);

    Adds iAction command to command list of unit with iScriptID script group. Mandatory params parameters must be separated by commas. "QCmd" equals "GiveQCommand". GiveQCommand function can be started as a batch, e.g. to set intermediate points on the route the unit should take. To issue command to unit immediately, the batch must begin with GiveCommand function. See unit commands, For command values. All coordinate values are in SCRIPT points.

    Example: QCmd (3, 200, 1700, 2530); QCmd (3, 200, 1900, 2530);

  • ShowActiveScripts

    ShowActiveScripts ();

    For debugging.
    Calls up list of active scripts.

  • ChangeWarFog

    ChangeWarFog (iParty);

    For debugging.
    Calls up iParty player's fog.

  • EnableAviation

    EnableAviation (iParty, iAviationType);

    Allows iParty player to use aviation of iAviationType. iAviationType can include:

    • 0 - reconnaissance plane
    • 1 - fighter plane
    • 2 - paratrooper plane
    • 3 - bomber plane
    • 4 - ground attack plane
    • -1 - all aircraft types

    If iParty = -1, the function will work for all players.

  • DisableAviation

    DisableAviation (iParty, iAviationType);

    Forbids iParty player to use aviation of iAviationType type. iAviationType can include:

    • 0 - reconnaissance plane
    • 1 - fighter plane
    • 2 - paratrooper plane
    • 3 - bomber plane
    • 4 - ground attack plane
    • -1 - all aircraft types

    If iParty = -1, the function will work for all players.

  • ChangePlayer

    ChangePlayer (iScriptID, iParty);

    Changes owner of unit with iScriptID script group for iParty player.

    Example: ChangePlayer (1000, 2); - give unit with ScriptID = 1000 to player 2.

  • God

    God (iParty, iMode);

    For debugging.
    Sets special mode:

    • 0 - switch off God Mode completely
    • 1 - invulnerability
    • 2 - invulnerability plus killing enemies at the first attempt
    • 3 - killing enemies at the first attempt
    • 4 - switch off invulnerability only
    • 5 - switch off killing enemies at the first attempt only

  • SetIGlobalVar, SetFGlobalVar, SetSGlobalVar

    SetIGlobalVar (strGlobalVarName, iVar);

    SetFGlobalVar (strGlobalVarName, fVar);

    SetSGlobalVar (strGlobalVarName, strVar);

    Sets strGlobalVarName global variety values.

    • SetIGlobalVar uses whole number parameter.
    • SetFGlobalVar uses floating point parameter.
    • SetSGlobalVar uses string parameter.

  • GetIGlobalVar, GetFGlobalVar, GetSGlobalVar

    GetIGlobalVar (strGlobalVarName, 0)

    GetFGlobalVar (strGlobalVarName, 0)

    GetSGlobalVar (strGlobalVarName, 0)

    Returns strGlobalVarName global variety value.

    • SetIGlobalVar uses whole number parameter.
    • SetFGlobalVar uses floating point parameter.
    • SetSGlobalVar uses string parameter.

  • GetObjectHPs

    GetObjectHPs (iScriptID)

    Returns HP for object with iScriptID script group (doesn't work for units!).

  • GetNUnitsInParty

    GetNUnitsInParty (iPlayer)

    Returns number of iPlayer player's units. Infantry are counted individually (one squad = number of soldiers in the squad).

  • GetNUnitsInPartyUF

    GetNUnitsInPartyUF (iParty)

    • Multiplayer: Returns number iParty side's units. Infantry are counted by squads (one squad = one unit).

  • GetNUnitsInPlayerUF

    GetNUnitsInPlayerUF (iPlayer)

    • Multiplayer: Returns number of iPlayer player's units. Infantry are counted by squads (one squad = one unit).

  • ChangeFormation

    ChangeFormation (iScriptID, iFormation);

    Switches squad with iScriptID script group to iFormation formation. Number of formations and its types are specific for every squad type.

  • Trace

    Trace (strText [, params, …]);

    For debugging.
    Calls up formatted string strText into console. Floating point variables can be used as optional additional parameters params.

    Example: Trace ("I have %g apples of total %g", 2, 3);

  • DisplayTrace

    DisplayTrace (strText [, params, …]);

    For debugging.
    Calls up formatted string strText on the screen. Floating point variables can be used as optional additional parameters params.

    Example: DisplayTrace ("I have %g apples of total %g", 2, 3);

  • ObjectiveChanged

    ObjectiveChanged (iObjNum, iState);

    Changes state of objective with iObjNum number to iState. iState can include:

    • 0 - objective received
    • 1 - objective completed
    • 2 - objective failed

  • GetNAmmo

    GetNAmmo (iScriptID)

    Returns amount of ammo of unit with iScriptID script group via list.

    Example: primary_ammo, secondary_ammo = GetNAmmo (1000);

  • GetPartyOfUnits

    GetPartyOfUnits (iScriptID)

    Returns unit(s) with iScriptID script group owner's number.

  • DamageObject

    DamageObject (iScriptID, fDamage);

    Inflicts fDamage damage to object or unit with iScriptID script group. If fDamage = 0, the object (unit) is destroyed. If fDamage is negative, the object (but not unit!!!) will be healed.

  • GetUnitState

    GetUnitState (iScriptID)

    Returns unit's current state (current command). If return -1, the unit does not exist or it's not a unit. If return 0, the state is unknown.

  • GetSquadInfo

    GetSquadInfo (iScriptID)

    Returns squad's current formation. If return -3, the squad doesn't exist. If return -2, it's not a squad. If return -1, the squad is disbanded to individual soldiers. In all other cases rReturns current squad formation. Number of formations and its types are specific for every squad type.

  • IsFollowing

    IsFollowing (iScriptID)

    If return 1, the unit follows another unit. If return 0, the unit doesn't follow anybody. If return -1, the unit doesn't exist or it's not a unit.

  • GetFrontDir

    GetFrontDir (iScriptID)

    Returns unit's current direction in [0, 65535] range, which corresponds to [0, 360] degrees range. If return -1, the unit doesn't exist or it's not a unit.

    Example: angle = GetFrontDir (1100) / 65536 * 360;

  • GetActiveShellType

    GetActiveShellType (iScriptID)

    Returns current artillery ammo type.

  • RandomFloat

    RandomFloat ()

    Returns random floating point number in [0, 1] range.

  • RandomInt

    RandomInt (n)

    Returns whole number in [0, n - 1] range.

  • GetMapSize

    GetMapSize ()

    Returns map size in SCRIPT points.

    Example: sizex, sizey = GetMapSize();

  • IsPlayerPresent

    IsPlayerPresent (iPlayer)

    • Multiplayer: Returns 1 if iPlayer player is present in the game, or to 0 otherwise.

  • GetObjCoord

    GetObjCoord (iScriptID)

    Returns object's or unit's coordinates in SCRIPT points. Returns (-1, -1) coordinates if object doesn't exist.

    Example: x, y = GetObjCoord (2002);

  • GetScriptAreaParams

    GetScriptAreaParams (strScriptAreaName)

    Returns script area parameters. For rectangular areas returns coordinates of the centre (x, y) and half measurements (half-length, half-width). For circular areas returns coordinates of the centre (x, y) and radius.

    Example: x, y, half-length, half-width = GetScriptAreaParams ("Zone1"); x, y, radius = GetScriptAreaParams ("Zone2");

  • SwitchWeather

    SwitchWeather (iState)

    Switches weather on if iState = 1, switches it off if iState = 0.

  • SwitchWeatherAutomatic

    SwitchWeatherAutomatic (iState)

    Allows randomly automatically switching weather on if iState = 1, forbids if iState = 0.

  • GetNUnitsInSide

    GetNUnitsInSide (iParty)

    Returns number of units owned by iParty side. Infantry are counted individually (one squad = number of soldiers in the squad).

  • AddIronMan

    AddIronMan (iScriptID)

    Forbids AI general to supply unit(s) with iScriptID script group.

  • DeleteReinforcement

    DeleteReinforcement (iScriptID)

    Removes all units with iScriptID script group from the map.

  • ViewZone

    ViewZone (strScriptAreaName, iParam)

    If iParam = 1, opens fog in strScriptAreaName script area. If iParam = 0, closes fog.

  • IsStandGround

    IsStandGround (iScriptID)

    Checks unit's state for Stand Ground. Returns 1 if unit is in Stand Ground state, to 0 otherwise.

  • IsEntrenched

    IsEntrenched (iScriptID)

    Checks unit's entrenchment state. Returns 1 if unit is entrenched, to 0 otherwise.

  • GetAviationState

    GetAviationState (iPlayer)

    Returns type of aircraft iPlayer player called up last (0 - 4).

    • 0 - reconnaissance plane
    • 1 - fighter plane
    • 2 - paratrooper plane
    • 3 - bomber plane
    • 4 - ground attack plane


Blitzkrieg© Guide to Programming

Blitzkrieg©
Guide to Programming
Lua functions

Version 1.6


Guide to programming Lua functio

Guide to programming Lua functions |  | V1.6
 | AI units default characteristics:.......................................................................................................................................................... | 5
 | AddIronMan(iScriptID) .......................................................................................................................................................................... | 5
 | ChangeFormation(iScriptID, iFormation) ......................................................................................................................................... | 5
 | ChangePlayer(iScriptID, iParty) .......................................................................................................................................................... | 5
 | ChangeWarFog(iParty) ............................................................................................................................................................................. | 5
 | Cmd ou GiveCommand : Cmd(iAction, iScriptID [,params, ...]) ................................................................................................... | 5
 | iAction = 0 - MOVE TO - Cmd(0, iScriptID, x, y) .......................................................................................................................... | 6
 | iAction = 1 - ATTACK UNIT - Cmd(1, iScriptID, iScriptID_Cible) ....................................................................................... | 6
 | iAction = 2 - ATTACK OBJECT or ATTACK NO UNIT OBJECT : Cmd(2, ....) ................................................................... | 6
 | iAction = 3 - SWARM TO : Cmd(3, iScriptID, x, y) ..................................................................................................................... | 6
 | iAction = 4 - LOAD UNIT : Cmd(4, iScriptID, iScripID_Cible) ............................................................................................. | 6
 | iAction = 5 - UNLOAD UNIT : Cmd(5, iScriptID, x, y) .............................................................................................................. | 6
 | iAction = 6 - ENTER TO BUILDING : Cmd(6, iScriptID, iScriptID_Cible) ....................................................................... | 6
 | iAction = 7 - LEAVE BUILDING : Cmd(7, iScriptID, x, y).......................................................................................................... | 6
 | iAction = 8 - ROTATE TO : Cmd(8, iScriptID, x, y) .................................................................................................................... | 6
 | iAction = 9 - STOP : Cmd(9, iScriptID)............................................................................................................................................. | 7
 | iAction = 10 - PARADE : Cmd(10, iScriptID) ................................................................................................................................... | 7
 | iAction = 11 - PLACEMINE : Cmd(11, iScriptID, x, y)................................................................................................................... | 7
 | iAction = 12 - CLEAR MINE : Cmd(12,..) ............................................................................................................................................ | 7
 | iAction = 13 - GUARD : Cmd(13, ...)...................................................................................................................................................... | 7
 | iAction = 14 - AMBUSH : Cmd(14, iScriptID).................................................................................................................................. | 7
 | iAction = 15 - RANGE AREA : Cmd(15, iScriptID, x, y) .............................................................................................................. | 7
 | iAction = 16 - SUPRESSIVE FIRE : Cmd(16, iScriptID, x, y) .................................................................................................. | 7
 | iAction = 17 - INSTALL : Cmd(17, iScriptID) ................................................................................................................................ | 7
 | iAction = 18 - UNINSTALL : Cmd(18, iScriptID)........................................................................................................................... | 7
 | iAction = 19 - CALL BOMBERS : Cmd(19, Avion_iScriptID, iParty, x, y) ............................................................................. | 8
 | iAction = 20 - CALL FIGHTERS : Cmd(20, Avion_iScriptID, iParty, x , y) ........................................................................ | 8
 | iAction = 21 - CALL SCOUT : Cmd(21, Avion_iScriptID, iParty, x, y) .................................................................................. | 8
 | iAction = 22 - CALL PARADROP : Cmd(22, Avion_iScriptID, iParty, x, y) .......................................................................... | 8
 | iAction = 23 - RESUPLY UNITS : Cmd(23, ...) ............................................................................................................................... | 8
 | iAction = 24 - REPAIR UNIT : Cmd(24, ...)....................................................................................................................................... | 9
 | iAction = 29 - USE SPY GLASS : Cmd(29, iScriptID, x, y) ...................................................................................................... | 9
 | iAction = 31 - TAKE ARTILLERY : Cmd(31, iScript, iSCriptArtillery) .................................................................................. | 9
 | iAction = 32 - DEPLOY ARTILLERY : Cmd(32, iScript, x, y)..................................................................................................... | 9
 | iAction = 34 – DISBAND SQUAD : Cmd(34, iScriptID)............................................................................................................... | 9
 | iAction = 35 – FORM FORMATION : Cmd(35, iScriptID, ....).................................................................................................... | 9
 | iAction = 36 - CALL GROUND ATTACK PLANE : Cmd(36, Avion_iScriptID, iParty, x, y)............................................. | 9
 | iAction = 39 – FOLLOW : Cmd(39, iScriptID, iScript_Cible)................................................................................................... | 9
 | iAction = 43 - RESUPPLY HUMANS : Cmd(43, ...) ........................................................................................................................ | 10
 | iAction = 45 – ENTRENCH SELF : Cmd(45, ...)................................................................................................................................ | 10
 | iAction = 46 – CHANGE SHELL TYPE : Cmd(46, ...)...................................................................................................................... | 10
 | DamageObject(iScriptID, fDamage) .................................................................................................................................................. | 10
 | DeleteReinforcement(iScriptID) ......................................................................................................................................................... | 10
 | DisableAviation(iParty, iAviationType).............................................................................................................................................. | 10
 | DisplayTrace(strText [, params, ...]) ................................................................................................................................................. | 11
 | Draw()............................................................................................................................................................................................................. | 11
 | EnableAviation(iParty, iAviationType)............................................................................................................................................... | 11
 | FlagReinforcement(nParty)..................................................................................................................................................................... | 11
 | GetActiveShellType(iScriptID)............................................................................................................................................................. | 11
 | GetAviationState(iPlayer)....................................................................................................................................................................... | 12
 | GetFGlobalVar(strGlobalVarName, 0) ............................................................................................................................................... | 12
 | GetFrontDir(iScriptID) ........................................................................................................................................................................... | 12
 | GetIGlobalVar(strGlobalVarName,0) ................................................................................................................................................ | 12
 | GetMapSize() .............................................................................................................................................................................................. | 12
 | GetNAmmo(iScriptID) ............................................................................................................................................................................. | 12
 | GetNAntitankInScriptArea(strScriptAreaName) ......................................................................................................................... | 12
23/08/2003 |  | 2


Guide to programming Lua functio

Guide to programming Lua functions |  |  | V1.6
 | GetNAPFencesInScriptArea(strScriptAreaName)................................................................................................................. | 13
 | GetNFencesInScriptArea(strScriptAreaName)...................................................................................................................... | 13
 | GetNMinesInScriptArea(strScriptAreaName) ....................................................................................................................... | 13
 | GetNScriptUnitsInArea(iScriptID, strScriptAreaName) .................................................................................................. | 13
 | GetNTrenchesInScriptArea(strScriptAreaName) ................................................................................................................ | 13
 | GetNUnitsInArea(iPlayer, strScriptAreaName)..................................................................................................................... | 13
 | GetNUnitsInCircle(iPlayer, X, Y, Radius) ............................................................................................................................... | 13
 | GetNUnitsInParty(iPlayer)............................................................................................................................................................. | 13
 | GetNUnitsInPartyUF(iParty) ....................................................................................................................................................... | 13
 | GetNUnitsInPlayerUF(iPlayer) ................................................................................................................................................... | 13
 | GetNUnitsInScriptGroup(iScriptID [, iPlayer]) ................................................................................................................... | 14
 | GetNUnitsInSide(iParty)................................................................................................................................................................ | 14
 | GetNUnitsOfType(strUnitType, iPlayer) ................................................................................................................................ | 14
 | GetObjCoord(iScriptID)................................................................................................................................................................. | 14
 | GetObjectHPs(iScriptID_Static) ............................................................................................................................................... | 14
 | GetPartyOfUnits(iScriptID).......................................................................................................................................................... | 14
 | GetScriptAreaParams(strScriptAreaName) ............................................................................................................................ | 14
 | GetSGlobalVar(strGlobalVarName, 0)....................................................................................................................................... | 14
 | GetSquadInfo(iScriptID)............................................................................................................................................................... | 15
 | GetUnitMorale(iScriptID).............................................................................................................................................................. | 15
 | GetUnitState(iScriptID)................................................................................................................................................................. | 15
 | God(iParty, iMode) ........................................................................................................................................................................... | 16
 | IsEntrenched(iScriptID)................................................................................................................................................................ | 16
 | IsFollowing(iScriptID) .................................................................................................................................................................. | 16
 | IsPlayerPresent(iPlayer)................................................................................................................................................................. | 16
 | IsStandGround(iScriptID)............................................................................................................................................................ | 16
 | IsUnitUnderSupply(iScript) ........................................................................................................................................................ | 16
 | IsWarehouseConnected(iScript_StorageID)......................................................................................................................... | 16
 | KillScript(strScriptFunctionName)............................................................................................................................................. | 17
 | LandReinforcement(iReinfID)...................................................................................................................................................... | 17
 | Loose().................................................................................................................................................................................................... | 17
 | ObjectiveChanged(iObjNum, iState).......................................................................................................................................... | 17
 | Password(strName) .......................................................................................................................................................................... | 18
 | QCmd ou GiveQCommand : QCmd(iAction, iScriptID [,params, ...])............................................................................... | 18
 | RandomFloat()..................................................................................................................................................................................... | 18
 | RandomInt(n)...................................................................................................................................................................................... | 18
 | ReserveAviationForTimes(iParty, iTime).................................................................................................................................. | 18
 | RunScript(strScriptFunctionName, iPeriodicity [, iNumberOfRepetitions])............................................................. | 18
 | SetCheatDifficultyLevel(n).......................................................................................................................................................... | 18
 | SetDifficultyLevel(n)..................................................................................................................................................................... | 18
 | SetFGlobalVar (strGlobalVarName, fVar)............................................................................................................................. | 19
 | SetGameSpeed(n)............................................................................................................................................................................ | 19
 | SetIGlobalVar(strGlobalVarName, iVar)................................................................................................................................ | 19
 | SetSGlobalVar(strGlobalVarName, sVar).............................................................................................................................. | 19
 | ShowActiveScripts()...................................................................................................................................................................... | 19
 | Suicide()............................................................................................................................................................................................. | 19
 | SwitchWeather(iState) ............................................................................................................................................................... | 19
 | SwitchWeatherAutomatic(iState)............................................................................................................................................ | 19
 | Trace(strText [, params, …])..................................................................................................................................................... | 20
 | ViewZone(strScriptAreaName, iParam)................................................................................................................................. | 20
 | Win(iParty)....................................................................................................................................................................................... | 20
 | Script example..21......................................................................................................................................................................... | 21
23/08/2003 |  |  | 3


Guide to programming Lua functio

Guide to programming Lua functions | V1.6
Function | Official | Game Mode
AddIronMan | Yes | Single/Multi
ChangeFormation | Yes | Single/Multi
ChangePlayer | Yes | Single/Multi
ChangeWarFog | Yes | Single/Multi
Cmd | Yes | Single/Multi
DamageObject | Yes | Single/Multi
DeleteReinforcement | Yes | Single/Multi
DisableAviation | Yes | Single/Multi
DisplayTrace | Yes | Debug
Draw | Yes | Single/Multi
EnableAviation | Yes | Single/Multi
FlagReinforcement | No | Multi
GetActiveShellType | Yes | Single/Multi
GetAviationState | Yes | Single/Multi
GetFGlobalVar | Yes | Single/Multi
GetFrontDir | Yes | Single/Multi
GetIGlobalVar | Yes | Single/Multi
GetMapSize | Yes | Single/Multi
GetNAmmo | Yes | Single/Multi
GetNAntitankInScriptArea | No | Single/Multi
GetNAPFencesInScriptArea | No | Single/Multi
GetNFencesInScriptArea | No | Single/Multi
GetNMinesInScriptArea | No | Single/Multi
GetNScriptUnitsInArea | Yes | Single/Multi
GetNTrenchesInScriptArea | No | Single/Multi
GetNUnitsInArea | Yes | Single/Multi
GetNUnitsInCircle | Yes | Single/Multi
GetNUnitsInParty | Yes | Single/Multi
GetNUnitsInPartyUF | Yes | Multi
GetNUnitsInPlayerUF | Yes | Multi
GetNUnitsInScriptGroup | Yes | Single/Multi
GetNUnitsInSide | Yes | Single/Multi
GetNUnitsOfType | No | Single/Multi
GetObjCoord | Yes | Single/Multi
GetObjectHPs | Yes | Single/Multi
GetPartyOfUnits | Yes | Single/Multi

GetScriptAreaParams | Yes | Single/Multi
GetSGlobalVar | Yes | Single/Multi
GetSquadInfo | Yes | Single/Multi
GetUnitMorale | No | ??
GetUnitState | Yes | Single/Multi
GiveCommand | Yes | Single/Multi
GiveQCommand | Yes | Debug
God | Yes | Single/Multi
IsEntrenched | Yes | Single/Multi
IsFollowing | Yes | Multi
IsPlayerPresent | Yes | Single/Multi
IsStandGround | Yes | Single/Multi
IsUnitUnderSupply | No | ??
IsWarehouseConnected | No | ??
KillScript | Yes | Single/Multi
LandReinforcement | Yes | Single/Multi
Loose | Yes | Single/Multi
ObjectiveChanged | Yes | Single/Multi
Password | No | Debug
QCmd | Yes | Single/Multi
RandomFloat | Yes | Single/Multi
RandomInt | Yes | Single/Multi
ReserveAviationForTimes | No | ??
RunScript | Yes | Single/Multi
SetCheatDifficultyLevel | No | Debug
SetDifficultyLevel | No | Single/Multi
SetFGlobalVar | Yes | Single/Multi
SetGameSpeed | No | Single/Multi
SetIGlobalVar | Yes | Single/Multi
SetSGlobalVar | Yes | Single/Multi
ShowActiveScripts | Yes | Debug
Suicide | Yes | Single/Multi
SwitchWeather | Yes | Single/Multi
SwitchWeatherAutomatic | Yes | Single/Multi
Trace | Yes | Debug
ViewZone | Yes | Debug
Win | Yes | Single/Multi

AI units default characteristics :
1. | Units placed on the map are static.
2. | Units interact with enemy units entering their line of sight/fire.
3. | Units return to their initial position as soon as enemy units are destroyed.
4. | The artillery do fire when a ground unit or air unit uncovers some enemies.
5. | If trucks are placed near artillery gun and a warehouse is available in the near area,
 | then they will supply ammo those artillery guns.
6. | If an “appear point” for the arrival of planes was defined using the map editor, a
 | reconnaissance/scout plane will perform several times recon flights, it will be
 | followed by bombers !
 | *
 | * *
23/08/2003 | 4


Guide to programming Lua functio

Guide to programming Lua functions | V1.6
AddIronMan(iScriptID)
  • · Forbids AI general to supply unit(s) with iScriptID script group
  • Linked function : Cmd(23, ...)
ChangeFormation(iScriptID, iFormation)
  • Order squad units to change formation
  • Classical squad unit :
Default formation
Forced march
Defensive
Assault formation
iFormation | From editor | Movement
0 | DEFAULT | Group
1 | MOVEMENT | Column
2 | DEFENSIVE | On ground
3 | OFFENSIVE | Line
  • Sniper
Default formation
Forced march
Defensive
Assault formation
iFormation | From editor
0 | DEFAULT
1 | MOVEMENT
2 | SNEAK
3 | OFFENSIVE
  • linked function : GetSquadInfo()
ChangePlayer(iScriptID, iParty)
  • Allow to change the owner of the unit
ChangeWarFog(iParty)
  • Change the current fog to war to the player iParty

PanzerKampfwagen VI.B Tiger II

23/08/2003 | 5


Guide to programming Lua functio

Guide to programming Lua functions | V1.6
Cmd ou GiveCommand : Cmd(iAction, iScriptID [,params, ...])
Allow to execute the following actions :
iAction = 0 - MOVE TO - Cmd(0, iScriptID, x, y)
  • Give the order to the unit iScriptID to move to (x,y) point on the map
  • the formation state remains (cf ChangeFormation() )
  • GetUnitState() returns the value 32 for the armor and infantry units during the movement
  • GetUnitState() returns the value 0 for the gun units
iAction = 1 - ATTACK UNIT - Cmd(1, iScriptID, iScriptID_Cible)
  • Give the order to the unit iScriptID to attack the target unit iScriptID_Cible
iAction = 2 - ATTACK OBJECT or ATTACK NO UNIT OBJECT : Cmd(2, ....)
  • ERROR - SCRIPT NOT YET IMPLEMENTED!!
iAction = 3 - SWARM TO : Cmd(3, iScriptID, x, y)
  • Give the order to the unit to move to the point (x,y) in assault mode (the unit will attack all opponent unitson the way)
  • the formation state remains (cf ChangeFormation())
  • GetUnitState() returns the value 11 during the movement
iAction = 4 - LOAD UNIT : Cmd(4, iScriptID, iScripID_Cible)
  • Give the order to the infantry unit iScript to get on board into the target vehicle iScriptID_Cible
  • GetUnitState() returns the value 3 when the infantry unit is on board
iAction = 5 - UNLOAD UNIT : Cmd(5, iScriptID, x, y)
  • Give the order to the vehicle iScriptID to unload unit at the point (x,y)
iAction = 6 - ENTER TO BUILDING : Cmd(6, iScriptID, iScriptID_Cible)
  • Give the order to the infantry unit iScriptID to enter into the target building iScriptID_Cible
  • It is possible to move from a building to another building without to order to the unit to leave the first building
  • the formation state remains (cf ChangeFormation())
  • GetUnitState() returns the value 6 during the movement to enter into a building
  • GetUnitState() returns the value 8 when the infantry unit is on the inside
  • Note : the target building must to have an iScriptID at less 100 and more
iAction = 7 - LEAVE BUILDING : Cmd(7, iScriptID, x, y)
  • Give the order to the infantry unit iScriptID to leave the current building AND to move to the point (x,y)
iAction = 8 - ROTATE TO : Cmd(8, iScriptID, x, y)
  • Give the order to the unit iScriptID (armor units or gun units in general) to rotate to the point (x,y)
23/08/2003 | 6


Guide to programming Lua functio

Guide to programming Lua functions | V1.6
iAction = 9 - STOP : Cmd(9, iScriptID)
  • Give the order to the unit iScriptID to STOP the current action
iAction = 10 - PARADE : Cmd(10, iScriptID)
  • Give the order to the unit iScriptID to switch to parade mode ??
  • Note : there is no change of formation or state. The values returned by GetSquadInfo() and GetUnitSate() are always the same.
iAction = 11 - PLACEMINE : Cmd(11, iScriptID, x, y)
  • Give the order to the unit iScriptID (a supply truck) to place mine (2 mines) at the location (x,y)
  • GetUnitState() returns the value 41, during the action.
iAction = 12 - CLEAR MINE : Cmd(12,..)
  • ERROR - UNKNOWN COMMAND!!!
iAction = 13 - GUARD : Cmd(13, ...)
  • ERROR - UNKNOWN COMMAND!!!
iAction = 14 - AMBUSH : Cmd(14, iScriptID)
  • Give the order to the unit iScriptID to switch to ambush mode
  • GetUnitState() returns the value 15
iAction = 15 - RANGE AREA : Cmd(15, iScriptID, x, y)
  • Give the order to artillery unit iScriptID to fire at the point (x,y) in automatic mode
  • GetUnitState() returns the value 16 during the action
  • That corresponds to the key [X]
iAction = 16 - SUPRESSIVE FIRE : Cmd(16, iScriptID, x, y)
  • Give the order to artillery unit iScriptID to fire at the point (x,y) in suppressive mode
  • GetUnitState() returns the value 34 during the action
  • That corresponds to the key [W]
iAction = 17 - INSTALL : Cmd(17, iScriptID)
  • Give the order to artillery unit iScriptID to install ??
iAction = 18 - UNINSTALL : Cmd(18, iScriptID)
  • Give the order to artillery unit iScriptID to uninstall
23/08/2003 | 7


Guide to programming Lua functio

Guide to programming Lua functions | V1.6
iAction = 19 - CALL BOMBERS : Cmd(19, Avion_iScriptID, iParty, x, y)
  • Call bombers Avion_iScriptID to the point (x,y) and for the team iParty
  • Prerequisites :
    o Declare at less 1 Appear point into the “Map Unit Creation Property” Menu
    o Select 1 or more planes in the “Bombers” section
    o Execute the function EnableAviation()
  • Avion_iScriptID is a temporary iScriptID assigned to the planes for the flight. This Avion_IScriptID allows
    to execute the functions : GetObjCoord(), GetUnitState(), etc..
iAction = 20 - CALL FIGHTERS : Cmd(20, Avion_iScriptID, iParty, x , y)
  • Call fighters Avion_iScriptID to the point (x,y) and for the team iParty
  • For the prerequisites see the function Cmd(19, …)
  • Note : the point (x,y) is not a target unit BUT coordinates on the map!
iAction = 21 - CALL SCOUT : Cmd(21, Avion_iScriptID, iParty, x, y)
  • Call scout Avion_iScriptID to the point (x,y) and for the team iParty
  • For the prerequisites see the function Cmd(19, …)
  • Note : the point (x,y) is not a target unit BUT coordinates on the map!
iAction = 22 - CALL PARADROP : Cmd(22, Avion_iScriptID, iParty, x, y)
  • Call paradrop Avion_iScriptID to the point (x,y) and for the team iParty
  • the point (x, y) is the coordinates where the paratroopers will appear!
  • the prerequisites are the same that the function Cmd(19, …)
  • To control the paratroopers on the map, it’s important to assign the global variable
    ParadropSquad.ScriptID with an iScriptID. Example : I want to affect the 999 iScriptID to my
    paratroopers. In the function Init(), I place the following instruction :
    o SetIGlobalVar( "ParadropSquad.ScriptID", 999); --- 999 iScriptID of my paratroopers
  • GetUnitState(iScriptID of the paratroopers) returns the value 27 during the airdrop
iAction = 23 - RESUPLY UNITS : Cmd(23, ...)
  • ERROR - UNKNOWN COMMAND!!!
  • This command doesn’t seems to work through a script call !
  • But under the editor, it’s possible to order a truck to perform this action
  • To do this, you need to assign a “Start Command” to the unit managing the supply
  • “Unit” Menu then “Add Start Command”
  • To choose “RESUPPLY” using VIS co-ordinates of the unit to be ressupplied
  • Leave the Parameter variable value to zero !
  • GetUnitState() returns 37 value during this action
  • Notice : the supply truck comes close by the unit
  • Note : in placing a truck near an artillery gun, the truck will automatically supply this artillery gun
  • Note : don’t forget to place appropriate trucks regarding artillery gun : Heavy Artillery = Heavy Trucks
23/08/2003 | 8


Guide to programming Lua functio

Guide to programming Lua functions | V1.6
iAction = 24 - REPAIR UNIT : Cmd(24, ...)
  • ERROR - UNKNOWN COMMAND!!!
  • This command doesn’t seems to work through a script call !
  • But under the editor, it’s possible to order a truck to perform this action
  • To do this, you need to assign a “Start Command” to the unit managing the supply
  • “Unit” Menu then “Add Start Command”
  • To choose “REPAIR” using VIS co-ordinates of the unit to be repaired
  • Leave the Parameter variable value to zero !
  • GetUnitState() returns 36 value during this action
  • Notice the repair truck come close by the unit AND at the start of the game !!
  • And if the unit moves, the truck don’t follow it !!!??
iAction = 29 - USE SPY GLASS : Cmd(29, iScriptID, x, y)
  • Order the unit with iScriptID script group to use binoculars on the x,y axis
iAction = 31 - TAKE ARTILLERY : Cmd(31, iScript, iSCriptArtillery)
  • Order the truck with iScriptID script group to take the iScriptArtillery artillery gun
  • GetUnitState() returns 24 value for the artillery/gun as soon as it is towed
  • GetUnitState() returns 1 value for the truck with artillery/Gun towed
iAction = 32 - DEPLOY ARTILLERY : Cmd(32, iScript, x, y)
  • Order to the truck with iScriptID script group to untow the artillery/Gun at the point (x,y)
iAction = 34 – DISBAND SQUAD : Cmd(34, iScriptID)
  • Order to the unit with iScriptID scrip group to break formation
  • GetSquadInfo() then returns –1 value
  • Afterwards it seems impossible to interact with that “unit”
iAction = 35 – FORM FORMATION : Cmd(35, iScriptID, ....)
  • Order to create formation…….
  • Impossible to run this action… no errors display, nothing occurs !
iAction = 36 - CALL GROUND ATTACK PLANE : Cmd(36, Avion_iScriptID, iParty, x, y)
  • Calls up ground attack planes to the point (x,y) for the player iParty
  • The point (x,y) represent the target
  • To see command Cmd(19, …) for request to be defined under the editor
iAction = 39 – FOLLOW : Cmd(39, iScriptID, iScript_Cible)
  • Order to the unit with iScript script group to follow the iScript_Taget unit
  • GetUnitState(iScriptID) then returns zero value during any movements which make the target unit to
    follow and not the 32 value
  • If the unit with iScriptID scrip group performs another movement (ec Cmd(0, Iscript, x,y) then this unit will
    not follow the target unit anymore !
  • Remark : you have to use the iSFollowinf() fonction to know if a unit is following another unit.
23/08/2003 | 9


Guide to programming Lua functio

Guide to programming Lua functions | V1.6
iAction = 43 - RESUPLY HUMANS : Cmd(43, ...)
  • ERROR - UNKNOWN COMMAND!!!
  • This command doesn’t seems to work through a script call !
  • But under the editor, it’s possible to order a truck to perform this action
  • To do this, you need to assign a “Start Command” to the unit managing the supply
  • “Unit” Menu then “Add Start Command”
  • To choose “RESUPPLY_HUMANS”, using VIS co-ordinates of the unit to be resupplied with ammo
  • Leave the Parameter variable value to zero !
  • GetUnitState()( returns 38 value during this action
  • Attention : the supply truck come close by the unit !!
iAction = 45 – ENTRENCH SELF : Cmd(45, ...)
  • ERROR - UNKNOW COMMAND!!!
  • This command doesn’t seems to work through a script call !
iAction = 46 – CHANGE SHELL TYPE : Cmd(46, ...)
  • ERROR - UNKNOW COMMAND!!!
  • This command doesn’t seems to work through a script call !
DamageObject(iScriptID, fDamage)
  • Do some damages to the Object/item or unit specified by iScriptID, and for a damage amount equal to
    fDamage

    o If fDamage = 0 then the unit is destroyed (not the static Objects/items)
    o if fDamage = -1 then the static Objects/items (not the units) are repaired

  • Eg : DamageObject(200, GetObjectHPs(200)); -- the object/Item is entirely destroyed !!!
DeleteReinforcement(iScriptID)
  • Remove from map every units with the iScriptID script group belonging to the reinforcement group iReinfID
  • Linked function : LandReinforcement()
  • Attention : iScriptID corresponding to the iScriptID of units belonging to the iReinfID group, it is then posssibe to make a part only of the reinforcements disappear !
DisableAviation(iParty, iAviationType)
  • Forbids to iParty side to call
  • iAviationType can take the following values :

iAviationType | Air support | Corresponding Command
0 | Scout Plane | Cmd(21, ...)
1 | Fighters | Cmd(20, ...)
2 | Paratroopers | Cmd(22, ...)
3 | Bombers | Cmd(19, ...)
4 | Ground Attack Planes | Cmd(36, ...)
-1 | All Types | all
  • Note :If iParty = -1 then all players will be subject to this forbiding
23/08/2003 | 10


Guide to programming Lua functio

Guide to programming Lua functions | V1.6
DisplayTrace(strText [, params, ...])
  • This fonction allow to display a message which will be visible to all players ; example DisplayTrace (“the town center is just being captured”)
  • This command doesn’t seems to work through a script call !
  • DisplayTrace() can display an alphanumeric string or content of numeric variables
    o The string StrText must be set between brackets (« and « )
    o Display of numeric value must be set as follow :
    o DisplayTrace(« Unit State %g is %g », iScriptID, GetUnitState(iScriptID)) ;
    o if iScriptID equal 100, and the unit is moving
    o the result is then : Unit State 100 is 32
  • This fonction is very helpfull to trace script bounded to the map
Draw()
  • In a multi-players game, the Draw() fonction refer to the withdraw of all players ! (no winners)
EnableAviation(iParty, iAviationType)
  • To authorize to iParty side to call up Air Support from type iAviationType.
  • iAviationType can take the following values :
iAviationType | Air support | Corresponding Command
0 | Scout Plane | Cmd(21, ...)
1 | Fighters | Cmd(20, ...)
2 | Paratroopers | Cmd(22, ...)
3 | Bombers | Cmd(19, ...)
4 | Ground Attack Planes | Cmd(36, ...)
-1 | All Types | all

  • Note :If iParty = -1 then all players will be subject to this authorization !
DamageObject(iScriptID, fDamage)
  • Do some damages to the Object/item or unit specified by iScriptID, and for a damage amount equal to
    fDamage

    o If fDamage = 0 then the unit is destroyed (not the static Objects/items)
    o if fDamage = -1 then the static Objects/items (not the units) are repaired

  • Eg : DamageObject(200, GetObjectHPs(200)); -- the object/Item is entirely destroyed !!!
FlagReinforcement(nParty)
  • This function is called in a multiplayer game just after a flag has been captured, and regularly until at less
    a flag is still captured by the nParty team.
  • To use this command insert the following lines in your script :
    o function FlagReinforcement(nParty)
    o local num;
    o if (nParty == 0) then
    o ….
    o end;
    o if (nParty == 1) then
    o ….
    o end;
    o end;
  • Note : this function is useful to send reinforcements
  • Note : the function RunSCript() is NOT used to start this command!
GetActiveShellType(iScriptID)
  • Returns current artillery ammo type
    o If GetActiveShellType() returns 0 value then the current Shell Type is the primary shell type
    corresponding to explosive shell
    o If GetActiveShellType() returns 1 value then the current shell type is the secondary shell type
    corresponding to smoke shell
  • Linked function: GetNAmmo()
23/08/2003 | 11


Guide to programming Lua functio

Guide to programming Lua functions | V1.6
GetAviationState(iPlayer)

  • Returns the last aviation type called by player iPlayer

iAviationType | Air support
0 | Scout Plane
1 | Fighters
2 | Paratroopers
3 | Bombers
4 | Ground Attack Planes
-1 | All Types
GetFGlobalVar(strGlobalVarName, 0)
  • Returns the value of the strGlobalVarName variable
  • the strGlobalVarName variable contains a decimal value (eg 10,456)
  • ex : GetFGlobalVar(« temp.total », 0)
  • Note : the second parameter 0 is mandatory
  • Linked function : SetFGlobalVar()
GetFrontDir(iScriptID)
  • Returns the current direction of the iScriptID unit
  • the returned value is included between 0 and 65535 that corresponds from 0 to 360 degree
  • the unit does not exist or it is not an mobile unit if the value –1 is returned
  • ex : angle = GetFrontDir(iScriptID)/65536 * 360 ; -- returns the angle value
GetIGlobalVar(strGlobalVarName,0)
  • Returns the value of the strGlobalVarName variable
  • the strGlobalVarName is an integer value
  • Note : the second parameter 0 is mandatory
  • Linked function : SetIGlobalVar()
GetMapSize()
  • Returns the map size in Script points
  • ex : sizex, sizey = GetMapSize()
  • Note : to convert into VIS points divide by 64
  • Note : a map 4x4 means (4*16)x(4*16) in VIS points and (4*16*64)x(4*16*64) in Script points
GetNAmmo(iScriptID)
  • Returns the ammunition levels (primary and secondary) of the unit iScriptID
  • ex : primary_ammo, secondary_ammo ) GetAmmo(iScriptID) ;
  • Note : As a rule, the primary ammo is the armor piercing and the secondary ammo is smoke
GetNAntitankInScriptArea(strScriptAreaName)
  • Returns the number of antitank mines found in the strScriptAreaName zone
  • Note : This function does not work !! The value returned is always the 0
GetNAPFencesInScriptArea(strScriptAreaName)
  • Returns the number of barbed wire found in the strScriptAreaName zone
  • Note : 1 barbed wire square = 1 vis
  • Linked function GetNFencesInScriptArea()..
23/08/2003 | 12


Guide to programming Lua functio

Guide to programming Lua functions | V1.6
GetNFencesInScriptArea(strScriptAreaName)

  • Returns the number of barbed wire found in the strScriptAreaName zone

  • Note : 1 barbed wire square = 1 vis

  • Note : the result is identical to the GetNAPFencesInScriptArea() function
GetNMinesInScriptArea(strScriptAreaName)
  • Returns the number of mines found in the strScriptAreaName zone
  • Note : there is not distinction between antipersonnel and antitank mines
GetNScriptUnitsInArea(iScriptID, strScriptAreaName)
  • Returns the number of units with the iScriptID value found in the strScriptAreaName zone
  • Note : an infantry squad of 10 men returns 1 value
GetNTrenchesInScriptArea(strScriptAreaName)
  • Returns the trench length found in the strScriptAreaName zone
  • GetUnitState() returns the 9 value, when an infantry squad is in a trench
GetNUnitsInArea(iPlayer, strScriptAreaName)
  • Returns the number of iPlayer units found in the strScriptAreaName zone
  • Note : an infantry squad returns the number of men which it a composes
  • Note : an artillery unit counts for 4 (3 men + the artillery unit)
  • Note : the units in the buildings are also counted
GetNUnitsInCircle(iPlayer, X, Y, Radius)
  • Returns the number of iPlayer units found in the circle defined by the x,y coordinates and diameter Radius
  • Note : an infantry squad returns the number of men which it a composes
  • Note : an artillery unit counts for 4 (3 men + the artillery unit)
  • Note : the units in the buildings are also counted
GetNUnitsInParty(iPlayer)
  • Returns the number of iPlayer units in game
  • Note : an infantry squad returns the number of men which it a composes
  • Note : an artillery unit counts for 1. If the gunners are killed the artillery unit becomes a neutral unit and it counts for 0!
  • Note : the units in the buildings are also counted
GetNUnitsInPartyUF(iParty)
  • Returns the number of iParty units in game
  • This function is for the multiplayer game
  • Note : the value returned is the sum of the command GetNUnitsInParty() for each player in the team iParty.
GetNUnitsInPlayerUF(iPlayer)
  • Returns the number of iPlayer units
  • This function is for the multiplayer game
  • Note : an infantry squad counts for 1
23/08/2003 | 13


Guide to programming Lua functio

Guide to programming Lua functions | V1.6
GetNUnitsInScriptGroup(iScriptID [, iPlayer])

  • Returns the number of units in the iScriptID group

  • Note : an infantry squad counts for 1

  • Note : an artillery unit counts for 1. If the gunners are killed the artillery unit becomes a neutral unit and it counts for 0!

  • The iPlayer option allows to know if the artillery unit is operational

  • ex : the artillery unit with the iScriptID 100 : GetNUnitsInScriptGroup(100, 1) = 1

  • ex : the gunners are killed : GetNUnitsInScriptGroup(100, 1) = 0
GetNUnitsInSide(iParty)
  • Returns the number of units in the iParty team
  • Note : an infantry squad returns the number of men which it a composes
GetNScriptUnitsInArea(iScriptID, strScriptAreaName)
  • Returns the number of units with the iScriptID value found in the strScriptAreaName zone
  • Note : an infantry squad of 10 men returns 1 value
GetNUnitsOfType(strUnitType, iPlayer)
  • Returns the number of iPlayer units of specific type
  • strUnitType can have the following values :
    o sniper
    o officer
    o ...
  • ex : GetNUnitsOfType(« sniper », 1) – returns the number of sniper for player 1.
GetObjCoord(iScriptID)
  • Returns the coordinates of the iScriptID unit
  • the coordinates returned are expressed in script points
  • ex : x, y = GetObjCoord(100)
  • Note : if x = -1 and/or y = -1 then the unit does not exist
GetObjectHPs(iScriptID_Static)
  • Returns the hit points of the static unit iScriptID_Static (buildings, etc…)
  • This function does not work with the mobile units
GetPartyOfUnits(iScriptID)
  • Returns the team number of the iScriptID unit
GetScriptAreaParams(strScriptAreaName)
  • Returns the strScriptAreaName zone coordinates
  • if strScriptAreaName zone is a rectangle, the values returned are the following :
    o x, y, half_length, half_width = GetScriptAreaParams(« Alarme ») ;
  • if strScriptAreaName zone is a circle, the values returned are the following :
    o x, y, diameter = GetScriptAreaParams(« Alarme ») ;
GetSGlobalVar(strGlobalVarName, 0)
  • Returns the value of the strGlobalVarName variable
  • the strGlobalVarName variable contains a string value
  • Note : the second parameter 0 is mandatatory
  • Linked function : SetSGlobalVar()
23/08/2003 | 14


Guide to programming Lua functio

Guide to programming Lua functions | V1.6
GetSquadInfo(iScriptID)

  • Returns the current formation of the iScriptID unit
    Does not exist !
    Default formation
    Forced mach
    Formation ->
    Assault formation
    GetSquadInfo() | GetSquadInfo( for a sniper)
    -2 (-3) | -2 (-3)
    0 | 0
    1 | 1
    2 – defensive | 2 – furtively
    3 | 2

  • Linked function : ChangeFormation()
GetUnitMorale(iScriptID)
  • Returns the 1 value for all units other than infantry unit
  • Note : I am not sure of the useful of this command !
GetUnitState(iScriptID)
  • Returns the staus of the iScriptID unit.
  • the value returned is included between –1 and n (see below)
  • Note : GetUnitState() is a very useful command

Value | Comments | Linked Command
-1 | the unit does not exist | N/A
0 | Unknown status | N/A
1 | the unit is waiting | N/A
2 | Waits for loading the passenger |
3 | The unit is inside a vehicle | Cmd(4, ...)
4 | It is unloaded from an unit |
5 | It is loaded into transport |
6 | The unit is into a building | Cmd(6, ...)
7 | The unit is going into a trench |
8 | The unit is into a building | Cmd(6, ...)
9 | The unit is into a trench |
10 | The unit leaves a building |
11 | The unit is in assault mode | Cmd(3, ...)
12 | The unit leaves an entrenchment |
13 | The unit attacks a static object |
14 | To be built in a formation |
15 | the unit is an ambush mode | Cmd(14, ...)
16 | The unit is shooting on ranging areas | Cmd(15, ...)
17 | The unit is in a transport |
18 | The unit is constructing a fence |
19 | The unit is constructing a trench |
20 | - | -
21 | The unit is attacking |
22 | The unit is attacking a unit into a building |
Value | Comments | Linked Command
23 | Expectation for gathering a formation |
24 | The unit is fixed on atruck | Cmd(31, ...)
25 | Serve a gun |
26 | Bombardment with a dive |
27 | The paratroopers have jumped | Cmd(22, ...)
28 | the dead plane departs |
29 | Construction a long object |
30 | the unit repairs the bridge |
31 | Engineers search for mines |
32 | the units is moving | Cmd(0, ...)
33 | the units is using spy glass |
34 | the unit is using a constant fire | Cmd(16, ...)
35 | the unit repairs a building |
36 | the unit repairs a unit | Cmd(24, ...)
37 | the unit is distributing ammunition | Cmd(23, ...)
38 | the unit is healing unit | Cmd(43, ...)
39 | The unit is constructing a bridge |
40 | The unit is constructing a hedgehog |
41 | the unit is putting mines | Cmd(11, ...)
42 | - | -
43 | we are developed/unwrapped |
44 | - | -
45 | - | -
46 | Compulsory movement |
47 | we go to cling a gun |
23/08/2003 | 15


Guide to programming Lua functio

Guide to programming Lua functions | V1.6
God(iParty, iMode)

  • This function is useful to test a map by affecting a special mode to the units of the iParty player
    Stop completely the special mode (all modes)
    the units are invulnerable

    The units are invulnerable and the opponents are killed at the first contact 2*

    the opponents are killed at the first contact
    stop the invulnerability mode
    stop the opponents are killed at the first contact mode
    iMode
    0
    1.
    2*
    3*
    4
    5*

  • Note : this function works if before the Password(« Panzerklein ») is executed
  • Note (*) : I did not see any effects.
IsEntrenched(iScriptID)
  • This function tests if the iScriptID unit is entrenched
  • if the unit is entrenched the 1 value is returned, else the 0 value is returned.
IsFollowing(iScriptID)
  • This function tests if the iScriptID unit is following another unit
  • if the unit is following another unit the 1 value is returned , else 0 if the unit does not follow, and –1 if the does not exist
  • Linked function : Cmd(39, …)
IsPlayerPresent(iPlayer)
  • This function tests if the iPlayer player is still in game (in multiplayer game).
  • if the player is still in game the 1 value is returned, else the 0 value is returned
IsStandGround(iScriptID)
  • This function tests if the iScriptID unit is “stand ground” (key [E]).
  • if the unit is « stand ground » the 1 value is returned, else the 0 value is returned.
IsUnitUnderSupply(iScript)
  • Returns always the 1 value… ??!!
IsWarehouseConnected(iScript_StorageID)
  • this function tests if a campaign supply depot is connected to a main supply depot.
  • the 1 value is returned when a campaign supply depot is connected, else the 0 value is returned.
23/08/2003 | 16


Guide to programming Lua functio

Guide to programming Lua functions | V1.6
KillScript(strScriptFunctionName)
  • This function stops/kills the execution of the strScriptFunctionName function which was at least called once.
  • Note : the interest of this function is to change the repetitions of a function executed by the RunScript()
    function. Ex. At the beginning of the game the function A() is executed each second : RunScript(« A »,
    1000) ;. During the game, an event made that the repetitions must be changed. So the function A() is
    stopped by the KillScript() function, then restarted each 5 seconds with the function RunScript() :
    RunScript(“A”, 5000).
LandReinforcement(iReinfID)
  • This function calls the iReinfID reinforcement on the map.
    o Put the units on the map which will compose the reinforcement
    o     Assign the same iScriptID for each unit in the group/the reinforcement
    o     Create from the « reinforcement group » menu a new reinforcement group and assign a number
    to this reinforcement group : “Group ID” (it’s the future iReinfID)
    o     Select the check box “Group N : xxx”, where xxx is the groupID or iReinfID; then add a unit group
    with the iScriptID : use the “Add group with iScriptID” button.
Loose()
  • In solo game, this function causes the defeat of the human player.
ObjectiveChanged(iObjNum, iState)
  • this function displays the iObjNum objective. The description of the objective is contained in the both files
    <iObjNum>.txt & <iObjNum>h.txt in the same directory of “1.xml” file.
  • Ex. ObjectiveChanged(0,0) ; -- displays the contents of the 0.txt file with title the contents of the 0h.txt file
  • Note : the files have to be saved in UNICODE format. Use the NotePad tool and in the sub menu “Save as” select the unicode format.
  • the iState parameter refers to the objective state .
iState | Objective
0 | the objective is displayed (description and an arrow on the minimap)
1 | the objective is reached, the arrow disappears
2 | Never tested !

  • Ex. At the beginning
    ObjectiveChanged(0,0) ; -- the objective 0 is displayed

  • then when the objective 0 is reached, the second obejective is displayed …
    ObjectiveChanged(0, 1) ; -- the objective 0 is reached
    ObjectiveChanged(1, 0) ; -- the objective 1 is displayed
    Etc..
23/08/2003 | 17


Guide to programming Lua functio

Guide to programming Lua functions | V1.6
Password(strName)
  • This function allows to use special functions like God() function.
  • Note : the only know parameter is « Panzerklein »
QCmd or GiveQCommand : QCmd(iAction, iScriptID [,params, ...])
  • This QCmd() function is the same that the Cmd() funtion ; the parameters are the same
  • Except that with the QCmd() ; it is possible to chain commands
  • ex : Ask to an unit to move to many locations on the map
  • Cmd(0, 101, 1000, 500) -- Note : The Cmd() function is always the first!
  • QCmd(0, 101, 1000, 1000)
  • QCmd(0, 101, 2000, 2000)
  • etc...
RandomFloat()
  • The RandomFloat() function returns a random value (a decimal value) between 0 and 1.00
RandomInt(n)
  • The RandomInt() funtion returns a random value (an interger value) between 0 and n-1
ReserveAviationForTimes(iParty, iTime)
  • This function seems to forbid all aviation for the iParty team and during iTime millisenconds
RunScript(strScriptFunctionName, iPeriodicity [, iNumberOfRepetitions])
  • Execute the strScriptFunctionName function every iPeriodicity milliseconds (1000 = 1 second)
  • Ex. RunScript(« TestObjectif_1 », 1000) ; -- the TestObjectif_1 function will be executed each second.
  • The iNumberOfRepetions parameter is optional, it gives the max number of executions.
  • Ex. RunScript(« TestObjectif_2 », 300000, 3) ; -- the TestObjectif_2 function will be executed each 5 minutes and only 3 times.
  • Note : the RunScript() function is the most important function of LUA script.
SetCheatDifficultyLevel(n)
  • Set the cheat level of the game
  • the N value can be 0, 1 or 2
  • Note : I did not know the impact of each cheat level!
SetDifficultyLevel(n)
  • Set the difficulty level of the game
  • the N value can be 0 (easy) , 1 (Normal) or 2 (Hard)
23/08/2003 | 18


Guide to programming Lua functio

Guide to programming Lua functions | V1.6
SetFGlobalVar (strGlobalVarName, fVar)

  • Assign the fVar value (a decimal value) to the strGlobalVarName global variable

  • Note : if the strGlobalVarName global variable does not exist, the first allocation will create it.

  • Linked function : GetFGlobalVar()
SetGameSpeed(n)
  • Set the game speed
  • the N value can be from 0 to 19
  • Note : The 0 value seems to be the normal speed.
SetIGlobalVar(strGlobalVarName, iVar)
  • Assign the iVar value (an integer value) to the strGlobalVarName global variable
  • Note : if the strGlobalVarName global variable does not exist, the first allocation will create it.
  • Linked function : GetIGlobalVar()
SetSGlobalVar(strGlobalVarName, sVar)
  • Assign the sVar value (a string characters) to the strGlobalVarName global variable
  • Note : if the strGlobalVarName global variable does not exist, the first allocation will create it.
  • Linked function : GetSGlobalVar()
ShowActiveScripts()
  • In Console mode during a game, the ShowActiveScripts() function shows the current functions executed by the RunScript() function.
Suicide()
  • The Suicide() function causes the end of the current function. The function will be NOT re-executed.
  • Ex : the following Essai() function is executed each second in order to test a global variable. If the global
    variable is true, a message is displayed and it will be not necessary to reexecute the function (the
    Suicide() function), else the Essai() function will be reexecuted.
    Essai()
    if (GetIGlobalVar(« gTest », 0) == 1) then
    DisplayTrace(“test ok”);
    Suicide(); -- Means that the Essai() function will be not reexecuted
    end ;
    end ;
SwitchWeather(iState)
  • Switch the weather, if iState is 1, the weather becomes BAD and the aviation is not available.
  • if iState is 0, the weather becomes GOOD, and the aviation is available
SwitchWeatherAutomatic(iState)
  • Set the random weather.
  • if iState is 1, the weather is random.
  • if iState is 0, the weather is ALWAYS the same.
23/08/2003 | 19


Guide to programming Lua functio

Guide to programming Lua functions | V1.6
Trace(strText [, params, …])
  • The Trace() function is VERY USEFUL in the debug mode, when you are programming a script. The strText message is displayed only in console mode during the game. By using this function, it is possible to follow or to check the execution of function.
  • the Trace() function can display string characters, integer or decimal value.
    o the string characters must be between « and «
    o to display numerical value , insert in the message the %g code to specifiy where the value is displayed
  • Trace(« The state of the unit : %g is %g », iScriptID, GetUnitState(iScriptID)) ;
  • the result is : The state of the unit 100 is 32
ViewZone(strScriptAreaName, iParam)
  • Allow to see the strScriptAreaName zone without fog, if iParam is 1
  • if iParam is 0, the strScriptAreaName zone is visible with fog
Win(iParty)
  • In solo game, the iParty player WINS
  • in mutiplayer game , the iParty team WINS

*
**

Pz.Kpfw II.Ausf C

23/08/2003 | 21


Guide to programming Lua functio

Guide to programming Lua functions | V1.6
Script example
The following script is called Support. It’s an generic script, this script is not linked to the map by Zone area for objectives, etc…
The purpose of this script is when an IA unit is attacked, the unit send out an alarm and the nearest units available come to support/help it!

In order to test the script execute the following steps :

1. Create a new map 6x6 or 8x8
2. Put for the IA player (german player for example) a watch tower at the center of the map,
3. Put inside the watch tower a german infantry squad,
4. Put in the top corner 3 german armored vehicles,
5. Put in the right corner 2 german trucks and 1 german gun,
6. Put in the bottom corner 2 or 3 germans infantry squad,
7. Put in the left corner some allies armored vehicles,
8. Then run BK and attack the watch tower, etc… the other german units did not move when the watch tower is attacked, or another unit..!!
9. Now, add to the map the script support.lua (copy the text in gray and paste it into a text file with the extension .lua)
10. Assign to the german infantry squad into the watch tower the iScriptID 101
11. Assign to the 3 german armored vehicles the iScriptID 201
12. Assign to the 2 german trucks the iScriptID 401
13. Assign to the german gun the iScriptID 301
14. Assign to the 2 or 3 german infantry squad in the bottom corner the iScriptID 102
15. and test again….
16. for the test kept the lines Password, ChangeFog and God just to see what happened and looked in console mode…
17. Have fun….

--
-- Support.lua V1.2
-- Calvin - 29/05/03
-- 16/06/03 - Ajout du test des tranchées
-- - Ajout d'une zone max d'intervention
--
-- THE PURPOSE OF THIS SCRIPT IS TO SEND OUT AN ALARM WHEN AN UNIT IS ATTACKED
-- IN ORDER TO HAVE HELP/SUPPORT FROM THE NEAREST UNIT(S)!
--
-- PRE REQUISITES
-- Affecting an iScriptID for each unit OR GROUP of units!
-- The infantry (inside or outside building) must have an iScriptID between 101 (min) and 110 (max)
-- The tanks or Armored vehicles must have an iScriptID between 201 (min) and 210 (max)
-- The Guns must have an iScriptID 301 (min) and 310 (max)
-- The trucks must have an iScriptID 401 (min) and 410 (max)
-- The special units must have an iScriptID 501 (min) and 510 (max)
--
-- The script manages 50 units as maximum with an iScriptID between 100 and 510
-- the units with an iScriptID below 100 and above 510 are managed as usual by BK or by other functions in the script!
-- and for many reasons, it's not mandatory to affect an iScriptID for all units!
--
-------------------------
-- CONSTANTES
-- PLAYER_ID		= 1 Computer, 0 = Human, 2 = Neutral
PLAYER_ID 		= 1
-- Constantes - x		= GetUnitState(iScriptID)
ETAT_NEXISTEPAS	= -1
ETAT_INDISPONIBLE	= 0
ETAT_ENATTENTE		= 1
ETAT_ENDEFENSE		= 8
ETAT_DSTRANCHEE	= 9
ETAT_MVT_ASSAUT	= 11
ETAT_ATTAQUE_1		= 13
ETAT_EMBUSCADE		= 15
ETAT_TIR_X		= 16
ETAT_POSE_BARBELES	= 18
ETAT_ATTAQUE_2		= 21
ETAT_MVT_NORMAL	= 32
ETAT_JUMELLES 		= 33
ETAT_TIR_W		= 34
ETAT_REPARER		= 36
ETAT_RECHARGER		= 37
ETAT_PIVOTE		= 43
ETAT_REMORQUE		= 47
--- =================================================================
-- gActiveUnits[][1]	= iDScript
-- gActiveUnits[][2]	= Status
-- gActiveUnits[][3]	= 1 (attack mode) ou 0 (defense mode)
gActiveUnits = {{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},
{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},
{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},
{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}}
MAX_ACTIVE_UNITS	= 50
UNIT_DEF 		= 0 -- [][3]
UNIT_ATT 		= 1 -- [][3]
UNIT_NORMAL 		= 1 -- [][2] -- Identique ETAT_ENATTENTE
UNIT_MVT 		= 2 -- [][2]
UNIT_ALARME 		= 3 -- [][2]
ALARME_RAYON 		= 12*64 -- ALARME_RAYON is the radius (in Script points) of a circle
-- the center of the circle is an infantery unit
ZONE_MAX_INTERVENTION = 128 -- ZONE_MAX_INTERVENTION is the distance max in VIS point to support/help an other
-- unit
-- Unit Types
UTYPE_INF 		= 100
UTYPE_TANK 		= 200
UTYPE_GUN 		= 300
UTYPE_TRUCK 		= 400
UTYPE_SPECIAL 		= 500
UTYPE_INF_ID 		= 1
UTYPE_TANK_ID 		= 2
UTYPE_GUN_ID 		= 3
UTYPE_TRUCK_ID 		= 4
UTYPE_SPECIAL_ID 	= 5
UTYPE_UNITS_MAX 	= 10
-- The gActiveTypeUnits array contains for each unit type the number of units
gActiveTypeUnits = {0, 0, 0, 0, 0}
-- ========================================================================================
-- Function GetHowManyUnits()
-- the purpose of the function GetHowManyUnits() is to return the number of units for the unit type given in parameter
--
-- Note : the max number of units in the gActiveUnits[][]array is MAX_ACTIVE_UNITS (50 units!!)
-- Input parameters :
-- arg[1] the iScriptID to test
-- Output parameters :
--
-- Calling protocol :
-- GetHowManyUnits(iScriptID)
--
function GetHowManyUnits(...)
local i = 1;
local n = 0;
    while (i<UTYPE_UNITS_MAX) do
        if (GetNUnitsInScriptGroup(arg[1]+i, PLAYER_ID) > 0) then
            n = n +1;
        end;
        i = i + 1;
    end;
return n;
end;
-- ========================================================================================
-- Function InitActiveUnits()
-- the purpose of the function InitActiveUnits() is to fill the gActiveUnits[][]array
-- the gActiveUnits[][]array is filling as following :
--
-- first get the number of unit for each unit type on the map.
-- there are 5 unit types : Infantery, Tank, Gun, Truck and special unit (sniper)
-- the max of unit for each unit type is UTYPE_UNITS_MAX (10 units of the same type)
-- the function GetHowManyUnits() returns the number of units on map
--
-- then the state of each unit is tested (GetUnitState())
-- By default the Guns, Trucks and special units are in defense mode.
-- it means they cannot help a unit sending out an alarm
-- The infantery in building or entranched are considered in defense mode also.
--
-- Note : the max number of units in the gActiveUnits[][]array is MAX_ACTIVE_UNITS (50 units!!)
-- Input parameters :
-- None
-- Output parameters :
-- None
-- Calling protocol :
-- InitActiveUnits()
--
function InitActiveUnits()
local n, i, j, u 	= 0, 0, 0, 0;
-- Initialisation de gActiveTypeUnits[]
gActiveTypeUnits[UTYPE_INF_ID] 		= GetHowManyUnits(UTYPE_INF);
gActiveTypeUnits[UTYPE_TANK_ID]		= GetHowManyUnits(UTYPE_TANK);
gActiveTypeUnits[UTYPE_GUN_ID] 		= GetHowManyUnits(UTYPE_GUN);
gActiveTypeUnits[UTYPE_TRUCK_ID]		= GetHowManyUnits(UTYPE_TRUCK);
gActiveTypeUnits[UTYPE_SPECIAL_ID] 		= GetHowManyUnits(UTYPE_SPECIAL);
-- Initialisation du tableau gActiveUnits[][]
j = 0;
while (j<5) do
i = 0;
u = UTYPE_INF * (j+1);
    while (i<gActiveTypeUnits[j+1]) do
        if (GetUnitState(u+i+1) > 0 )then
            gActiveUnits[n+1][1] = u+i+1; 			-- iDScript de l'unité
            gActiveUnits[n+1][2] = GetUnitState(u+i+1);	 -- son status selon GetUnitState()
        --if (gActiveUnits[n+1][2] == ETAT_ENDEFENSE) then
        if ((gActiveUnits[n+1][2] == ETAT_ENDEFENSE) or (gActiveUnits[n+1][2] == ETAT_DSTRANCHEE)) then
            gActiveUnits[n+1][3] = UNIT_DEF;
        else
            gActiveUnits[n+1][3] = UNIT_ATT;
        end;
        -- les unités de type GUN, TRUCK et SPECIALES ne peuvent se déplacer pour attaquer ou aider à l'attaque!
        if ((u >= UTYPE_GUN) and (u <= UTYPE_SPECIAL + 99)) then
            gActiveUnits[n+1][3] = UNIT_DEF;
        end;
            n = n +1; -- on augmente de 1 le nombre total d'unités
        if (n >= MAX_ACTIVE_UNITS) then
        break;
        end;
    end; -- GetUnitState()
    i = i +1;
end; -- while i
j = j +1;
    if (n >= MAX_ACTIVE_UNITS) then
    break;
    end;
end; -- while js
gActiveUnits[n+1][2] = -2; -- correspond au dernier enregistrement
SetIGlobalVar("temp.map.nbunits",n); -- la variable "temp.map.nbunits" contient le Nombre d'unités référencées!
i = 0;
while (i<n) do
    Trace(" i %g id %g status %g D/A %g", i+1, gActiveUnits[i+1][1], gActiveUnits[i+1][2], gActiveUnits[i+1][3]);
    i = i +1;
end;
Suicide();
end;
-- ========================================================================================
-- Function Test_Att()
-- the purpose of the function Test_Att() is to determided if an unit is under an attack!
-- the tested units are only the referenced units in the gActiveUnits[][]array.
--
-- An infantery squad is under attack when opponents enter in a zone of ALARME_RAYON around the infantery squad
-- The Tank and Gun units are under attack if the function GetUnitState() returns 21
-- A truck is under attack when opponents enter in a zone of ALARME_RAYON around the truck
-- A sniper is under attack when opponents enter in a zone of (ALARME_RAYON+(2*64)) around the sniper
--
-- When an unit is under attack, the SelectUnitToHelp() function is called to find the nearest unit to help the attacked unit!
-- Input parameters :
-- None
-- Output parameters :
-- None
-- Calling protocol :
-- Test_Att();
--
function Test_Att()
local i 		= 0;
local uid 		= 0;
local x,y 		= 0,0;
if (GetIGlobalVar("temp.map.EC",0) == 0) then
SetIGlobalVar("temp.map.EC",1); -- semaphore
while (i<GetIGlobalVar("temp.map.nbunits",0)) do
    uid = gActiveUnits[i+1][1];
-- 	Trace("uid = %g",uid);
    if (GetUnitState(uid) ~= -1) then
        x,y = GetObjCoord(uid);
        if (uid < UTYPE_TANK) then -- test the infantery squad
-- 			Trace("UNits in circle %g %g", GetNUnitsInCircle(0,x,y,ALARME_RAYON), uid);
            if (GetNUnitsInCircle(0,x,y,ALARME_RAYON) > 0) then
                if (gActiveUnits[i+1][2] ~= UNIT_ALARME) then
                    Trace("Alarme INF %g", uid);
                    gActiveUnits[i+1][2] = UNIT_ALARME;
                    SelectUnitToHelp(x,y,uid);
                end; -- if UNIT_NORMAL
            else
                if (GetUnitState(uid) == ETAT_ENATTENTE) then
                    gActiveUnits[i+1][2] = UNIT_NORMAL;
                end;
            end;
        end; -- If INF
            if ((uid > UTYPE_TANK) and (uid < UTYPE_GUN)) then -- Test the Tank units
                if (GetUnitState(uid) == ETAT_ATTAQUE_2) then
                    if (gActiveUnits[i+1][2] ~= UNIT_ALARME) then
                        Trace("Alarme Tank %g", uid);
                        gActiveUnits[i+1][2] = UNIT_ALARME;
                        SelectUnitToHelp(x,y,uid);
                    end; -- if UNIT_NORMAL
                else
                    if (GetUnitState(uid) == ETAT_ENATTENTE) then
                        gActiveUnits[i+1][2] = UNIT_NORMAL;
                    end;
                end;
            end; -- If TANK
                if ((uid > UTYPE_GUN) and (uid < UTYPE_TRUCK)) then -- Test the Gun units
                    if (GetUnitState(uid) == ETAT_ATTAQUE_2) then
                        if (gActiveUnits[i+1][2] ~= UNIT_ALARME) then
                            Trace("Alarme Gun %g", uid);
                            gActiveUnits[i+1][2] = UNIT_ALARME;
                            SelectUnitToHelp(x,y,uid);
                        end; -- if UNIT_NORMAL
                    else
                        if (GetUnitState(uid) == ETAT_ENATTENTE) then
                            gActiveUnits[i+1][2] = UNIT_NORMAL;
                        end;
                    end;
                end; -- If GUN
                    if ((uid > UTYPE_TRUCK) and (uid < UTYPE_SPECIAL))then
                        -- Test the truck units
                        if (GetNUnitsInCircle(0,x,y,ALARME_RAYON) > 0) then
                            if (gActiveUnits[i+1][2] ~= UNIT_ALARME) then
                                Trace("Alarme Truck %g", uid);
                                gActiveUnits[i+1][2] = UNIT_ALARME;
                                SelectUnitToHelp(x,y,uid);
                            end; -- if UNIT_NORMAL
                        else
                        if (GetUnitState(uid) == ETAT_ENATTENTE) then
                            gActiveUnits[i+1][2] = UNIT_NORMAL;
                    end;
                end;
            end; -- if Truck
            if ((uid > UTYPE_SPECIAL) and (uid < UTYPE_SPECIAL + 99))then -- Test the special untis
                if (GetNUnitsInCircle(0,x,y,ALARME_RAYON+(2*64)) > 0) then
                    if (gActiveUnits[i+1][2] ~= UNIT_ALARME) then
                        Trace("Alarme Unités SpecialesTruck %g", uid);
                        gActiveUnits[i+1][2] = UNIT_ALARME;
                        SelectUnitToHelp(x,y,uid);
                    end; -- if UNIT_NORMAL
                else
                    if (GetUnitState(uid) == ETAT_ENATTENTE) then
                        gActiveUnits[i+1][2] = UNIT_NORMAL;
                    end;
                end;
            end; -- if UNITES SPECIALES
        end; -- if State == -1
        i = i +1;
    end; -- while i
    SetIGlobalVar("temp.map.EC",0);
end; -- if
end;]
-- ========================================================================================
-- Function SelectUnitToHelp(...)
-- Activate the nearest unit of the unit sending out an alarm
--
-- Input parameters :
-- arg[1] 		x coordinate of unit sending out an alarm
-- arg[2] 		y coordinate of unit sending out an alarm
-- arg[3] 		uid of the sending out an alarm
-- Output parameters :
-- None
-- Calling protocol :
-- SelectUnitToHelp(x,y,uid);
--
function SelectUnitToHelp(...)
local i, distance, tp, uid, uidx		 = 0,0,0,0,0;
local x,y 		= 0,0;
-- loop to check all available units
-- the public variable "temp.map.nbunits" contains the number of referenced units in the array
gActiveUnits[][]
while (i<GetIGlobalVar("temp.map.nbunits",0)) do
    -- test if the eligible unit is waiting and if it can attack/help
    if ((gActiveUnits[i+1][2] == UNIT_NORMAL) and (gActiveUnits[i+1][3] == UNIT_ATT)) then
    -- test if the eligible unit is still existing.
        if (GetUnitState(gActiveUnits[i+1][1]) ~= -1) then
        -- Get the coordinate of the eligible unit
        x,y = GetObjCoord(gActiveUnits[i+1][1]);
        -- Calculate the distance between the eligible unit and the unit sending out an alarm
        tp = CalculDistance(arg[1]/64, arg[2]/64, x/64,y/64);
        -- Test if the calculated distance is included in the intervention area
            if (tp < ZONE_MAX_INTERVENTION) then
                -- Compare with the previous and save the shortest calculated distance
                if ((distance == 0) or (tp < distance)) then
                    distance = tp;
                    uid = gActiveUnits[i+1][1];
                    uidx = i+1;
                end; -- end if distance
            end; -- end if max_zone_intervention
        end; -- end Getunitstate
    end; -- end if
    i = i +1;
end; -- end while
-- if the distance variable is > 0 then the nearest unit has been found, the uid variable contains the iScriptID of the unit
-- else there are no more units available
if (distance > 0) then
    gActiveUnits[uidx][2] = UNIT_MVT;
    if (uid < UTYPE_TANK) then
        -- if the unit is an infantery squad, give the order to the unit to move to the location
        -- Note : it's important to separate the infantery squad from all other unit types
        -- because if you give the order 3, the officer will not follow the squad....
        Cmd(0,uid,arg[1],arg[2]);
    else
        -- give the order to the unit to move in assault mode to the location
        Cmd(3,uid,arg[1],arg[2]);
    end;
    Trace("Unite en appui = %g soutient l'unité %g", uid, arg[3]);
end;
end;
-- ========================================================================================
-- Function CalculDistance(...)
-- Calculate the distance between two points A & B on the map
-- following the mathematical expression : distance = SQRT((Bx-Ax)² + (By-Ay)²)
-- the coordinates can be given in VIS points or SCRIPT points
-- Note : 1x1 VIS square is equal to 64x64 SCRIPT points
-- Input parameters :
-- the coordinates of point A and point B
-- arg[1] 		x coordinate A
-- arg[2] 		y coordinate A
-- arg[3] 		x coordinate B
-- arg[4] 		y coordinate B
-- Output parameters :
-- returns the distance between the points A & B
-- Calling protocol :
-- CalculDistance(Ax, Ay, Bx, By);
--
function CalculDistance(...)
    return sqrt(((arg[3]-arg[1])*(arg[3]-arg[1])) + ((arg[4]-arg[2])*(arg[4]-arg[2])));
end;
-- ========================================================================================
-- Function sqrt()
-- Calculate the square of the x value
-- from the official map Secure_area.lua
--
-- Input parameters :
-- x integer value
-- Output parameters :
-- returns the square of x
-- Calling protocol :
-- sqrt(x);
--
function sqrt( x)
local ITNUM 	= 4;
local sp 		= 0
local i 		= ITNUM;
local inv 		= 0;
local a, b;
    if ( x <= 0) then return 0; end;
        if ( x < 1) then
            x = 1 / x;
            inv = 1;
        end;
    while ( x > 16) do
        sp = sp + 1;
        x = x / 16;
    end;
    a = 2;
-- Newtonian algorithm
    while (i > 0) do
        b = x / a;
        a = a + b;
        a = a * 0.5;
        i = i - 1;
    end;
--
    while ( sp > 0) do
        sp = sp - 1;
        a = a * 4;
    end;
    if ( inv == 1) then
        a = 1 / a;
    end;
return a;
end;
--------------------------------------------------------------------------------------------------
function Init()
    Trace("Deb Init");
-- 	Start the InitActiveUnits function
    RunScript("InitActiveUnits",1000);
----------------
    Password( "Panzerklein" )
    ChangeWarFog(1)
    God(1,1)
-----------------
RunScript("Test_Att", 2000);
Trace("Fin Init");
end;
23/08/2003 | 23


Script ID Table
Misc… |  | Player0 |  | Player1 |  | Player2
0-99 | Trenches | 1000-1099 | Infantry | 2000-2099 | Infantry | 3000-3099 | Infantry
100-199 |  | 1100-1199 |  | 2100-2199 |  | 3100-3099
200-299 | Buildings | 1200-1299 | Tanks | 2200-2299 | Tanks | 3200-3299 | Tanks
300-399 | Bridges | 1300-1399 |  | 2300-2399 |  | 3300-3399
400-499 | Objects | 1400-1499 | AT/Art-SPG | 2400-2499 | AT/Art-SPG | 3400-3499 | AT/Art-SPG
500-599 | ----- | 1500-1599 | AT/Art-Tow | 2500-2599 | AT/Art-Tow | 3500-3599 | AT/Art-Tow
600-699 | ----- | 1600-1699 | Mg/Mortor | 2600-2699 | Mg/Mortor | 3600-3699 | Mg/Mortor
700-799 | ----- | 1700-1799 | Auto/Train | 2700-2799 | Auto/Train | 3700-3799 | Auto/Train
800-899 | Aviation | 1800-1899 | Eng/Supply | 2800-2899 | Eng/Supply | 3800-3899 | Eng/Supply
900-999 |  | 1900-1999 |  | 2900-2999 |  | 3900-3999


BLITZKRIEG SINGLE-PLAYER

MAP TUTORIAL

By wespex

Version 1.3 Revision b

This is a basic tutorial for someone who would like to get started making single-player maps but doesn’t know where to start. This is a simple way to show how to create a single-player map detailing the steps needed to make the map ready for use as a playable custom mission by using both the Map Editor and Resource Editor; included in this tutorial is simple lua scripting showing how to script objectives as well as win/loose conditions, this tutorial also shows how to create the header, subheader, description, objective header and objective description text files saved in Uni-Code format needed to create a custom mission. Basically all the steps needed to get your map up and running.


Things you will learn:

• Create a 2x2 map
• Add 3 ScriptAreas
• Add 1 unit with ScriptID
• Add the lua script file to the map
• Add field tile
• Add a road
• Add a river
• Add some shrubs
• Add some trees

Create text files with notepad for the following:

• Mission script (save as lua)
• Script 3 Objectives
• Script 3 Reveal Objectives
• Script a Victory condition
• Script a defeat condition
• Write mission header, sub header and description files (saved in Unicode)
• Write mission objective header and objective description files (saved in Unicode)

Use the Resource Editor’s mission editor to:

• Add basic unit info
• Add combat music
• Add exploration music
• Add mission header, sub header and description text files
• Add Objective0 header and description text files
• Add Objective1 header and description text files
• Add Objective2 header and description text files
• Export the project which creates an xml file

Things to know for this tutorial:

Click = Clicking the left mouse button to select an item.
Right Click = Clicking the right mouse button to select an item.


Folders/Paths

We will need to create a place to hold our folders/files that we will create in the steps below so that when the time comes to create the .pak file (compressed file similar to a .zip or tar file containing all of the files needed to play a custom map) of our custom mission we will have a place to accomplish this without confusing these files with the ones needed by the Resource Editor. This will make sense to you later…

In the Blitzkrieg\Run\ create a new folder named map_to_pak now open the map_to_pak folder and create a folder named scenarios, inside the folder scenarios create a folder named custom, inside the folder named custom create a folder missions and finally inside the folder named missions create a new folder named tutorial. You should now have the following folder path:

Blitzkrieg\Run\map_to_pak\tutorial\scenarios\custom\missions\tutorial <- This is where we will store our text files (header, subheader, description, objective header and objective description) and also we will move our exported mission files (.xml) later once we have created them using the Resource Editor.

We will also need to create a folder named maps inside of the Blitzkrieg\Run\map_to_pak\tutorial <- This is where we will store our map and script file (.bzm & .lua).

Now we will need to create the folders needed to store our text files as well as the .mip file that the Resource Editor uses in the process to create the custom mission. In the Blitzkrieg\Run folder create a folder named mods if it is not already there. Inside Blitzkrieg\Run\mods we’ll create a folder name mymod (this is the default folder that the Resource Editor uses, however you could name it anything you want to).

Ok now inside Blitzkrieg\Run\mods\mymod create a new folder named data, inside the folder named data create a folder named scenarios, inside the folder scenarios create a folder named custom, inside the folder named custom create a folder missions and finally inside the folder named missions create a new folder named tutorial. You should now have the following folder path:

Blitzkrieg\Run\mods\mymod\data\scenarios\custom\missions\tutorial

Ok now we need to create one more folder, this one is needed for the mini-map that we will create with the Resource-Editor. Without this folder you won’t be able to see the mini-map within the Resource-Editor so to avoid any headaches it would be a good time to take care of this now.

Ok now inside Blitzkrieg\Run\Data\ folder create a folder named “Editor” if there is not one there already, inside the folder editor data create a folder named temp. You should now have the following folder path:

Blitzkrieg\Run\Data\Editor\temp


Map Editor

Start the BK map editor click on File from the menu bar and select New… A menu will appear

Add the following:

Map size = 2x2

Name = tutorial

Season = Summer

Mod = <no any MOD> (default setting – no mod is used with this map)

A new map has been created in .bzm format.

For simplicity this map will be created with very little detail.

Click on Terrain section in the tool tree below the menu bar,

Click Tiles, then click the Plain tile, go back to the menu bar and click on Map then click Fill Entire Map, a message will pop up click yes.

Now from the Terrain section in the tool tree click on the Light Grass Tile, go to the bottom edge of the map, click and drag all the edge from corner to corner.

Now from the Entrenchments, Roads, Rivers section in the tool tree

Click on the defaultriver Tile, go to the top edge of the map; click and then move to the opposite corner of the map then double click to set the river. Note: Red circles are pivot points and yellow circles are width points.

Now from the Objects, Fences, Bridges section in the tool tree

Click on the _BigApple Tile, go to the left hand bottom corner of the map; click and place the tree.

From the Objects, Fences, Bridges section in the tool tree

Click on the Bld European tab to change to the buildings tiles; click E_CTownH… Tile, go towards the

center of the map; click and place the house.

From the Objects, Fences, Bridges section in the tool tree

Click on the Bld European tab to change to the buildings tiles; click E_FrenchS… Tile, go towards the

upper left hand corner of the map; click and place the house.

From the Map Tools section in the tool tree

Click and hold the button and drag on the area near the tree to create the first ScriptArea.

ScriptArea = Tree

Click and hold the button and drag on the area near the tree to create the second ScriptArea.

ScriptArea = Farm_House

Click and hold the button and drag on the area near the tree to create the third ScriptArea.

ScriptArea = Swim

Click on Terrain section in the tool tree below the menu bar

Click on the Cube Tile then click and hold button drag in the area around the Swim House

Now from the Entrenchments, Roads, Rivers section in the tool

Click on the road_cobbles Tile, go to the bottom center edge of the map; click and then move up towards the farm house set the pivot points by clicking map then double click to set the road. Note: Red circles are pivot points and yellow circles are width points.

From the Objects, Fences, Bridges section in the tool tree

Click on the Cypress01 Tile and then Cypress02 Tile, place in front of the farm house.

Click on the Obj Simple Tab and then select E_FenceB… Tile click to place tiles around the farm house.

Click on the Squads Tab and then select GB_officer… Tile.

Click to place tile in the bottom of the far left hand corner of the map. Right click then double click to

bring up the unit property menu; then click on ScriptID: ScriptID = 1

Click on File from the menu bar, click on save.


Text Files

The mission text files will be saved in:

Blitzkrieg\Run\mods\mymod\data\scenarios\custom\missions\tutorial

Header Text File

Open up your text editor and create a text file named header.txt inside type the following text (minus the quotation marks): “Objectives Tutorial” and then save (in Unicode) into your tutorial folder.

Description Text File

Create a text file named description.txt inside type the following text (minus the quotation marks):

“Make sure to get your tired officer some much needed rest and relaxation.” and then save (in Unicode) into your tutorial folder.

Sub-Header Text File

Create a text file named subheader.txt with no text inside and then save in your tutorial folder.

Note: sub headers are optional but are required when you create your mission xml file, in this mission I chose to leave the subheader.txt file blank.

Objective0 Header Text File

Create a text file named 0h.txt inside type the following text (minus the quotation marks): “1st Objective.” and then save (in Unicode) into your tutorial folder.

Objective0 Description Text File

Create a text file named 0.txt inside type the following text (minus the quotation marks): “There is a shade tree up ahead... Get the officer under the shade tree before he collapses from heat stroke.” And then save (in Unicode) into your tutorial folder.

Objective1 Header Text File

Create a text file named 1h.txt inside type the following text (minus the quotation marks): “2nd Objective.” and then save (in Unicode) into your tutorial folder.

Objective1 Description Text File

Create a text file named 1.txt inside type the following text (minus the quotation marks): “Now that your officer has cooled down a bit, send him over to the farm house.” and then save (in Unicode) into your tutorial folder.

Objective2 Header Text File

Create a text file named 2h.txt inside type the following text (minus the quotation marks): “3rd

Objective.” and then save (in Unicode) into your tutorial folder.

Objective2 Description Text File

Create a text file named 2.txt inside type the following text (minus the quotation marks): “Now that your officer has poked around this farmer’s house, send him over to the river for a nice relaxing swim.” And then save (in Unicode) into your tutorial folder.

Now you have created all of the text files needed.


Mission Scripts

You will need a text editor like notepad to write the lua script for this mission. It is not advisable to use Microsoft Word since it embeds other data into the text file and will cause your script file not to run. Note: Lua text files do not need to be saved in Uni-Code format!!!

Copy and paste the following script into a text file and then name the file as tutorial.lua, save this file into your map folder. Blitzkrieg\Run\data\maps folder.

To save as a lua file from the note pad main menu choose File, Save As…, in the File name text area name the file “tutorial.lua” then in the Save as type drop-down select “All Files” as shown in the picture below.

---*** Begin script ***---

function RevealObjective0()

ObjectiveChanged(0, 0);

RunScript( "Objective0", 3000);

Suicide();

end;

function Objective0()

if (GetNScriptUnitsInArea (1, "Tree") == 1) then

SetIGlobalVar("Tutorial.objective.0", 1);

ObjectiveChanged(0, 1);

RunScript( "RevealObjective1", 5000);

Suicide();

end;

end;

function RevealObjective1()

ObjectiveChanged(1, 0);

RunScript( "Objective1", 3000);

Suicide();

end;

function Objective1()

if (GetNScriptUnitsInArea (1, "Farmer_House") == 1) then

SetIGlobalVar("Tutorial.objective.1", 1);

ObjectiveChanged(1, 1);

RunScript( "RevealObjective2", 5000);

Suicide();

end;

end;

function RevealObjective2()

ObjectiveChanged(2, 0);

RunScript( "Objective2", 3000);

Suicide();

end;

function Objective2()

if (GetNScriptUnitsInArea (1, "Swim") == 1) then

SetIGlobalVar("Tutorial.objective.2", 1);

ObjectiveChanged(2, 1);

Suicide();

end;

end;

function ToWin()

if ((GetIGlobalVar("Tutorial.objective.0", 0) * GetIGlobalVar("Tutorial.objective.1", 0) *

GetIGlobalVar("Tutorial.objective.2", 0)) == 1) then

Win(0);

Suicide();

end;

end;

function TobeDefeated()

if (GetNUnitsInScriptGroup (1, 0) < 1) then

Loose();

Suicide();

end;

end;

function Init()

RunScript( "ToWin", 4000);

RunScript( "TobeDefeated", 4000);

RunScript( "RevealObjective0", 3000);

end;

---*** End of script ***---

Bind Script File to Map

Now we need to bind the script file to the map, to do this from the Map-Editor main menu select “Map” then “Script or simply click on the Script icon [image] to bring up the following menu. Click “browse” and select the file we just saved as “tutorial.lua”. The Set Script File menu should be set to the default location run\data\maps and you should be able to see the lua file you just made if not that is where it is located.

Click OK and the menu will close and the script file is now bound to your map. Save the map and close the Map-Editor.
 Things to know for this mission scripting:

iScriptID = 1

iPlayer = 0 Human

iPlayer = 1 Computer

strScriptAreaName = Tree (Objective0)

strScriptAreaName = Farmer_House (Objective1)

strScriptAreaName = Swim (Objective2)

strGlobalVarName = Tutorial.objective.0

strGlobalVarName = Tutorial.objective.1

strGlobalVarName = Tutorial.objective.2

iPeriodicity = time in milliseconds

2000 = 2 seconds

3000 = 3 seconds

4000 = 4 seconds

5000 = 5 seconds

iObjNum = 0bjective#

iState = either 0, 1 or 2 depending on condition

0 = objective received

1 = objective completed

2 = objective failed

Equal ==

< Less than

<= Less than or equal to

> Greater than

>= Greater than or equal to

* multiplication


Resource Editor

Start the resource editor, from the menu bar at the top of the editor click File, then New Project, and then select the following folder to save the mip file then click save:

Blitzkrieg\Run\mods\mymod\data\scenarios\custom\missions\tutorial

Next from the menu bar click Editors and then select Mission Editor, now you are ready to setup your map/mission so that it can be seen and played as a custom mission from the game.

The first thing that you want to do is add your missions basic info, from the tool tree menu on the left side of the editor click on Basic Info; Basic Info should now be highlighted with a red arrow to the left. Below the tool tree menu is another menu with two columns one is properties the other is value; this is where you will bind your missions basic info text files to the mip file.

Adding Text Files

In the properties column click in the header text row and a browse button (right hand side of row with

three dots on it) now go to the folder where you saved the mission text files

(Blitzkrieg\Run\mods\mymod\data\scenarios\custom\missions\tutorial) select the file named “header.txt”, in the values column in the header text row you should see “header”. Follow this same procedure for the sub header and descriptions rows. Next we’ll add the template map by clicking in the template map row and selecting the “tutorial map” from the list of maps, once again follow this same procedure to add the final map and you should now have all of your basic info set.

Note: The Template map & Settings file row is used for random missions.

Your basic info fields should now look like this.

Now we will add music to the mission, you must have at least one Combat music and one Exploration music added to the mission file otherwise you will get an error when you try to export the mission file.


Adding Music

In the Basic Info area of from the tool tree menu click on “Combat music’s” it should now be highlight in blue, next press the “Insert” key on your keyboard to add a Combat music slot.

Now in the properties column click in the Music Reference row, then click the browse button and select one of the combat music files from the list of music files. I chose “combat1” but it doesn’t matter you can pick anyone from the list. Note: You can have more then one selection of combat music if you choose.

In the Basic Info area of from the tool tree menu click on “Exploration music’s” it should now be highlight in blue, next press the “Insert” key on your keyboard to add a Exploration music slot.

Now in the properties column click in the Music Reference row, then click the browse button and select one of the exploration music files from the list of music files. I chose “explore1” but it doesn’t matter you can pick anyone from the list. Note: You can have more then one selection of exploration music if you choose.


Adding Objective Files

Next click on the first objective to add the text files for Objective0,

(Blitzkrieg\Run\mods\mymod\data\scenarios\custom\missions\tutorial). 0h.txt for Objective header and 0.txt for Objective.txt.

Follow this same procedure to add 1h.txt for Objective header and 1.txt for Objective text to Objective1.

Follow this same procedure to add 2h.txt for Objective header and 2.txt for Objective text to Objective2.

Note: Objective script flag and Objective script ID can remain as they are.


Adding the Objective Markers

Next go to objectives click and then right click to bring up the insert option then press the insert button to add objective, do this (3) times one for each of the objectives in your mission.

Just above the menu tree there is a button, click the button and a mini map of your mission will be

created.

Click on the first objective in your objectives list

You will notice in the upper left hand corner of your mini map a blue x shaped marker, click on the 1st

objective then hover the cursor over this marker click and hold down the mouse button and drag the

marker over the shade tree.

Drag the x-shaped marker over the shade tree.

Click on the 2nd objective then hover the cursor over this marker (marker moved back to the upper left

hand corner of mini map) click and hold down the mouse button and drag the marker over the Farmers

house.

Click on the 3rd objective then hover the cursor over this marker (marker moved back to the upper left

hand corner of mini map) click and hold down the mouse button and drag the marker over the Swim area.


Exporting the Mission File

Now you’re ready to export the mission info to an xml file; click File and then select export.

Make sure the export path is (THIS IS VERY IMPORTANT!!!!!):

Blitzkrieg\Run\mods\mymod\data\scenarios\custom\missions\tutorial

Creating the Pak File

Now you are ready to create the .pak file for this mission.

Go to: Blitzkrieg\Run\mods\mymod\data\scenarios\custom\missions\tutorial highlight and copy the following files:

Header.txt

Subheader.txt

Description.txt

0.txt

0h.txt

1.txt

1h.txt

2.txt

2h.txt

1.xml

Paste these files into:

Blitzkreig\Run\map_to_pak\tutorial\scenarios\custom\missions\tutorial

Next go to run\data\maps highlight and copy the following files:

Tutorial.bzm

Tutorial.lua

Paste these files into:

Blitzkreig\Run\map_to_pak\tutorial\maps

Now inside of the Blitzkreig\Run\map_to_pak\tutorial folder highlight the maps and scenarios folders right click (use directions below to set winzip up to create pak files) and select add to zip, to compress as a pak (name the file tutorial.pak) file then click add. Once the file has been zipped in \Run\map_to_pak\tutorial\tutorial.pak highlight the pak file the copy and paste it into Blitzkrieg\Run\data … That’s it you now should be able to open this mission in the custom mission menu and test the mission.

Use WinZip to Create a Pak File

Right click on pak file; from the menu select "open with"; then select “Choose program";

then select "WinZip Executable"; then check “Always use selected program to open this

kind of file”….. Now you can open pak files with WinZip.


TRANSPORT-SUPPLY TRUCK DEPLOYMEN

TRANSPORT-SUPPLY TRUCK DEPLOYMENT GUIDE

Author wespex

Content

ALLIES

• AEC_Matador_Cargo_GB
• M2_HalfTruck_GB
• M2_HalfTruck_USA
• M3_HalfTruck_GB
• M3_HalfTruck_USA
• M3A1_Scout_Car_USA
• M5_Tractor_USA
• Studebaker_Cargo_USA

AXIS

• Fiat_Spa_AS37_Cargo_Italian
• Opel-Blitz Truck
• Raupenschlepper_Ost_RSO
• Opel_Maultier_Cargo
• Sdkfz_7
• Sdkfz_8
• SdKfz_251_Ausf_A_C_Hanomag
• SdKfz_251_Ausf_D_Hanomag

RUSSIAN

• Komintern
• Studebaker_Cargo
• Voroshilovets
• ZIS_5_Cargo
• ZIS_42_Cargo


ALLIES TRANSPORT-SUPPLY AEC_Mat

ALLIES TRANSPORT-SUPPLY

• AEC_Matador_Cargo_GB
• M2_HalfTruck_GB
• M2_HalfTruck_USA
• M3_HalfTruck_GB
• M3_HalfTruck_USA
• M3A1_Scout_Car_USA
• M5_Tractor_USA
• Studebaker_Cargo_USA

AEC_Matador_Cargo_GB

• Can Re-supply Units

• Can Reinforce Units

TOW-ABLE ARTILLERY PIECES
AXIS | ALLIES | RUSSIAN
2_cm_FlaK30_38 | 2pdr_QFG_GB | 37_mm_61_K
5_barrel_Nebelwerfer_42 | 4_5_inch_Gun_GB | 45_mm_M_37
5_cm_Pak38 | 6pdr_QFG_GB | 57_mm_ZIS_2
6_barrel_Nebelwerfer_41 | 25pdr_QFH_GB | 76_2mm_F22
7_5_cm_PaK40 | 25pdr_QFH_Polish | 76_mm_ZIS_3
7_62_cm_Pak36 | 40mm_Bofors_GB | 85_mm_52_K
8_8_cm_FlaK18 | 76mm _M1A1_USA | 100_mm_BS_3
10_5_cm_Flak38 | 90mm_M2_USA | 122_mm_A_19
10_5_cm_LeFH18 | 105mm_M2A1_USA | 122_mm_M_30
10_cm_K_18 | 155mm_M1_USA | 152_mm_D1
15_cm_sFH18 |  | 152_mm_ML_20
15cmK39 |
17cmK18
25pdr_QFH_Finland
75_18_Mod35_Italian

M2_HalfTruck_GB

• Can Re-supply Units

TOW-ABLE ARTILLERY PIECES
AXIS | ALLIES | RUSSIAN
2_cm_FlaK30_38 | 2pdr_QFG_GB | 37_mm_61_K
5_barrel_Nebelwerfer_42 | 4_5_inch_Gun_GB | 45_mm_M_37
5_cm_Pak38 | 6pdr_QFG_GB | 57_mm_ZIS_2
6_barrel_Nebelwerfer_41 | 25pdr_QFH_GB | 76_2mm_F22
7_5_cm_PaK40 | 25pdr_QFH_Polish | 76_mm_ZIS_3
7_62_cm_Pak36 | 40mm_Bofors_GB | 85_mm_52_K
8_8_cm_FlaK18 | 76mm_M1A1_USA | 100_mm_BS_3
10_5_cm_LeFH18 | 90mm_M2_USA | 122_mm_A_19
10_cm_K_18 | 105mm_M2A1_USA | 122_mm_M_30
15_cm_sFH18 | 155mm_M1_USA | 152_mm_D1
25pdr_QFH_Finland |  | 152_mm_ML_20
75_18_Mod35_Italian |

M2_HalfTruck_USA

• Can Re-supply Units

TOW-ABLE ARTILLERY PIECES
AXIS | ALLIES | RUSSIAN
2_cm_FlaK30_38 | 2pdr_QFG_GB | 37_mm_61_K
5_barrel_Nebelwerfer_42 | 4_5_inch_Gun_GB | 45_mm_M_37
5_cm_Pak38 | 6pdr_QFG_GB | 57_mm_ZIS_2
6_barrel_Nebelwerfer_41 | 25pdr_QFH_GB | 76_2mm_F22
7_5_cm_PaK40 | 25pdr_QFH_Polish | 76_mm_ZIS_3
7_62_cm_Pak36 | 40mm_Bofors_GB | 85_mm_52_K
8_8_cm_FlaK18 | 76mm_M1A1_USA | 100_mm_BS_3
10_5_cm_LeFH18 | 90mm_M2_USA | 122_mm_A_19
10_cm_K_18 | 105mm_M2A1_USA | 122_mm_M_30
15_cm_sFH18 | 155mm_M1_USA | 152_mm_D1
25pdr_QFH_Finland |  | 152_mm_ML_20
75_18_Mod35_Italian |

M3_HalfTruck_GB

• Can Re-supply Units

TOW-ABLE ARTILLERY PIECES
AXIS | ALLIES | RUSSIAN
2_cm_FlaK30_38 | 2pdr_QFG_GB | 37_mm_61_K
5_barrel_Nebelwerfer_42 | 4_5_inch_Gun_GB | 45_mm_M_37
5_cm_Pak38 | 6pdr_QFG_GB | 57_mm_ZIS_2
6_barrel_Nebelwerfer_41 | 25pdr_QFH_GB | 76_2mm_F22
7_5_cm_PaK40 | 25pdr_QFH_Polish | 76_mm_ZIS_3
7_62_cm_Pak36 | 40mm_Bofors_GB | 85_mm_52_K
8_8_cm_FlaK18 | 76mm_M1A1_USA | 100_mm_BS_3
10_5_cm_LeFH18 | 90mm_M2_USA | 122_mm_A_19
10_cm_K_18 | 105mm_M2A1_USA | 122_mm_M_30
15_cm_sFH18 | 155mm_M1_USA | 152_mm_D1
25pdr_QFH_Finland |  | 152_mm_ML_20
75_18_Mod35_Italian |

M3_HalfTruck_USA

• Can Re-supply Units

TOW-ABLE ARTILLERY PIECES
AXIS | ALLIES | RUSSIAN
2_cm_FlaK30_38 | 2pdr_QFG_GB | 37_mm_61_K
5_barrel_Nebelwerfer_42 | 4_5_inch_Gun_GB | 45_mm_M_37
5_cm_Pak38 | 6pdr_QFG_GB | 57_mm_ZIS_2
6_barrel_Nebelwerfer_41 | 25pdr_QFH_GB | 76_2mm_F22
7_5_cm_PaK40 | 25pdr_QFH_Polish | 76_mm_ZIS_3
7_62_cm_Pak36 | 40mm_Bofors_GB | 85_mm_52_K
8_8_cm_FlaK18 | 76mm_M1A1_USA | 100_mm_BS_3
10_5_cm_LeFH18 | 90mm_M2_USA | 122_mm_A_19
10_cm_K_18 | 105mm_M2A1_USA | 122_mm_M_30
15_cm_sFH18 | 155mm_M1_USA | 152_mm_D1
25pdr_QFH_Finland |  | 152_mm_ML_20
75_18_Mod35_Italian |

M3A1_Scout_Car_USA

• Can Re-supply Units

TOW-ABLE ARTILLERY PIECES
AXIS | ALLIES | RUSSIAN
2_cm_FlaK30_38 | 2pdr_QFG_GB | 37_mm_61_K
5_barrel_Nebelwerfer_42 | 4_5_inch_Gun_GB | 45_mm_M_37
5_cm_Pak38 | 6pdr_QFG_GB | 57_mm_ZIS_2
6_barrel_Nebelwerfer_41 | 25pdr_QFH_GB | 76_2mm_F22
7_5_cm_PaK40 | 25pdr_QFH_Polish | 76_mm_ZIS_3
7_62_cm_Pak36 | 40mm_Bofors_GB | 85_mm_52_K
10_5_cm_LeFH18 | 76mm_M1A1_USA | 100_mm_BS_3
10_cm_K_18 | 105mm_M2A1_USA | 122_mm_M_30
25pdr_QFH_Finland | 155mm_M1_USA | 152_mm_D1
75_18_Mod35_Italian |

M5_Tractor_USA

• Can Re-supply Units

TOW-ABLE ARTILLERY PIECES
AXIS | ALLIES | RUSSIAN
2_cm_FlaK30_38 | 2pdr_QFG_GB | 37_mm_61_K
5_barrel_Nebelwerfer_42 | 4_5_inch_Gun_GB | 45_mm_M_37
5_cm_Pak38 | 6pdr_QFG_GB | 57_mm_ZIS_2
6_barrel_Nebelwerfer_41 | 25pdr_QFH_GB | 76_2mm_F22
7_5_cm_PaK40 | 25pdr_QFH_Polish | 76_mm_ZIS_3
7_62_cm_Pak36 | 40mm_Bofors_GB | 85_mm_52_K
8_8_cm_FlaK18 | 76mm_M1A1_USA | 100_mm_BS_3
10_5_cm_Flak38 | 90mm_M2_USA | 122_mm_A_19
10_5_cm_LeFH18 | 105mm_M2A1_USA | 122_mm_M_30
10_cm_K_18 | 155mm_M1_USA | 152_mm_D1
15_cm_sFH18 |  | 152_mm_ML_20
15cmK39 |
25pdr_QFH_Finland
75_18_Mod35_Italian

Studebaker_Cargo_USA

• Can Re-supply Units

• Can Reinforce Units

TOW-ABLE ARTILLERY PIECES
AXIS | ALLIES | RUSSIAN
2_cm_FlaK30_38 | 2pdr_QFG_GB | 37_mm_61_K
5_barrel_Nebelwerfer_42 | 4_5_inch_Gun_GB | 45_mm_M_37
5_cm_Pak38 | 6pdr_QFG_GB | 57_mm_ZIS_2
6_barrel_Nebelwerfer_41 | 25pdr_QFH_GB | 76_2mm_F22
7_5_cm_PaK40 | 25pdr_QFH_Polish | 76_mm_ZIS_3
7_62_cm_Pak36 | 40mm_Bofors_GB | 85_mm_52_K
10_5_cm_LeFH18 | 76mm_M1A1_USA | 100_mm_BS_3
10_cm_K_18 | 105mm_M2A1_USA | 122_mm_M_30
25pdr_QFH_Finland | 155mm_M1_USA | 152_mm_D1
75_18_Mod35_Italian |


New Page 1

AXIS TRANSPORT-SUPPLY

• Fiat_Spa_AS37_Cargo_Italian
• Opel-Blitz Truck
• Raupenschlepper_Ost_RSO
• Opel_Maultier_Cargo
• Sdkfz_7
• Sdkfz_8
• SdKfz_251_Ausf_A_C_Hanomag
• SdKfz_251_Ausf_D_Hanomag

Fiat Spa AS37 Light Truck

• Can Re-supply Units

• Can Reinforce Units

TOW-ABLE ARTILLERY PIECES
AXIS | ALLIES | RUSSIAN
7_5_cm_PaK40 | 6pdr_QFG_GB | 57_mm_ZIS_2
5_cm_Pak38 | 2pdr_QFG_GB | 45_mm_M_37
5_barrel_Nebelwerfer_42 |
6_barrel_Nebelwerfer_41
2_cm_FlaK30_38
75_18_Mod35_Italian

Opel_Blitz_Cargo

• Can Re-supply Units

• Can Reinforce Units

TOW-ABLE ARTILLERY PIECES
AXIS | ALLIES | RUSSIAN
7_5_cm_PaK40 | 155mm_M1A1_USA | 37_mm_61_K
5_cm_Pak38 | 105mm_M2A1_USA | 76_2mm_F22
7_62_cm_Pak36 | 25pdr_QFH_GB | 57_mm_ZIS_2
5_barrel_Nebelwerfer_42 | 25pdr_QFH_Polish | 76_mm_ZIS_3
6_barrel_Nebelwerfer_41 | 6pdr_QFG_GB | 45_mm_M_37
2_cm_FlaK30_38 | 2pdr_QFG_GB |
75_18_Mod35_Italian |

RSO Light Hauler

• Can Re-supply Units

TOW-ABLE ARTILLERY PIECES
AXIS | ALLIES | RUSSIAN
7_5_cm_PaK40 | 25pdr_QFH_GB | 76_2mm_F22
5_barrel_Nebelwerfer_42 | 25pdr_QFH_Polish | 57_mm_ZIS_2
6_barrel_Nebelwerfer_41 | 6pdr_QFG_GB | 76_mm_ZIS_3
2_cm_FlaK30_38 | 2pdr_QFG_GB | 45_mm_M_37
75_18_Mod35_Italian |
7_62_cm_Pak36

Opel_Maultier_Cargo

• Can Re-supply Units

• Can Reinforce Units

TOW-ABLE ARTILLERY PIECES
AXIS | ALLIES | RUSSIAN
7_5_cm_PaK40 | 2pdr_QFG_GB | 37_mm_61_K
5_cm_Pak38 | 4_5_inch_Gun_GB | 45_mm_M_37
7_62_cm_Pak36 | 6pdr_QFG_GB | 57_mm_ZIS_2
10_5_cm_LeFH18 | 25pdr_QFH_GB | 76_2mm_F22
10_cm_K_18 | 25pdr_QFH_Polish | 76_mm_ZIS_3
15_cm_sFH18 | 40mm_Bofors_GB | 85_mm_52_K
25pdr_QFH_Finland | 76mm_M1A1_USA | 100_mm_BS_3
75_18_Mod35_Italian | 90mm_M2_USA | 122_mm_A_19
6_barrel_Nebelwerfer_41 | 105mm_M2A1_USA | 122_mm_M_30
5_barrel_Nebelwerfer_42 | 155mm_M1_USA | 152_mm_D1
2_cm_FlaK30_38 |  | 152_mm_ML_20

Sdkfz_7

• Can Re-supply Units

TOW-ABLE ARTILLERY PIECES
AXIS | ALLIES | RUSSIAN
7_5_cm_PaK40 | 2pdr_QFG_GB | 37_mm_61_K
5_cm_Pak38 | 4_5_inch_Gun_GB | 45_mm_M_37
7_62_cm_Pak36 | 6pdr_QFG_GB | 57_mm_ZIS_2
10_5_cm_LeFH18 | 25pdr_QFH_GB | 76_2mm_F22
10_cm_K_18 | 25pdr_QFH_Polish | 76_mm_ZIS_3
15_cm_sFH18 | 40mm_Bofors_GB | 85_mm_52_K
25pdr_QFH_Finland | 76mm_M1A1_USA | 100_mm_BS_3
75_18_Mod35_Italian | 90mm_M2_USA | 122_mm_A_19
6_barrel_Nebelwerfer_41 | 105mm_M2A1_USA | 122_mm_M_30
5_barrel_Nebelwerfer_42 | 155mm_M1_USA | 152_mm_D1
2_cm_FlaK30_38 |  | 152_mm_ML_20
8_8_cm_FlaK18 |

Sdkfz_8

• Can Re-supply Units

TOW-ABLE ARTILLERY PIECES
AXIS | ALLIES | RUSSIAN
7_5_cm_PaK40 | 2pdr_QFG_GB | 37_mm_61_K
5_cm_Pak38 | 4_5_inch_Gun_GB | 45_mm_M_37
7_62_cm_Pak36 | 6pdr_QFG_GB | 57_mm_ZIS_2
10_5_cm_LeFH18 | 25pdr_QFH_GB | 76_2mm_F22
10_cm_K_18 | 25pdr_QFH_Polish | 76_mm_ZIS_3
15_cm_sFH18 | 40mm_Bofors_GB | 85_mm_52_K
25pdr_QFH_Finland | 76mm_M1A1_USA | 100_mm_BS_3
75_18_Mod35_Italian | 90mm_M2_USA | 122_mm_A_19
6_barrel_Nebelwerfer_41 | 105mm_M2A1_USA | 122_mm_M_30
5_barrel_Nebelwerfer_42 | 155mm_M1_USA | 152_mm_D1
2_cm_FlaK30_38 |  | 152_mm_ML_20
8_8_cm_FlaK18 |
10_5_cm_Flak38
15cmK39
17cmK18

SdKfz_251_Ausf_A_C_Hanomag

• Can Re-supply Units

TOW-ABLE ARTILLERY PIECES
AXIS | ALLIES | RUSSIAN
7_5_cm_PaK40 | 2pdr_QFG_GB | 37_mm_61_K
5_cm_Pak38 | 4_5_inch_Gun_GB | 45_mm_M_37
7_62_cm_Pak36 | 6pdr_QFG_GB | 57_mm_ZIS_2
10_5_cm_LeFH18 | 25pdr_QFH_GB | 76_2mm_F22
10_cm_K_18 | 25pdr_QFH_Polish | 76_mm_ZIS_3
25pdr_QFH_Finland | 40mm_Bofors_GB | 85_mm_52_K
75_18_Mod35_Italian | 76mm_M1A1_USA | 100_mm_BS_3
6_barrel_Nebelwerfer_41 | 90mm_M2_USA | 122_mm_M_30
5_barrel_Nebelwerfer_42 | 105mm_M2A1_USA | 152_mm_D1
2_cm_FlaK30_38 | 155mm_M1_USA |

SdKfz_251_Ausf_D_Hanomag

• Can Re-supply Units

TOW-ABLE ARTILLERY PIECES
AXIS | ALLIES | RUSSIAN
7_5_cm_PaK40 | 2pdr_QFG_GB | 37_mm_61_K
5_cm_Pak38 | 4_5_inch_Gun_GB | 45_mm_M_37
7_62_cm_Pak36 | 6pdr_QFG_GB | 57_mm_ZIS_2
10_5_cm_LeFH18 | 25pdr_QFH_GB | 76_2mm_F22
10_cm_K_18 | 25pdr_QFH_Polish | 76_mm_ZIS_3
25pdr_QFH_Finland | 40mm_Bofors_GB | 85_mm_52_K
75_18_Mod35_Italian | 76mm_M1A1_USA | 100_mm_BS_3
6_barrel_Nebelwerfer_41 | 90mm_M2_USA | 122_mm_M_30
5_barrel_Nebelwerfer_42 | 105mm_M2A1_USA | 152_mm_D1
2_cm_FlaK30_38 | 155mm_M1_USA |


New Page 1

RUSSIAN TRANSPORT-SUPPLY

• Komintern
• Studebaker_Cargo
• Voroshilovets
• ZIS_5_Cargo
• ZIS_42_Cargo

Komintern

• Can Re-supply Units

TOW-ABLE ARTILLERY PIECES
AXIS | ALLIES | RUSSIAN
7_5_cm_PaK40 | 2pdr_QFG_GB | 37_mm_61_K
5_cm_Pak38 | 4_5_inch_Gun_GB | 45_mm_M_37
7_62_cm_Pak36 | 6pdr_QFG_GB | 57_mm_ZIS_2
10_5_cm_LeFH18 | 25pdr_QFH_GB | 76_2mm_F22
10_cm_K_18 | 25pdr_QFH_Polish | 76_mm_ZIS_3
15_cm_sFH18 | 40mm_Bofors_GB | 85_mm_52_K
25pdr_QFH_Finland | 76mm_M1A1_USA | 100_mm_BS_3
75_18_Mod35_Italian | 90mm_M2_USA | 122_mm_A_19
6_barrel_Nebelwerfer_41 | 105mm_M2A1_USA | 122_mm_M_30
5_barrel_Nebelwerfer_42 | 155mm_M1_USA | 152_mm_D1
2_cm_FlaK30_38 |  | 152_mm_ML_20
8_8_cm_FlaK18 |  |

Studebaker_Cargo

• Can Re-supply Units

• Can Reinforce Units

TOW-ABLE ARTILLERY PIECES
AXIS | ALLIES | RUSSIAN
7_5_cm_PaK40 | 2pdr_QFG_GB | 37_mm_61_K
5_cm_Pak38 | 4_5_inch_Gun_GB | 45_mm_M_37
7_62_cm_Pak36 | 6pdr_QFG_GB | 57_mm_ZIS_2
10_5_cm_LeFH18 | 25pdr_QFH_GB | 76_2mm_F22
10_cm_K_18 | 25pdr_QFH_Polish | 76_mm_ZIS_3
25pdr_QFH_Finland | 40mm_Bofors_GB | 85_mm_52_K
75_18_Mod35_Italian | 76mm_M1A1_USA | 100_mm_BS_3
6_barrel_Nebelwerfer_41 | 105mm_M2A1_USA | 122_mm_M_30
5_barrel_Nebelwerfer_42 | 155mm_M1_USA | 152_mm_D1
2_cm_FlaK30_38 |

Voroshilovets

• Can Re-supply Units

TOW-ABLE ARTILLERY PIECES
AXIS | ALLIES | RUSSIAN
10_5_cm_LeFH18 | 105mm_M2A1_USA | 100_mm_BS_3
10_5_cm_Flak38 | 155mm_M1A1_USA | 122_mm_A_19
10_cm_K_18 | 155mm_M1_USA | 122_mm_M_30
7_62_cm_Pak36 | 25pdr_QFH_GB | 152_mm_ML_20
15_cm_sFH18 | 25pdr_QFH_Polish | 152_mm_D1
15cmK39 | 2pdr_QFG_GB | 37_mm_61_K
17cmK18 | 40mm_Bofors_GB | 45_mm_M_37
25pdr_QFH_Finland | 4_5_inch_Gun_GB | 57_mm_ZIS_2
2_cm_FlaK30_38 | 6pdr_QFG_GB | 76_mm_ZIS_3
5_barrel_Nebelwerfer_42 | 76mm_M1A1_USA | 76_2mm_F22
5_cm_Pak38 | 90mm_M2_USA | 85_mm_52_K
6_barrel_Nebelwerfer_41 |
8_8_cm_FlaK18
7_5_cm_PaK40
75_18_Mod35_Italian

ZIS_5_Cargo

• Can Re-supply Units

• Can Reinforce Units

TOW-ABLE ARTILLERY PIECES
AXIS | ALLIES | RUSSIAN
7_5_cm_PaK40 | 2pdr_QFG_GB | 37_mm_61_K
5_cm_Pak38 | 6pdr_QFG_GB | 45_mm_M_37
7_62_cm_Pak36 | 25pdr_QFH_GB | 57_mm_ZIS_2
25pdr_QFH_Finland | 25pdr_QFH_Polish | 76_2mm_F22
75_18_Mod35_Italian | 40mm_Bofors_GB | 76_mm_ZIS_3
6_barrel_Nebelwerfer_41 | 76mm_M1A1_USA |
5_barrel_Nebelwerfer_42 | 105mm_M2A1_USA |
2_cm_FlaK30_38 |  |

ZIS_42_Cargo

• Can Re-supply Units

• Can Reinforce Units

TOW-ABLE ARTILLERY PIECES
AXIS | ALLIES | RUSSIAN
7_5_cm_PaK40 | 2pdr_QFG_GB | 37_mm_61_K
5_cm_Pak38 | 4_5_inch_Gun_GB | 45_mm_M_37
7_62_cm_Pak36 | 6pdr_QFG_GB | 57_mm_ZIS_2
10_5_cm_LeFH18 | 25pdr_QFH_GB | 76_2mm_F22
10_cm_K_18 | 25pdr_QFH_Polish | 76_mm_ZIS_3
25pdr_QFH_Finland | 40mm_Bofors_GB | 85_mm_52_K
75_18_Mod35_Italian | 76mm_M1A1_USA | 100_mm_BS_3
6_barrel_Nebelwerfer_41 | 105mm_M2A1_USA | 122_mm_M_30
5_barrel_Nebelwerfer_42 | 155mm_M1_USA | 152_mm_D1
2_cm_FlaK30_38 |


New Page 1

Start Commands


New Page 1

Move_To Tutorial

By wespex

This is a simple tutorial for beginners showing how to creat a moving convoy using the “Start Commands” in the Bk Map-Editor.

Create a 3x3 map and add a road along the center of the map running west to east (left to right) with some slight bends. Now add three transport-supply trucks on the west-side road.

Select the front truck in the convoy

To get to the “Start Commands” select “Unit” from the main menu

You will see three choices to choose from. Note: when you first start a Start Command only two choices are available “Add Start Command & Artillery Positions.

Left-click to open.

The “Add Start Commands List” Box appears

VIS tile/Script display located at the bottom of the map editor

Double-click on the word Stop to activate the drop-down list.

Note: you can either type the letter M to bring up Move_To or click on the

drop-down arrow and select Move_To from the list.

Left-click on the road directly in front of the transport truck

Repeat for the 2nd Move_To location selection

Repeat for the 3rd Move_To location selection

Repeat for the 4th Move_To location selection

Repeat for the 5th Move_To location selection

Repeat for the 6th Move_To location selection

Repeat for the 7th Move_To location selection

Repeat for the last Move_To location selection

This is an easy way to get the trucks to appear to drive on the road; you will have to repeat the process for each truck to end up exactly where you want them to show up. To add some protection for your convoy you can use these same steps for combat vehicles only select Swarm_To from the drop-down list to have the convoy defend itself while moving down the road. You may also want to leave plenty of space between any non-combat vehicles and the combat vehicles so that they do not end up in the cross fire. Once the enemy attackers are eliminated the convoy continues on its pre-defined route.

This method is assuming that these vehicles are here from the start of the mission otherwise we would have to add them as reinforcements with script.


New Page 1

Attach Artillery to Transport-Supply Truck

Start Command

To attach the AI artillery unit to an AI transport-supply truck in the map editor select the transport-supply truck and drag it on top of the artillery unit you want to hitch; a black arrow pointing upwards will appear when the two units have been successfully linked together as shown in Figure 1 below.

Figure 1

To deploy the attached artillery unit select “Unit” from the main menu bar and then select “Add Start Command” as shown in Figure 2 below:

Figure 2

Now from the Add Start Command menu under the “Value” column click on the default choice “Stop” and from the drop down menu scroll up and then select “Deploy Artillery as shown in Figure 3 below:

Figure 3

Now enter the x, y positions of where you want the artillery unit to be deployed as shown in Figure 4 below:

Figure 4


New Page 1

Scripting Examples

TransportArtillery


New Page 1

Lua Scripting example to script a transport truck to move an artillery piece from one location to another location.

1. Create a simple 4x4 map select "Objects, Fences, Bridges", then select "Axis Units" and add 2 units (10.5-cm_Flak38 & Sdkfz_8). Place the Sdkfz_8 (Truck) at x, y location (291, 351) and then place the 10.5-cm_Flak38 (Anti-Air Gun) at

x, y location (715, 1147).

2. Now select "Map Tools" and then choose Circle from the "Script Tools Area"; drag a circle over x, y location (291, 351); drag across about two inches and then name "Zone1".

3. Choose Circle from the "Script Tools Area"; drag a circle over x, y location (715, 1147); drag across about two inches and then name "Zone2".

4. Choose Circle from the "Script Tools Area"; drag a circle over x, y location (1274, 2626); drag across about two inches and then name "Zone3".

5. Create the lua script file by copying the script below and pasting it in a text file and save it in your blitzkrieg\data\maps folder as "hitch.lua". Then attach the lua file to your map and run to test.

ViewZone ("Zone1", 1);

ViewZone ("Zone2", 1);

ViewZone ("Zone3", 1);

function Hual()

local Hitch_It = 31;

local UnHitch_It = 32;

Cmd(Hitch_It, 1, 3);

QCmd(UnHitch_It, 1, 1291, 2607);

RunScript( "Back", 5000);

Suicide();

end;

function Back()

local Move_It = 0;

Cmd(Move_It, 1, 291, 351);

Suicide();

end;

function Init()

RunScript( "Hual", 5000);

end;