mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-23 22:37:55 +02:00
Add basic description of battlefield layout
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
# Battle Obstacle Format
|
||||
|
||||
## Configuration reference
|
||||
|
||||
```json
|
||||
// List of terrains on which this obstacle can be used
|
||||
"allowedTerrains" : []
|
||||
@@ -16,7 +18,7 @@
|
||||
// Height of an obstacle, in hexes
|
||||
"height" : 1
|
||||
|
||||
// List of tiles blocked by an obstacles. For non-absolute obstacles uses relative hex indices
|
||||
// List of tiles blocked by an obstacles. See below for description
|
||||
"blockedTiles" : [ 0, 20, 50 ]
|
||||
|
||||
// For absolute obstacle - image with static obstacle. For non-absolute - animation with an obstacle
|
||||
@@ -25,3 +27,21 @@
|
||||
// If set to true, obstacle will appear in front of units or other battlefield objects
|
||||
"foreground" : false
|
||||
```
|
||||
|
||||
## Blocked tiles definition
|
||||
|
||||
How blocked tiles are defined depends on whether obstacle is `absolute` or not:
|
||||
|
||||
### Non-absolute obstacles
|
||||
|
||||
Non-absolute obstacles specify their coordinates relative to bottom-left corner of obstacle. If you wish to have obstacle that takes multiple rows, substracting 17 from hex number would block tile directly above bottom-left corner of your obstacle.
|
||||
|
||||
For example, obstacle that blocks tiles `[1, 2, 3, -15, -16, -31]` would result in following layout on the battlefield:
|
||||
|
||||

|
||||
|
||||
### Absolute obstacles
|
||||
|
||||
Absolute obstacles operate in absolute coordinates. Because of that, blocked tiles contains list of indexes of blocked tiles. For reference on tiles indexes see image below:
|
||||
|
||||

|
||||
|
||||
@@ -23,3 +23,10 @@
|
||||
// List of battle hexes that will be always blocked on this battlefield (e.g. ship to ship battles)
|
||||
"impassableHexes" : [ 10, 20, 50 ],
|
||||
```
|
||||
|
||||
### Impassable Hexes
|
||||
|
||||
Impassable hexes operate in absolute coordinates. For reference on tiles indexes see image below:
|
||||
|
||||

|
||||
|
||||
|
||||
Reference in New Issue
Block a user