# Full mod development documentation
> Built from the canonical Markdown sources.
---
# Asynchronous Programming with adisp
> Canonical URL: https://docs.wotstat.info/en/articles/adisp/
> Markdown URL: https://docs.wotstat.info/en/articles/adisp/index.md
> Source: https://github.com/wotstat/mods-development-docs/blob/main/docs/en/articles/adisp/index.md
The game client runs on `Python 2.7` where native `async/await` does not exist. For asynchronous style code it uses the `adisp` library, which lets you write coroutine style logic (similar to async/await) using generators.
## `adisp_process`
The `@adisp_process` decorator declares a procedure as a coroutine that can use `yield` to wait for other asynchronous functions. Such a procedure **cannot return a value**.
```python
from adisp import adisp_process
@adisp_process
def myAsyncFunction():
print('Before yield')
result = yield someAsyncFunction()
print('Result is:', result)
myAsyncFunction()
```
## `adisp_async`
The `@adisp_async` decorator declares a function that can be awaited (yielded from) inside an `@adisp_process`, and **can return a result** of an asynchronous operation via a `callback`.
```python
from adisp import adisp_process, adisp_async
@adisp_async
def someAsyncFunction(callback):
BigWorld.callback(1, lambda: callback(42)) # Simulate async operation with delay
@adisp_process
def myAsyncFunction():
print('Before yield')
result = yield someAsyncFunction()
print('Result is:', result)
myAsyncFunction()
```
## Combining
You can combine `@adisp_process` and `@adisp_async` to build complex asynchronous chains.
```python
from adisp import adisp_process, adisp_async
@adisp_async
def someAsyncFunction(callback):
BigWorld.callback(1, lambda: callback(42)) # Simulate async operation with delay
@adisp_async
@adisp_process
def anotherAsyncFunction(callback):
print('Before yield in anotherAsyncFunction')
result = yield someAsyncFunction()
print('Result in anotherAsyncFunction is:', result)
callback(result * 2)
@adisp_process
def myAsyncFunction():
print('Before yield in myAsyncFunction')
result = yield anotherAsyncFunction()
print('Result in myAsyncFunction is:', result)
myAsyncFunction()
```
---
# How to Create a Context Menu
> Canonical URL: https://docs.wotstat.info/en/articles/how-to-create-context-menu/
> Markdown URL: https://docs.wotstat.info/en/articles/how-to-create-context-menu/index.md
> Source: https://github.com/wotstat/mods-development-docs/blob/main/docs/en/articles/how-to-create-context-menu/index.md

