GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - gucio321/d2d2s: Diablo II save files (.d2s) editor written in golang.

BranchesTags
Open more actions menu

Latest commit

 

History

594 Commits
594 Commits

Folders and files

NameName
Last commit message
Last commit date
.circleci
.circleci
 
 
.github
.github
 
 
cmd/editor
cmd/editor
 
 
docs
docs
 
 
examples
examples
 
 
internal
internal
 
 
pkg
pkg
 
 
.gitignore
.gitignore
 
 
.golangci.yml
.golangci.yml
 
 
CODE_OF_CONDUCT.md
CODE_OF_CONDUCT.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
go.mod
go.mod
 
 
go.sum
go.sum
 
 

Repository files navigation

CircleCI Go Report Card GoDoc codecov

Description

This package contains a Diablo II save files (D2S) decoder and encoder written in golang

Dependencies / Documentation

D2S structure documentation:

  • krisives/d2s-format
  • Diablo II Saved Game File Format
  • nokka/d2s (see details)
  • pairofdocs/d2s_edit_recalc

I depend on

This project uses Data stream writer based on these used in OpenDiablo2 project for more informations, see here

Status

for now (May 2021) the project is early in development. However, it is possible to:

  • decode character save file into a (in a greater part) human-readable structure
  • encoding file

Example

for some reasons, this project isn't able to create a whole new file yet, but it is able to load modify and than encode D2S format

simple example
package main

import (
        "fmt"
        "ioutil"
        "log"

        "github.com/gucio321/d2d2s/pkg/d2s"
)

func main() {
        data, err := ioutil.ReadFile("/path/to/file.d2s")
        if err != nil {
                log.Fatal(err)
        }

        character, err := d2s.Unmarshal(data)
        if err != nil {
                log.Fatal(err)
        }

        // some edits

        newData, err := d2d2s.Encode(character)
        if err != nil {
                log.fatal(err)
        }

        if err := ioutil.WriteFile("/path/to/new/file.d2s", newData, 0o600); err != nil {
                log.Fatal("error writing file")
        }
}

for more examples, see here

Goals of the project

this programm should be able to decode, encode and create a new D2S files

Legal Notes

Diablo 2 and its content is ©2000 Blizzard Entertainment, Inc. All rights reserved. Diablo and Blizzard Entertainment are trademarks or registered trademarks of Blizzard Entertainment, Inc. in the U.S. and/or other countries.

This package is ABSOLUTLY NO WARRITY! The code developers aren't responsible for any damage caused by this software or illegal uses of it!

Custom D2S Files

Sometimes, you may want to parse some custom d2s files. For example these created by certain d2 mods. They are not supported by default, however you can do some configuration to support them.

NOTE: add this code in your custom implementation of package or modify cmd/editor

NOTE: in case of any problems/errors please fill an issue in this repo!

  • MedianXL
        myD2S := d2s.New()
        m := map[d2sstats.StatID]int{
                d2sstats.Strength:       11,
                d2sstats.Energy:         11,
                d2sstats.Dexterity:      11,
                d2sstats.Vitality:       11,
                d2sstats.UnusedStats:    11,
                d2sstats.UnusedSkills:   8,
                d2sstats.CurrentHP:      21,
                d2sstats.MaxHP:          21,
                d2sstats.CurrentMana:    21,
                d2sstats.MaxMana:        21,
                d2sstats.CurrentStamina: 21,
                d2sstats.MaxStamina:     21,
                d2sstats.Level:          8,
                d2sstats.Experience:     32,
                d2sstats.Gold:           22,
                d2sstats.StashedGold:    25,
                88:                      48,
        }

        myD2S.Stats.UserStatMap(m)
        myD2S.Skills.SetSkillsCount(95)
        myD2S.Items.IgnoreErrors()

About

Diablo II save files (.d2s) editor written in golang.

Topics

d2sd2s-formatdecoderdiablo-iiencodergogolang

Resources

Readme
GPL-3.0 license

Code of conduct

Code of conduct
Activity

Stars

6 stars

Watchers

1 watching

Forks

1 fork
Report repository

Releases

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.