dcss-scenario-builder

Crates.iodcss-scenario-builder
lib.rsdcss-scenario-builder
version0.3.0
created_at2025-03-10 11:25:47.089282+00
updated_at2025-06-20 23:10:15.209679+00
descriptionA scenario builder for DCSS Webtile.
homepage
repositoryhttps://github.com/EricFecteau/dcss-api/
max_upload_size
id1586461
size73,677
(EricFecteau)

documentation

README

dcss-scenario-builder

dcss-scenario-builder creates scenarios in Dungeon Crawl Stone Soup's (DCSS) Webtile using dcss-api in wizmode from a yaml file. It can create any floor layout, from any feature, and add any item or monster.

Example

This example will create a two floor dungeon (D:1 and D:2), with a scroll and sword on the first floor (second room, past the door) and with a Kobold on the second floor.

options:
  default_feature: "floor"

levels:
  - level:
      name: D:1
      features:
        - '< = exit_dungeon'
        - '> = stone_stairs_down_i'
        - '# = rock_wall'
        - '. = floor'
        - '+ = closed_door'
      items:
        - 'x = Scroll of identify'
      map: |-
          #########
          #...#...#
          #.<.#.x.#
          #...#...#
          #.@.+...#
          #...#...#
          #...#.>.#
          #...#...#
          #########

  - level:
      name: D:2
      features:
        - '< = stone_stairs_up_i'
        - '# = rock_wall'
        - '. = floor'
      monsters:
        - 'k = Kobold'
      map: |-
          #########
          #.......#
          #.<.....#
          #.......#
          #.......#
          #.......#
          #.....k.#
          #.......#
          #########

start_game_with_scenario, in combination with the Webtile from dcss-api is used to build the scenario in Rust.

// Connect to DCSS Webtile
let mut webtile = Webtile::connect("ws://localhost:8080/socket", 0, "0.30")?;

// Empty message queue;
while webtile.get_message().is_some() {}

// Log in (to a user called "Username", with a password "Password")
let _gameid = webtile.login_with_credentials("Username", "Password")?;

// Create scenario
start_game_with_scenario(
    &mut webtile,
    "dcss-0.32",
    "b",
    "i",
    "c",
    "./scenarios/docs/readme.yaml",
)?;

// Empty message queue;
while webtile.get_message().is_some() {}

webtile.disconnect().expect("Failed");
Commit count: 156

cargo fmt