A context menu is a pop-up menu that appears when the user right-clicks on a UI element.
## Imperative Approach
1. Subclass `AbstractContextMenuHandler`.
2. Initialize handler mapping using the schema ButtonName: function_name.
3. Implement `_generateOptions` (use `self._makeItem` and `self._makeSeparator` helpers).
4. Register your handler under a unique name.
5. Call it by that name from Python or Flash.
You can set custom text, text color, enabled state. Icon must be one of the built-in client icons (internally they are fetched by frame number from a large animation sheet).
```python
from gui.Scaleform.framework.managers import context_menu
from gui.Scaleform.framework.managers.context_menu import AbstractContextMenuHandler
DEMO_CONTEXT_MENU = 'DEMO_CONTEXT_MENU'
class BUTTONS(object):
TEST1 = 'TEST1'
TEST2 = 'TEST2'
class DemoContextMenuHandler(AbstractContextMenuHandler):
def __init__(self, cmProxy, ctx=None):
super(WidgetContextMenuHandler, self).__init__(cmProxy, ctx, {
BUTTONS.TEST1: 'onClickTest1',
BUTTONS.TEST2: 'onClickTest2'
})
@staticmethod
def register():
context_menu.registerHandlers(*[(DEMO_CONTEXT_MENU, DemoContextMenuHandler)])
def _generateOptions(self, ctx=None):
options = []
options.append(self._makeItem(BUTTONS.TEST1, 'Test 1 label'))
options.append(self._makeSeparator())
options.append(self._makeItem(BUTTONS.TEST2, 'Test 2 label', {
'textColor': 13347959,
'iconType': 'addToSquad',
'enabled': True
}))
return options
def onClickTest1(self):
print('onClickTest1')
def onClickTest2(self):
print('onClickTest2')
DemoContextMenuHandler.register()
```
### Call from Python
```python
from helpers import dependency
from skeletons.gui.app_loader import IAppLoader
appLoader = dependency.instance(IAppLoader) # type: IAppLoader
app = appLoader.getApp()
if app:
app.contextMenuManager.show('DEMO_CONTEXT_MENU', None)
```
### Call from Flash
```actionscript-3
App.contextMenuMgr.show('DEMO_CONTEXT_MENU');
```
## Declarative Approach
Inherit from `ContextMenu` and use the `@option(order, 'Label')` decorator on handler methods.
```python
from gui.Scaleform.daapi.view.lobby.shared.cm_handlers import ContextMenu, option
class DemoContextMenuHandler(ContextMenu):
@option(1, 'Test1')
def onClickTest1(self):
print('onClickTest1')
@option(2, 'Test2')
def onClickTest2(self):
print('onClickTest2')
```
> **TIP — TODO**
This section can be expanded with invocation examples and extra parameters, if available.
---
# How to create a widget for streams with remote control
> Canonical URL: https://docs.wotstat.info/en/articles/how-to-create-remote-control-widget/
> Markdown URL: https://docs.wotstat.info/en/articles/how-to-create-remote-control-widget/index.md
> Source: https://github.com/wotstat/mods-development-docs/blob/main/docs/en/articles/how-to-create-remote-control-widget/index.md
In this article, we’ll go **step by step** to create a stream widget with remote control. You can follow along and end up with a working widget.
Video: [open media](https://docs.wotstat.info/en/articles/how-to-create-remote-control-widget/assets/hero-widget.mp4)
## Preparation
All widgets are regular websites that run in the built-in browser of `OBS Studio`. Therefore, to create a widget you’ll need a standard web-development toolset.
To keep things simple, we won’t use any web frameworks and will implement everything with plain `HTML`, `CSS`, and `JavaScript`. However, we’ll still use `Vite` (a tool that simplifies development and bundling for publication).
### BunJS
Install `BunJS` — a modern package manager and JavaScript runtime. You can find installation instructions on the [official website](https://bun.sh/).
**Windows**
```powershell
powershell -c "irm bun.sh/install.ps1 | iex"
```
**Linux/MacOS**
```bash
curl -fsSL https://bun.sh/install | bash
```
### Visual Studio Code
You’ll also need `VSCode` — the code editor we’ll use for development. Download it from the [official website](https://code.visualstudio.com/).
### Project creation
Create a new folder for your project and open it in `VSCode`. Then open the terminal in `VSCode` (`Terminal` → `New Terminal`) and run:
```bash
bun create vite . --template vanilla
```
Press `Enter` a few times to accept the defaults.
**Details — Terminal output after running the command**

Your project will be set up, dependencies installed, and a local development server started (usually at `http://localhost:5174/`).
Open that address in your browser—you should see the `Hello Vite!` starter page.
Clean up the starter page: in `VSCode`, delete the `public` folder and the files `src/counter.js` and `src/javascript.svg`.
Edit the `src/main.js` file, removing everything except the stylesheet import:
**src/main.js**
```javascript
import './style.css'
```
Also completely clear the `src/style.css` file, leaving it empty.
Done! Thanks to `Vite`, every change in your files will be automatically reflected in the browser. You should now see a blank white page.
## Creating the widget
Development will consist of two stages:
- Create the widget’s visual design
- Add remote-control functionality
### Visual design of the widget
The widget’s design is completely up to you and depends on your task; the process is no different from building a regular website. In this article, we’ll create a simple LBZ (Personal Missions) counter. It consists of three blocks, each with a progress bar and the number of completed LBZ.
The only difference from a regular website is the widget’s dimensions. We’ll make it automatically fit the screen width so the streamer can use it at any resolution. To do this, we’ll set the font size to `1%` of the viewport width and specify all sizes in `em`.
**src/style.css**
```css
:root {
/* Transparent background */
color-scheme: dark;
background: transparent;
}
body {
/* Set font size based on window width */
font-size: 1vw;
/* Remove margin and hide scrollbars */
margin: 0;
overflow: hidden;
}
```
Now create the general structure of the widget in `index.html`:
**index.html**
```html
...
VI - VII уровень
18 / 25
...
```
Duplicate the `div.item` block twice, change the `h2` heading text, and add the `completed` class to the last `div.item`.
We’ll need some assets from the game, which you can find in the `gui.pkg` package or in the [Kurzdor/wot.assets](https://github.com/Kurzdor/wot.assets/tree/Lesta) repository.
- The font can be found at [`gui/gameface/fonts/Warhelios-Regular.ttf`](https://github.com/Kurzdor/wot.assets/tree/Lesta/gui/gameface/fonts/Warhelios-Regular.ttf)
- Progress-bar parts at [`/gui/maps/icons/components/progress_bar`](https://github.com/Kurzdor/wot.assets/tree/Lesta/gui/maps/icons/components/progress_bar)
- The checkmark for a completed stage at [`/gui/maps/icons/personalMissions3/QuestsView/complete.png`](https://github.com/Kurzdor/wot.assets/tree/Lesta/gui/maps/icons/personalMissions3/QuestsView/complete.png)
Copy the required assets into the `src/assets` folder of your project.
Adjust the styles in `style.css` to achieve the following result:
**Details — Full `style.css` source**
**src/style.css**
````css
:root {
/* Transparent background */
color-scheme: dark;
background: transparent;
}
@font-face {
font-family: Warhelios;
src: url(./assets/Warhelios-Regular.ttf) format("truetype");
}
body {
/* Set font size based on window width */
font-size: 1vw;
/* Remove margin and hide scrollbars */
margin: 0;
overflow: hidden;
font-family: Warhelios, sans-serif;
}
#app {
display: flex;
gap: 1em;
padding: 1em;
}
.item {
border-radius: 1.3em;
padding: 1.2em;
border: 0.25em solid rgba(255, 173, 65, 0.4);
background:
linear-gradient(0deg, rgba(195, 90, 4, 0.1), rgba(255, 255, 255, 0) 50%),
radial-gradient(farthest-corner at 50% 200%, rgba(251, 166, 20, 0.4), rgba(218, 139, 1, 0.3) 90%);
display: flex;
flex-direction: column;
flex: 1;
max-width: 30%;
box-shadow: 0 0 1em rgba(0, 0, 0, 0.2);
}
.completed {
border: 0.25em solid rgba(106, 255, 65, 0.3);
background:
linear-gradient(0deg, rgba(80, 255, 27, 0.3), rgba(26, 255, 0, 0) 50%),
radial-gradient(farthest-corner at 50% 200%, rgba(4, 102, 5, 0.4), rgba(13, 114, 0, 0.3) 90%);
}
header {
font-size: 1em;
display: flex;
}
header h2 {
flex: 1;
}
header h2,
header p {
font-size: 2.7em;
margin: 0;
font-weight: normal;
}
.current {
color: #ffd28f;
}
img {
width: 9em;
height: 9em;
margin: -3em;
display: none;
}
/* Progress bar */
.progress-bar {
height: 0.3em;
width: 100%;
margin-top: 1em;
position: relative;
}
/* Background part of the progress bar (gray rectangles) */
.progress-bar-background {
background-image: url(./assets/pattern_grey.png);
background-repeat: repeat;
background-position: 0 50%;
background-size: 0.4em 1em;
position: absolute;
width: 100%;
height: 100%;
box-shadow: 0 0 2em rgba(0, 0, 0, 0.5);
}
/* Current progress highlight (glow) */
.progress-bar-blink {
height: 5em;
width: 5em;
background-image: url(./assets//glow_small.png);
background-size: contain;
mix-blend-mode: lighten;
position: absolute;
transform: translate(-49%, -50%);
top: 50%;
left: var(--progress, 60%);
transition: left 0.2s ease;
}
/* Filled part of the progress bar */
.progress-bar-pattern {
background-image: url(./assets/pattern_orange.png);
background-repeat: repeat;
background-position: 0 50%;
background-size: 0.4em 1em;
position: absolute;
height: 100%;
width: var(--progress, 60%);
transition: width 0.2s ease;
}
/* Gradient highlight for the progress bar */
.progress-bar-pattern::after {
content: "";
position: absolute;
right: 0;
top: 0;
width: 100%;
height: 100%;
background-image: linear-gradient(90deg, rgba(0, 0, 0, 0.6), rgba(255, 206, 122, 0.5));
mix-blend-mode: overlay;
}
/* Overrides for completed stages */
.completed .progress-bar-pattern {
background-image: url(./assets/pattern_green.png);
width: 100%;
}
.completed .progress-bar-pattern::after {
background-image: linear-gradient(90deg, rgba(0, 0, 0, 0.6), rgba(187, 255, 78, 0.519), rgba(0, 0, 0, 0.6));
}
.completed .progress-bar-blink,
.completed header p {
display: none;
}
.completed img {
display: block;
}
````
**Details — Full `index.html` source**
**src/index.html**
````html
article-pm-widget
VI - VII tire
18 / 25
VII - IX tire
18 / 25
X - XI tire
18 / 25
````
As a result, you’ll get the following widget:

### Remote-control functionality
Now let’s add remote control. To do this, install the [`wotstat-widgets-sdk`](https://www.npmjs.com/package/wotstat-widgets-sdk) library and declare the widget’s remote parameters.
Run this command in the terminal:
**Windows**
```powershell
bun add wotstat-widgets-sdk
```
**Linux/MacOS**
```bash
bun add wotstat-widgets-sdk
```
In the `src/main.js` file, import the library and declare the widget parameters:
**src/main.js**
```javascript
import './style.css'
import { WidgetsRemote } from 'wotstat-widgets-sdk';
const remote = new WidgetsRemote();
remote.defineState('VI - VII уровень', 0, { elementHelper: '.item-1' });
remote.defineState('VII - IX уровень', 0, { elementHelper: '.item-2' });
remote.defineState('X - XI уровень', 0, { elementHelper: '.item-3' });
```
Now you can open your link in the widget control panel at [ru.widgets.wotstat.info/remote-control](https://ru.widgets.wotstat.info/remote-control) and make sure the widget parameters appear in the list; when you hover over a parameter, the corresponding widget block is outlined:

The outline works thanks to the `elementHelper` property, where we specified the CSS selector of the desired block.
Next, we need to handle parameter changes. Create an `updateState` function and subscribe to changes for each parameter using the `watch` method:
**src/main.js**
```javascript
...
function updateState(selector, value) {
const element = document.querySelector(selector);
// Set the counter value
element.querySelector('.current').textContent = value;
// Toggle the completed stage class
if (value >= 25) element.classList.add('completed');
else element.classList.remove('completed');
// Add a CSS variable for the progress bar
element.style.setProperty('--progress', `${100 * value / 25}%`);
}
remote.defineState('VI - VII уровень', 0, { elementHelper: '.item-1' })
.watch((v) => updateState('.item-1', v));
remote.defineState('VII - IX уровень', 0, { elementHelper: '.item-2' })
.watch((v) => updateState('.item-2', v));
remote.defineState('X - XI уровень', 0, { elementHelper: '.item-3' })
.watch((v) => updateState('.item-3', v));
```
Done! Now, when the parameters change in the control panel, the widget updates automatically.
## Publishing the widget
The final step is to publish the widget so it’s available for use over the internet.
First, build the project. In the terminal, run:
**Windows**
```powershell
bun run build
```
**Linux/MacOS**
```bash
bun run build
```
As a result, a `dist` folder will be created containing the site ready for publication.

You can host this site on any static hosting, for example:
- [wasmer.io](https://wasmer.io/) — free after registration (you can sign in with Google)
- [Yandex Cloud](https://cloud.yandex.ru/) in S3 hosting mode — free, but registration is complicated
- [GitHub Pages](https://docs.github.com/en/pages/quickstart/) — free, but requires registration and creating a repository on GitHub
### Adding to OBS
After publishing, paste the widget link into the [remote control panel](https://ru.widgets.wotstat.info/remote-control), generate an access key, and add the widget to `OBS Studio` as a `Browser Source`, specifying the generated link.
> Don’t forget to choose `Blending Method` → `SRGB off`. You can study this in more detail in the [guide](https://docs.wotstat.info/guide/widgets/stream/index.md#widget-adding).
## Source code
All widget source code is available in the repository on [GitHub](https://github.com/SoprachevAK/mt-pm3-progress-widget). The result is published on GitHub Pages at: [soprachevak.github.io/mt-pm3-progress-widget](https://soprachevak.github.io/mt-pm3-progress-widget/) and in the control panel at [ru.widgets.wotstat.info/remote-control](https://ru.widgets.wotstat.info/remote-control?widget-url=aHR0cHM6Ly9zb3ByYWNoZXZhay5naXRodWIuaW8vbXQtcG0zLXByb2dyZXNzLXdpZGdldC8/cmVtb3RlLWtleT1oNXpvOVhFZ0NT)
---
# How to Work with Dependency Injections
> Canonical URL: https://docs.wotstat.info/en/articles/how-to-work-with-di/
> Markdown URL: https://docs.wotstat.info/en/articles/how-to-work-with-di/index.md
> Source: https://github.com/wotstat/mods-development-docs/blob/main/docs/en/articles/how-to-work-with-di/index.md
Dependency Injection (DI) is a design pattern that simplifies how components manage their dependencies.
Often we have service classes needed across many places. The simplest approach is to create a global instance accessible everywhere.
For example the game uses a global like `g_eventBus`:
```python
from gui.shared import g_eventBus
```
But this approach has drawbacks: tight coupling, harder testing, and lifecycle management issues.
DI helps solve these problems.
## Injection
To obtain a class instance the game uses the `helpers.dependency` module. Classes available via DI are defined by their interfaces, making it easy to swap implementations without changing consumer code.
One common interface is `IItemsCache`, providing access to player data, vehicles, crew, etc.
Ways to obtain an implementation:
- `@dependency.replace_none_kwargs` – replaces function kwargs
- `dependency.instance` – get an instance immediately
- `dependency.descriptor` – declare dependency as a class descriptor
If you have VSCode hints configured you should add type annotations so the editor knows the type (in this project via `# type:
` comments).
### @dependency.replace_none_kwargs
Automatically injects dependencies into function/method parameters if they weren’t passed explicitly.
```python
from helpers import dependency
from skeletons.gui.shared import IItemsCache
@dependency.replace_none_kwargs(itemsCache=IItemsCache)
def demo(foo, bar, itemsCache=None):
# type: (str, str, IItemsCache) -> None
print(itemsCache)
demo('foo', 'bar') # itemsCache will be injected automatically
```
### dependency.instance
Get an instance immediately.
```python
from helpers import dependency
from skeletons.gui.shared import IItemsCache
itemsCache = dependency.instance(IItemsCache) # type: IItemsCache
print(itemsCache)
```
### dependency.descriptor
Declare a dependency as a class descriptor. It will be injected when an instance is created.
```python
from helpers import dependency
from skeletons.gui.shared import IItemsCache
class Demo:
itemsCache = dependency.descriptor(IItemsCache) # type: IItemsCache
def showItemsCache(self):
print(self.itemsCache)
demo = Demo()
```
## Useful Interfaces
Some useful interfaces for mod development:
> **TIP — TODO**
Expand with details.
### `IItemsCache`
Access to player stats, vehicles, crew, badges, achievements, etc.
```python
from helpers import dependency
from skeletons.gui.shared import IItemsCache
itemsCache = dependency.instance(IItemsCache) # type: IItemsCache
print(itemsCache.items.stats) # Player statistics
print(itemsCache.items.getVehicles()) # Player vehicles
```
### `IHangarSpace`
Access to hangar space; subscribe to creation and destruction events.
```python
from helpers import dependency
from skeletons.gui.shared.utils import IHangarSpace
hangarSpace = dependency.instance(IHangarSpace) # type: IHangarSpace
hangarSpace.onSpaceCreate += lambda: print("Hangar created")
hangarSpace.onSpaceDestroy += lambda: print("Hangar destroyed")
hangarSpace.onVehicleChanged += lambda: print("Hangar vehicle changed")
```
### `IBattleSessionProvider`
Access to battle data; subscribe to start/stop events.
```python
from helpers import dependency
from skeletons.gui.battle_session import IBattleSessionProvider
sessionProvider = dependency.instance(IBattleSessionProvider) # type: IBattleSessionProvider
sessionProvider.onBattleSessionStart += lambda: print("Battle started")
sessionProvider.onBattleSessionStop += lambda: print("Battle finished")
print(sessionProvider.isReplayPlaying) # Check if a replay is currently playing
```
### `IEventsCache`
Access to events like clans, ranked battles.
```python
from helpers import dependency
from gui.server_events import IEventsCache
eventsCache = dependency.instance(IEventsCache) # type: IEventsCache
print(eventsCache.getAllQuests()) # All quests
print(eventsCache.getPersonalMissions()) # Personal missions
```
### `ILobbyContext`
???
```python
from helpers import dependency
from skeletons.gui.lobby_context import ILobbyContext
lobbyContext = dependency.instance(ILobbyContext) # type: ILobbyContext
```
---
# Multilaunch
> Canonical URL: https://docs.wotstat.info/en/articles/multilaunch/
> Markdown URL: https://docs.wotstat.info/en/articles/multilaunch/index.md
> Source: https://github.com/wotstat/mods-development-docs/blob/main/docs/en/articles/multilaunch/index.md
> **DANGER — Warning!**
Running multiple clients may be treated as a forbidden modification. Use it **ONLY** for mod testing in training rooms or on test servers.
When developing battle mods you have to test them somewhere. Options:
- "Topography" mode (WG only): enter a battle with bots that stay still and shoot when they have direct vision.
- "Proving Ground" mode: real battles with players versus bots. Bots are AI controlled; results don’t count toward overall account statistics and allies won’t mind if you don’t actively participate.
- Training Rooms: requires multiple accounts, hence multilaunch.
## WGC Multilaunch
Easiest method: use `wgc.multilaunch`, which resets the launcher state after a client starts.
1. Download the latest `wgc_multilaunch.exe` from the [official repository](https://gitlab.com/openwg/wgc.multilaunch/-/releases).
2. Launch the game client any way (launcher, PjOrion, etc.).
3. Wait until you enter the hangar.
4. Run `wgc_multilaunch.exe` – it resets the launcher state and immediately exits (no window).
5. Launch the client again any way.
6. Repeat steps 4–5 for as many copies as you need.
## Windows Sandbox
You can also use the built-in Windows Sandbox component.
1. Open Start menu and type "Turn Windows features on or off".
2. In the list check "Windows Sandbox".
3. Click OK and wait for installation (a reboot may be required).
Now you can run the game inside the sandbox:
> **TIP — TODO**
If you know a good sandbox workflow (ideally connecting to PjOrion) please document it and send a PR. Screenshots welcome.
---
# Retrieving Average Damage Statistics for Vehicles from the Client
> Canonical URL: https://docs.wotstat.info/en/articles/vehicle-moe/
> Markdown URL: https://docs.wotstat.info/en/articles/vehicle-moe/index.md
> Source: https://github.com/wotstat/mods-development-docs/blob/main/docs/en/articles/vehicle-moe/index.md
Below is an example of how to request from the server the distribution of average damage for a vehicle from the game client.
> **TIP — Lesta Only**
This article is relevant only for Lesta-developed versions of World of Tanks (e.g., RU, CIS, EU servers).
## Concept Overview
To send requests to the server, the `doCmd()` family of methods is used.
In our case — the method `doCmdInt()` (it takes one integer argument).
The family of methods includes:
- `doCmdStr()` — takes a string argument;
- `doCmdInt2()` — takes two integer arguments;
- and so on.
On the client side, these methods are implemented in the `PlayerAccount` class — the entity representing the player’s account (there are also `PlayerLogin`, `PlayerAvatar`).
The specific entity returned depends on the context from which `BigWorld.player()` is called.
To get the player’s account entity, `BigWorld.player()` must be called while in the lobby (garage).
## Example Request Code
```python
import BigWorld
from gui.shared.personality import ServicesLocator
from skeletons.gui.app_loader import GuiGlobalSpaceID
# Command name for retrieving vehicle damage statistics
from AccountCommands import CMD_GET_VEHICLE_DAMAGE_DISTRIBUTION
# Identifier (integer compact descriptor) for IS-7
intCompactDescr = 7169
def callback(requestID, responseID, errorStr, ext=None):
print('response is {}'.format(ext))
def onGUISpaceEntered(spaceID):
if spaceID == GuiGlobalSpaceID.LOBBY:
playerAccount = BigWorld.player()
playerAccount._doCmdInt(
CMD_GET_VEHICLE_DAMAGE_DISTRIBUTION,
intCompactDescr,
callback
)
ServicesLocator.appLoader.onGUISpaceEntered += onGUISpaceEntered
```
## Helper Methods in `PlayerAccount`
```python
class PlayerAccount(...):
...
# Calls self.base.doCmdStr.
# Callback is called upon response: callback(requestID, resultID).
def _doCmdStr(self, cmd, s, callback):
return self.__doCmd('doCmdStr', cmd, callback, s)
# Calls self.base.doCmdIntStr.
# Callback is called upon response: callback(requestID, resultID).
def _doCmdIntStr(self, cmd, int1, s, callback):
return self.__doCmd('doCmdIntStr', cmd, callback, int1, s)
# Calls self.base.doCmdInt.
# Callback is called upon response: callback(requestID, resultID).
def _doCmdInt(self, cmd, int_, callback):
return self.__doCmd('doCmdInt', cmd, callback, int_)
# Calls self.base.doCmdInt2.
# Callback is called upon response: callback(requestID, resultID).
def _doCmdInt2(self, cmd, int1, int2, callback):
return self.__doCmd('doCmdInt2', cmd, callback, int1, int2)
...
```
All of these methods call the private method `__doCmd()`, which receives the name of the server method, the command code, the necessary arguments, and a `callback` for the server response.
Thus, in addition to the argument matching the `doCmd()` command type, when invoked through `PlayerAccount`, the method must take:
- the command ID (in our case `AccountCommands.CMD_GET_VEHICLE_DAMAGE_DISTRIBUTION`);
- the command argument;
- the callback function.
## Response Format
In the case of a **successful** response from the server, the callback receives four arguments:
- `requestID` — the request ID;
- `resultID` — the response status code;
- `errorStr` — error message (empty string `''` on success);
- `ext` *(extended information)* — unpacked response from the server.
In the case of a **failed** response, only 3 arguments are passed (without `ext`).
> Limitation: no more than **1 request per second**.
> If the limit is exceeded, the server will return `resultID = -5` and `errorStr = "COOLDOWN"`.
## Example of a Successful Response
For IS-7 (`intCompactDescr = 7169`), the structure of the response (`ext`) looks like this:
```python
{
'battleCount': 1299652,
'maxDamage': 4974,
'distForMarkOnGun': (2429, 3472, 4304),
'fullDamageDist': [
((0, 20), (0, 613)),
((20, 40), (613, 1498)),
((40, 55), (1498, 2046)),
((55, 65), (2046, 2429)),
((65, 75), (2429, 2891)),
((75, 85), (2891, 3472)),
((85, 95), (3472, 4304)),
((95, 100), (4304, 4974))
],
'damageBetterThanNPercent': (0, 613, 1498, 2046, 2429, 2891, 3472, 4304, 4974)
}
```
### Field Descriptions
- `maxDamage` — the maximum average damage for the vehicle, corresponding to 100%.
- `distForMarkOnGun` — average damage values required for gun marks: 1st (65%), 2nd (85%), 3rd (95%).
- `fullDamageDist` — a list of tuples; each corresponds to an average damage range.
Example: `((20, 40), (613, 1498))`, where:
- the first nested tuple represents percentiles (20% and 40%),
- the second represents average damage values for those percentiles (613 for 20% and 1498 for 40%).
---
# How Crosshairs Work
> Canonical URL: https://docs.wotstat.info/en/guide/crosshair/how-it-works/
> Markdown URL: https://docs.wotstat.info/en/guide/crosshair/how-it-works/index.md
> Source: https://github.com/wotstat/mods-development-docs/blob/main/docs/en/guide/crosshair/how-it-works/index.md
> **TIP — Help translate**
If you know Russian you can help by translating this article from the Russian version.
[Русская версия этой статьи](https://docs.wotstat.info/guide/crosshair/how-it-works/index.md)
---
# Create Your Modpack
> Canonical URL: https://docs.wotstat.info/en/guide/distribution/create-modpack/
> Markdown URL: https://docs.wotstat.info/en/guide/distribution/create-modpack/index.md
> Source: https://github.com/wotstat/mods-development-docs/blob/main/docs/en/guide/distribution/create-modpack/index.md
> **TIP — Help translate**
If you know Russian you can help by translating this article from the Russian version.
[Русская версия этой статьи](https://docs.wotstat.info/guide/distribution/create-modpack/index.md)
---
# Forum
> Canonical URL: https://docs.wotstat.info/en/guide/distribution/forum/
> Markdown URL: https://docs.wotstat.info/en/guide/distribution/forum/index.md
> Source: https://github.com/wotstat/mods-development-docs/blob/main/docs/en/guide/distribution/forum/index.md
> **TIP — Help translate**
If you know Russian you can help by translating this article from the Russian version.
[Русская версия этой статьи](https://docs.wotstat.info/guide/distribution/forum/index.md)
---
# Modpacks
> Canonical URL: https://docs.wotstat.info/en/guide/distribution/modpacks/
> Markdown URL: https://docs.wotstat.info/en/guide/distribution/modpacks/index.md
> Source: https://github.com/wotstat/mods-development-docs/blob/main/docs/en/guide/distribution/modpacks/index.md
> **TIP — Help translate**
If you know Russian you can help by translating this article from the Russian version.
[Русская версия этой статьи](https://docs.wotstat.info/guide/distribution/modpacks/index.md)
---
# Automation
> Canonical URL: https://docs.wotstat.info/en/guide/first-steps/automatization/
> Markdown URL: https://docs.wotstat.info/en/guide/first-steps/automatization/index.md
> Source: https://github.com/wotstat/mods-development-docs/blob/main/docs/en/guide/first-steps/automatization/index.md
> **TIP — Help translate**
If you know Russian you can help by translating this article from the Russian version.
[Русская версия этой статьи](https://docs.wotstat.info/guide/first-steps/automatization/index.md)
---
# AS3 with Animate
> Canonical URL: https://docs.wotstat.info/en/guide/first-steps/devtools/
> Markdown URL: https://docs.wotstat.info/en/guide/first-steps/devtools/index.md
> Source: https://github.com/wotstat/mods-development-docs/blob/main/docs/en/guide/first-steps/devtools/index.md
> **TIP — Help translate**
If you know Russian you can help by translating this article from the Russian version.
[Русская версия этой статьи](https://docs.wotstat.info/guide/first-steps/devtools/index.md)
---
# AS3 with Animate
> Canonical URL: https://docs.wotstat.info/en/guide/first-steps/environment/animate/
> Markdown URL: https://docs.wotstat.info/en/guide/first-steps/environment/animate/index.md
> Source: https://github.com/wotstat/mods-development-docs/blob/main/docs/en/guide/first-steps/environment/animate/index.md
> **TIP — Help translate**
If you know Russian you can help by translating this article from the Russian version.
[Русская версия этой статьи](https://docs.wotstat.info/guide/first-steps/environment/animate/index.md)
---
# AS3 Environment
> Canonical URL: https://docs.wotstat.info/en/guide/first-steps/environment/as3/
> Markdown URL: https://docs.wotstat.info/en/guide/first-steps/environment/as3/index.md
> Source: https://github.com/wotstat/mods-development-docs/blob/main/docs/en/guide/first-steps/environment/as3/index.md
> **TIP — Help translate**
If you know Russian you can help by translating this article from the Russian version.
[Русская версия этой статьи](https://docs.wotstat.info/guide/first-steps/environment/as3/index.md)
---
# Python: How It Works
> Canonical URL: https://docs.wotstat.info/en/guide/first-steps/environment/python/how-it-works
> Markdown URL: https://docs.wotstat.info/en/guide/first-steps/environment/python/how-it-works.md
> Source: https://github.com/wotstat/mods-development-docs/blob/main/docs/en/guide/first-steps/environment/python/how-it-works.md
> **TIP — Help translate**
If you know Russian you can help by translating this article from the Russian version.
[Русская версия этой статьи](https://docs.wotstat.info/guide/first-steps/environment/python/how-it-works.md)
---
# Python Environment
> Canonical URL: https://docs.wotstat.info/en/guide/first-steps/environment/python/
> Markdown URL: https://docs.wotstat.info/en/guide/first-steps/environment/python/index.md
> Source: https://github.com/wotstat/mods-development-docs/blob/main/docs/en/guide/first-steps/environment/python/index.md
> **TIP — Help translate**
If you know Russian you can help by translating this article from the Russian version.
[Русская версия этой статьи](https://docs.wotstat.info/guide/first-steps/environment/python/index.md)
---
# First Mod
> Canonical URL: https://docs.wotstat.info/en/guide/first-steps/first-mod/
> Markdown URL: https://docs.wotstat.info/en/guide/first-steps/first-mod/index.md
> Source: https://github.com/wotstat/mods-development-docs/blob/main/docs/en/guide/first-steps/first-mod/index.md
> **TIP — Help translate**
If you know Russian you can help by translating this article from the Russian version.
[Русская версия этой статьи](https://docs.wotstat.info/guide/first-steps/first-mod/index.md)
---
# First UI Mod
> Canonical URL: https://docs.wotstat.info/en/guide/first-steps/first-ui-mod/
> Markdown URL: https://docs.wotstat.info/en/guide/first-steps/first-ui-mod/index.md
> Source: https://github.com/wotstat/mods-development-docs/blob/main/docs/en/guide/first-steps/first-ui-mod/index.md
> **TIP — Help translate**
If you know Russian you can help by translating this article from the Russian version.
[Русская версия этой статьи](https://docs.wotstat.info/guide/first-steps/first-ui-mod/index.md)
---
# Introduction
> Canonical URL: https://docs.wotstat.info/en/guide/first-steps/introduction/
> Markdown URL: https://docs.wotstat.info/en/guide/first-steps/introduction/index.md
> Source: https://github.com/wotstat/mods-development-docs/blob/main/docs/en/guide/first-steps/introduction/index.md
> **TIP — Help translate**
If you know Russian you can help by translating this article from the Russian version.
[Русская версия этой статьи](https://docs.wotstat.info/guide/first-steps/introduction/index.md)
---
# PjOrion Setup
> Canonical URL: https://docs.wotstat.info/en/guide/first-steps/pjorion/
> Markdown URL: https://docs.wotstat.info/en/guide/first-steps/pjorion/index.md
> Source: https://github.com/wotstat/mods-development-docs/blob/main/docs/en/guide/first-steps/pjorion/index.md
> **TIP — Help translate**
If you know Russian you can help by translating this article from the Russian version.
[Русская версия этой статьи](https://docs.wotstat.info/guide/first-steps/pjorion/index.md)
---
# Style Aggregator – Custom Style Integration
> Canonical URL: https://docs.wotstat.info/en/guide/integrations/user-customization/
> Markdown URL: https://docs.wotstat.info/en/guide/integrations/user-customization/index.md
> Source: https://github.com/wotstat/mods-development-docs/blob/main/docs/en/guide/integrations/user-customization/index.md
> **TIP — Help translate**
If you know Russian you can help by translating this article from the Russian version.
[Русская версия этой статьи](https://docs.wotstat.info/guide/integrations/user-customization/index.md)
---
# Data Provider
> Canonical URL: https://docs.wotstat.info/en/guide/integrations/wotstat-widgets/data-provider/
> Markdown URL: https://docs.wotstat.info/en/guide/integrations/wotstat-widgets/data-provider/index.md
> Source: https://github.com/wotstat/mods-development-docs/blob/main/docs/en/guide/integrations/wotstat-widgets/data-provider/index.md
# Data Provider
---
# Introduction
> Canonical URL: https://docs.wotstat.info/en/guide/integrations/wotstat-widgets/introduction/
> Markdown URL: https://docs.wotstat.info/en/guide/integrations/wotstat-widgets/introduction/index.md
> Source: https://github.com/wotstat/mods-development-docs/blob/main/docs/en/guide/integrations/wotstat-widgets/introduction/index.md
# Introduction
---
# Remote Control
> Canonical URL: https://docs.wotstat.info/en/guide/integrations/wotstat-widgets/remote-control/
> Markdown URL: https://docs.wotstat.info/en/guide/integrations/wotstat-widgets/remote-control/index.md
> Source: https://github.com/wotstat/mods-development-docs/blob/main/docs/en/guide/integrations/wotstat-widgets/remote-control/index.md
# Remote Control
---
# Blender
> Canonical URL: https://docs.wotstat.info/en/guide/modelling/blender/
> Markdown URL: https://docs.wotstat.info/en/guide/modelling/blender/index.md
> Source: https://github.com/wotstat/mods-development-docs/blob/main/docs/en/guide/modelling/blender/index.md
> **TIP — Help translate**
If you know Russian you can help by translating this article from the Russian version.
[Русская версия этой статьи](https://docs.wotstat.info/guide/modelling/blender/index.md)
---
# Introduction
> Canonical URL: https://docs.wotstat.info/en/guide/modelling/introduction/
> Markdown URL: https://docs.wotstat.info/en/guide/modelling/introduction/index.md
> Source: https://github.com/wotstat/mods-development-docs/blob/main/docs/en/guide/modelling/introduction/index.md
> **TIP — Help translate**
If you know Russian you can help by translating this article from the Russian version.
[Русская версия этой статьи](https://docs.wotstat.info/guide/modelling/introduction/index.md)
---
# Unified Editor First Steps
> Canonical URL: https://docs.wotstat.info/en/guide/modelling/unified-editor/first-steps/
> Markdown URL: https://docs.wotstat.info/en/guide/modelling/unified-editor/first-steps/index.md
> Source: https://github.com/wotstat/mods-development-docs/blob/main/docs/en/guide/modelling/unified-editor/first-steps/index.md
> **TIP — Help translate**
If you know Russian you can help by translating this article from the Russian version.
[Русская версия этой статьи](https://docs.wotstat.info/guide/modelling/unified-editor/first-steps/index.md)
---
# Unified Editor Interface
> Canonical URL: https://docs.wotstat.info/en/guide/modelling/unified-editor/interface/
> Markdown URL: https://docs.wotstat.info/en/guide/modelling/unified-editor/interface/index.md
> Source: https://github.com/wotstat/mods-development-docs/blob/main/docs/en/guide/modelling/unified-editor/interface/index.md
> **TIP — Help translate**
If you know Russian you can help by translating this article from the Russian version.
[Русская версия этой статьи](https://docs.wotstat.info/guide/modelling/unified-editor/interface/index.md)
---
# Editing Documentation
> Canonical URL: https://docs.wotstat.info/en/guide/other/edit-docs/
> Markdown URL: https://docs.wotstat.info/en/guide/other/edit-docs/index.md
> Source: https://github.com/wotstat/mods-development-docs/blob/main/docs/en/guide/other/edit-docs/index.md
> **TIP — Help translate**
If you know Russian you can help by translating this article from the Russian version.
[Русская версия этой статьи](https://docs.wotstat.info/guide/other/edit-docs/index.md)
---
# FFDec – Free Flash Decompiler
> Canonical URL: https://docs.wotstat.info/en/guide/programs/ffdec/
> Markdown URL: https://docs.wotstat.info/en/guide/programs/ffdec/index.md
> Source: https://github.com/wotstat/mods-development-docs/blob/main/docs/en/guide/programs/ffdec/index.md
# FFDec – Free Flash Decompiler
---
# AS3 Theory
> Canonical URL: https://docs.wotstat.info/en/guide/scripting/as3-theory/
> Markdown URL: https://docs.wotstat.info/en/guide/scripting/as3-theory/index.md
> Source: https://github.com/wotstat/mods-development-docs/blob/main/docs/en/guide/scripting/as3-theory/index.md
> **TIP — Help translate**
If you know Russian you can help by translating this article from the Russian version.
[Русская версия этой статьи](https://docs.wotstat.info/guide/scripting/as3-theory/index.md)
---
# Source Code
> Canonical URL: https://docs.wotstat.info/en/guide/scripting/sources/
> Markdown URL: https://docs.wotstat.info/en/guide/scripting/sources/index.md
> Source: https://github.com/wotstat/mods-development-docs/blob/main/docs/en/guide/scripting/sources/index.md
> **TIP — Help translate**
If you know Russian you can help by translating this article from the Russian version.
[Русская версия этой статьи](https://docs.wotstat.info/guide/scripting/sources/index.md)
---
# Stream Widgets
> Canonical URL: https://docs.wotstat.info/en/guide/widgets/stream/
> Markdown URL: https://docs.wotstat.info/en/guide/widgets/stream/index.md
> Source: https://github.com/wotstat/mods-development-docs/blob/main/docs/en/guide/widgets/stream/index.md
> **TIP — Help translate**
If you know Russian you can help by translating this article from the Russian version.
[Русская версия этой статьи](https://docs.wotstat.info/guide/widgets/stream/index.md)
---
# Mod development for World of Tanks
> Canonical URL: https://docs.wotstat.info/en/
> Markdown URL: https://docs.wotstat.info/en/index.md
> Source: https://github.com/wotstat/mods-development-docs/blob/main/docs/en/index.md
## Motivation
> **WARNING — Help translate**
The original language of the documentation is Russian. Most of the documentation has not been translated into English. If you know how to develop modifications, you can translate the articles using AI and review them for accuracy.
World of Tanks is a game that’s very well suited for creating mods. However, the entry barrier is quite high: there’s no official documentation, and community guides are incomplete or outdated.
This site aims to help both newcomers and experienced developers quickly set up everything needed for mod creation and find answers to common questions.
In the First Steps section you will set up your environment (syntax highlighting, code completion, automatic compilation) and then step‑by‑step build two popular mods: a fast equipment demount helper and an armor penetration calculator.