2021-05-20 23:30:26 +00:00
# skyrim-cell-dump
2021-05-21 02:21:27 +00:00
Library and binary for parsing Skyrim plugin files and extracting CELL data.
2021-05-20 23:30:26 +00:00
The main objective of this library is to extract the form ID and X and Y coordinates of every exterior cell a plugin edits as fast as possible, ignoring the rest of the plugin.
## Install
```
2021-05-21 00:47:50 +00:00
cargo install skyrim-cell-dump
2021-05-20 23:30:26 +00:00
```
Or, build yourself by checking out the repository and running:
```
cargo build --release --features build-binary
```
## Usage
```
Usage: skyrim-cell-dump.exe < plugin > [-f < format > ] [-p]
Extracts cell edits from a TES5 Skyrim plugin file
Options:
-f, --format format of the output (json or text)
-p, --pretty pretty print json output
--help display usage information
```
The pretty JSON format looks something like:
```json
{
"header": {
"version": 1.0,
"num_records_and_groups": 792,
"next_object_id": 221145,
"author": "Critterman",
"description": "An example plugin",
"masters": [
"Skyrim.esm",
"Update.esm",
"Dawnguard.esm",
"HearthFires.esm",
"Dragonborn.esm"
]
},
2021-07-19 04:19:26 +00:00
"worlds": [
{
"form_id": 60,
"editor_id": "Tamriel"
}
],
2021-05-20 23:30:26 +00:00
"cells": [
{
"form_id": 100000001,
"editor_id": "SomeInterior",
"x": null,
"y": null,
2021-07-19 04:19:26 +00:00
"world_form_id": null,
2021-05-20 23:30:26 +00:00
"is_persistent": false
},
{
"form_id": 3444,
"editor_id": null,
"x": 0,
"y": 0,
2021-07-19 04:19:26 +00:00
"world_form_id": 60,
2021-05-20 23:30:26 +00:00
"is_persistent": true
},
{
"form_id": 46432,
"editor_id": "SomeExterior01",
"x": 32,
"y": 3,
2021-07-19 04:19:26 +00:00
"world_form_id": 60,
2021-05-20 23:30:26 +00:00
"is_persistent": false
},
{
"form_id": 46464,
"editor_id": "SomeExterior02",
"x": 33,
"y": 2,
2021-07-19 04:19:26 +00:00
"world_form_id": 60,
2021-05-20 23:30:26 +00:00
"is_persistent": false
},
{
"form_id": 46498,
"editor_id": null,
"x": 32,
"y": 1,
2021-07-19 04:19:26 +00:00
"world_form_id": 60,
2021-05-20 23:30:26 +00:00
"is_persistent": false
}
]
}
```
2021-05-21 00:47:50 +00:00
Note: I have only tested parsing Skyrim Special Edition `.esp` , `.esm` , and `.esl` files.
2021-05-20 23:30:26 +00:00
## Import
You can include this crate in your `Cargo.toml` and get the parsed `Plugin` struct with:
```rust
use skyrim_cell_dump::parse_plugin;
2021-05-21 00:47:50 +00:00
let plugin_contents = std::fs::read("Plugin.esp").unwrap();
let plugin = parse_plugin(&plugin_contents).unwrap();
2021-05-20 23:30:26 +00:00
```