Map Source Generator for RWG / Sudden strike

Forum zum Thema Modding, um dort über "Neue Einheiten", Neue Objekte", "Modding Tools" usw zu diskutieren.
Antworten
Separator
Newbie
Beiträge: 1
Registriert: 01.10.2018, 18:09

Map Source Generator for RWG / Sudden strike

Beitrag von Separator » 30.11.2018, 09:25

Perhaps this will be useful.
Map Source Generator for RWG / Sudden strike
https://github.com/Separator/rwg-map


Benutzeravatar
Stahlin
Fahnenjunker
Fahnenjunker
Beiträge: 223
Registriert: 03.01.2009, 12:04

Re: Map Source Generator for RWG / Sudden strike

Beitrag von Stahlin » 30.11.2018, 09:44

Here is a translation of the russian readme.md into english.

Code: Alles auswählen

# The source code generator of the sudden-strike / rwg from the json-file

The library allows you to generate the source of maps of the sudden-strike / rwg,
using as a source the json file of the structure described below.
In the future, this will make it possible to write automatic card generators for
sudden-strike / rwg.

## Dependencies and installation
Before installing the utility, make sure Node.js is installed on the system.
To do this, start the console and enter the command
`` `
node -v
`` `
If you receive an error message, go to [Node.js] (https://nodejs.org/en/download/)
in the `downloads` section and perform the installation.
Next, run the utility installation command:
`` `
npm i https://github.com/Separator/rwg-map.git -g
`` `
If everything went well, run the command:
`` `
rwg -v
`` `
You should return the current version of the utility.

## Use
The utility accepts the following parameters:
* ** - action ** action (generate);
* ** - destination ** The path to the folder to save the result of the work;
* ** - source ** Path to the json file of the data source (mandatory);
* ** - v ** or ** - version ** Displays the current version of the utility.

Example:
`` `
rwg -source = my-map.json -destination = C: \ Games \ RWG3.45 \ Editor \ Maps.src \ map.000
`` `

## json file format
The json file consists of the following sections:
* ** airFields ** Aerodromes (optional);
* ** cells ** Map cells (optional);
* ** embeddings ** Inserts (optional);
* ** flags ** Flags (optional);
* ** meta ** Map information;
* ** objects ** Objects (optional).

#### ** airFields ** Aerodromes
It is an array of a maximum of 16 elements.
Each array element consists of the following fields:
* ** takeoffPoint ** Point of take-off;
* ** landingPoint ** Landing point;
* ** hangarPoints ** Hangar points (an array of points of a maximum of 16 elements).
Each point object consists of the following fields:
  * ** x ** X coordinate horizontally (0-511);
  * ** y ** Y-coordinate vertically (0-511);
  * ** direction ** Direction (`" east "," south "," west "," north "`).

#### ** cells ** map cells
It is an array of a maximum of 512 by 512 elements.
Each array element consists of the following fields:
* ** x ** X coordinate horizontally (0-511);
* ** y ** Y-coordinate vertically (0-511);
* ** terrain ** Soil type (`" grass "," arable "," asphalt "," soil "," drySoil "," water "," sand "`);
* ** pieces ** Soil distribution per cell. It is an array of 4 elements of the form:
`` json
[TOP_LEFT, TOP_RIGHT, BOTTOM_LEFT, BOTTOM_RIGHT]
`` `
Each of the elements of the array can be a number from 0 to 1:
  * ** 0 ** Soil not established;
  * ** 1 ** The soil is set.
Example:
`` json
[1, 1, 1, 1]
`` `
In this case, the entire cell will be filled with soil of the specified type.
* ** brightness ** Brightness (a number from 0x00 to 0x1f0 in increments of 0x10).
The default value is 0x100.

#### ** embeddings ** Inserts
Used to embed templates in the map over the main content.
Each array element consists of the following fields:
* ** x ** X coordinate horizontally (0-511);
* ** y ** Y-coordinate vertically (0-511);
* ** path ** The path to the map file (the same format as in the specified document).
Template example:
`` json
{
  "x": 100,
  "y": 150,
  "path": "soviet-city.json"
}
`` `

#### ** flags ** Flags
It is an array of a maximum of 512 by 512 elements.
Each array element consists of the following fields:
* ** x ** X coordinate horizontally (0-511);
* ** y ** Y-coordinate vertically (0-511);
* ** airFieldTerritory ** Aerodrome territory;
* ** withoutPontoons ** Without pontoons (`true` or` false`);
* ** withoutWaves ** No Waves (`true` or` false`);
* ** visibilityUp ** Increased visibility (`true` or` false`, or 0 or 1);
* ** visibilityDown ** Reduced visibility (`true` or` false`, either 0 or 1);
* ** obstruction ** Obstruction.
It is an array of 4 elements of the form:
`` json
[TOP_LEFT, TOP_RIGHT, BOTTOM_LEFT, BOTTOM_RIGHT]
`` `
Each of the elements of the array can be a number from 0 to 1:
  * ** 0 ** Passable;
  * ** 1 ** Impassable.
Example:
`` json
[1, 1, 1, 1]
`` `
In this case, the entire cell will be completely impassable.
* ** completeObstruction ** Complete obstruction (`true` or` false`, or 0 or 1);
* ** shallows ** shallows.
It is an array of 4 elements of the form:
`` json
[TOP_LEFT, TOP_RIGHT, BOTTOM_LEFT, BOTTOM_RIGHT]
`` `
Each of the elements of the array can be a number from 0 to 1:
  * ** 0 ** Lack of shallows;
  * ** 1 ** Presence of shallows.
Example:
`` json
[1, 0, 1, 0]
`` `
In this case, the left half of the cell will be passable even when filled with water.

#### ** meta ** Map Information
It is an object with the following properties:
* ** author ** Author (String from 1 to 255 characters);
* ** name ** Card name (String from 1 to 255 characters);
* ** scheme ** Scheme (`" summer "," winter "," jungle "," desert "`).
Currently, only the `" summer "` scheme is supported;
* ** size ** Size (`128, 256, 384, 512`);
* ** version ** Version (`major.minor.patch`).

#### ** objects ** Objects
It is an object with the following properties:
* ** free ** Array of free objects;
* ** horizontal ** Array of horizontal objects;
* ** vertical ** Array of vertical objects;
* ** trees ** An array of trees;
* ** roads ** An array of road segments;
* ** buildings ** Array of buildings;
* ** fences ** Array of fences;
* ** cliff ** Array of cliffs;
* ** crates ** Array of funnels;
* ** bridges ** Bridges.
Each property is an array of objects.
The sum of the lengths of all arrays cannot exceed 50,000.
The length of the array ** buildings ** can not exceed 800 elements.
The length of the array ** bridges ** can not exceed 32 elements.
Each array element has the following properties:
  * ** x ** X-coordinate in pixels horizontally (0-511 * 32);
  * ** y ** Y-coordinate in pixels vertically (0-511 * 32);
  * ** damage ** The state of the object (number from 0 to 3);
  * ** id ** id-object (Number).

32 - cell width in pixels.

Benutzeravatar
Ingwio
*S-S-M* - Chef
*S-S-M* - Chef
Beiträge: 1864
Registriert: 26.07.2002, 01:19
Wohnort: Rheine
Kontaktdaten:

Re: Map Source Generator for RWG / Sudden strike

Beitrag von Ingwio » 01.12.2018, 17:17

Habe das Thema mal in den Bereich Modding verschoben.
Geschichte ist die Lüge, auf die man sich geeinigt hat.

Webmaster von:
Bild
Bild


Antworten

Zurück zu „Alles zum Thema Modding“