Giter Club home page Giter Club logo

d2rmm's People

Contributors

mmena1 avatar olegbl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

d2rmm's Issues

Subsection feature

Hello,

I implemented a pseudo loot filter that allows removing all item bases individually in D2R and organized them by TC as this is how the game does it internally but people and I quickly realised its not that good of a structure. I will reimplement it as:

  • weapons: swords, scepters, etc
  • armors: head, body, etc
    But it would be very helpfull to be able to have subsections for items quality: normal, exceptional and elite items.

Is this something you will consider adding support for in D2RMM ?

PS: as a bonus an enable / disable all toggle for each section / subsection would also be very helpfull.

Thanks,
Alex.

Auto-update not working

I have multiple folders for D2RMM. For both my 1.7.0 folders auto-update doesn't work:

  • it shows the message that an update is available
  • I press update
  • it downloads, extracts and runs
  • a black command window pops up and disappears (one time I saw some red letters for a few ms but can't make a screenshot)
  • no update has been applied

Both of them run as administrator.

Object.keys() doesn't work?

Hey man, love the work with D2RMM. I'm playing around with a mod, trying to refactor some code, and while trying to use Object.keys(...) I get this:

image

Is this a limitation on electron or on the way that the mod code is executed?

*eol column for .txt files does not get pushed

Hey olegbl,

When pushing new entries to .txt files using D2RMM.readTSV() and D2RMM.writeTSV() the value for the *eol column is not pushed. I'm working on itemstatcost.txt and the problem does not occur for the *ID column.

I loaned/edited the below code from here as an example:

mod.json

{
  "name": "Act3 Quest Skip Cube Recipe",
  "description": "Adds additional cube recipe to access Durance of Hate and Quest Skip.",
  "author": "OGGamerDude",
  "website": "https://www.nexusmods.com/diablo2resurrected/mods/449",
  "version": "1.0"
}

mod.js

let FILE_PATH_CUBEMAIN = "global\\excel\\cubemain.txt";
let file = D2RMM.readTsv(FILE_PATH_CUBEMAIN);

file.rows.push({
  description: "Khalim's Flail -> Khalim's Will",
  enabled: 1,
  version: 100,
  numinputs: 1,
  "input 1": "qf1",
  output: "qf2",
  "*eol": 0,
});

D2RMM.writeTsv(FILE_PATH_CUBEMAIN, file);

Do you have any idea why and how to fix this?

(I know this column is not used for gameplay, but I'm currently trying to port an existing mod and I want the result to be identical.)

D2RMM mod.js environment is too restricted (lack of file logging and require/import)

Hi, D2RMM is great for applying existing mod, but I found it not that great to create mod.

  • Lack of file logging. (for efficient debugging)
  • Lack of (maybe optional) access to full node.js runtime, or at least require/import. (for efficient coding/code reuse)

More for logging:
D2RMM write huge log lines without cropping the file contents argument, which could make copy (export) through clipboard very slow.
e.g. 2024-02-06T15:12:56.160Z,debug,BridgeAPI.writeTsv {"filePath":<>, <full tsv contents>

Make global scope available

Hi,

Currently the global scope is not available in mod.js so we can't use Object,keys. I was wondering if there was some way for you to make this scope available, or explain why this is not possible.

I have run into multiple issues where the answer seems to be "use Object.keys", which I eventually have been able to circumvent each time. This time however, I want to extend Array but this leads to circular dependencies issues. I don't really know how the global scope works and how this is related, but I'd like to use the full feature pack of javascript so I can just use the stuff people on Stack Overflow recommend.


Example using extends:

class AwesomeArray extends Array {
  something() {
    this.push("something");
  }
}

Error: [mod] encountered a runtime error! TypeError: Class extends value undefined is not a constructor or null at 1:51


Example using prototype:

Array.prototype.something = function(x) {
  this.push(x);
}

Error: [mod] encountered a runtime error! TypeError: Cannot read properties of undefined (reading 'prototype') at 1:30


I also want to be able to import files/classes so I can split up mod.js into parts. Is that possible?

[TypeScript] how to load D2RMM as a library?

Is there a way to load D2RMM as a library for a TypeScript-style mod and remove all the errors my IDE gives?

Same question for config/mod.json. Would be great if there was some way for the IDE to recognize mod.json as config, if settings exist and if types match.

Bug: readJson() saves the opened file, even when not using writeJson()

let unused = D2RMM.readJson(`hd\\character\\npc\\act2guard2.json`);

let path = `hd\\character\\enemy\\act2hire.json`;
let file = D2RMM.readJson(path);

D2RMM.writeJson(path, file);

Expected behaviour: only act2hire.json is created.
Actual behaviour: both files are created.

let unused = D2RMM.readJson(`hd\\character\\npc\\act2guard2.json`);

let path = `hd\\character\\enemy\\act2hire.json`;
let file = D2RMM.readJson(path);

// D2RMM.writeJson(path, file);

Expected behaviour: no files are created.
Actual behaviour: both files are created.

Feature Request: mod name title in mod settings

When the settings menu for a mod is opened, you currently have no indication which mod's settings menu you are looking at. I think it would be neat if the mod's name could be shown on top as some sort of title to the settings menu.

I'd personally go for either a big [Mod Name]: settings or a big [Mod Name] with Settings on a separate line, but just the mod name would be fine too.

Values in the last column of TSVs have a spurious carriage return

This line: https://github.com/olegbl/d2rmm/blob/master/src/main/preload.js#L193

It splits on \n, but the lines evidently end with \r\n. This leaves a spurious \r character on every value in the last column in every file. This also means keying into the last column doesn't work. E.g. row["*eol"] doesn't work, you have to do row["*eol\r"]. Splitting on \r\n should fix it.

I was going to make/test this change and submit a pull request, but setting up a node.js dev environment on Windows quickly turned into a broken mess that didn't feel worth the time figuring out. So I'm hoping it's something you can throw in.

Thanks! D2RMM is very cool.

Feature Request: regions/tabs in mod settings

Hi, my extended loot filter has grown to have quite the number of settings for users to play with. For readability, I think my users would really like it if the settings could be divided into either regions or tabs.

Tabs would be neat and all, but I think it would be easier and just as effective if we could add a simple entry in mod.json that generates a divider with a title inside of it, e.g.: ----- Section 1 -----.

Let me know what you think.

Please release a quick minor update with updated packages

Hey dude,

I'd like to use structuredClone() to deep copy a JSON file. It is available since "@types/node": "17.0.29", where D2RMM 1.5.0 uses "@types/node": "17.0.5".

Here's the reason why:
I'm trying to change file A to be a (deep) copy of file B, then change some values for file A. Unfortunately if I read 2 files and use the spread operator (...), then use a single D2RMM.writeJson(), both files get copied over in the final result (the original but unchanged and the intended file with the intended changes).

Could you make this possible?

EDIT: it seems my issue is caused by a bug in D2RMM.readJson(). See #19.

d2rmm on linux

hello !

very glad for this mod manager !

is it by any chance possible to run on linux ?

regards,

Michael

Suggestions for some new features

Suggestions for some new features

  1. Automatically save game progress by date to prevent items in the storage box from disappearing after mod conflicts
  2. Add - resetofflinemaps to refresh map parameters
  3. Add - w - window to switch to window mode parameter

Add switch buttons for various parameters, etc

D2RMM can also be an excellent D2R starter

TSV not save the last column

For example glovesHeight is the last column of inventory

const inventoryFilename = 'global\\excel\\inventory.txt';
const inventory = D2RMM.readTsv(inventoryFilename);
inventory.rows.forEach((row) => {
    row.glovesHeight = 53;
});
D2RMM.writeTsv(inventoryFilename, inventory);

Open inventory.txt and see glovesHeight is not change.

[Feature request] let D2RMM.getVersion() also return patch version

This one's more of a could-have. Low priority.

The current functionality only supports major and minor versions, not patch versions, while I would argue patch versions are just as important.

For example:

  • checking if mod is lower than 1.4.6 could throw a warning for section support (since it's not breaking)
  • checking for 1.6.2 (which fixes imports and is breaking) is currently not possible

Possible solutions:

  • change type from number to string
  • change type to number array
  • change type to custom Version class
  • I'm sure you'll come up with something better tho

[TypeScript] loading imports from a subfolder is broken

D2RMM 1.6.1.

Expected behaviour: loading imports uses the current file's path
Actual behaviour: loading imports always looks at the mod folder path, even when the current file that is loading an import is in a subfolder.

Example:
Say I have the following file/folder structure:

/mymod/mod.json
/mymod/mod.ts
/mymod/sub/file1.ts
/mymod/sub/file2.ts
/mymod/sub/file3.ts
  • mod.ts imports only file1.ts
  • file1.ts imports file2.ts and file3.ts

mod.ts:

import { file1 } from "./sub/file1"; // works fine

file1.ts:

import { file2 } from "./sub/file2"; // VSCode says error, D2RMM works
import { file3 } from "./file3";     // VSCode says fine, D2RMM throws error

Error: Mod mymod encountered a compile error! Error: BridgeAPI.readModCode: Failed to read mods\mymod\file3.ts

Mod manager crashes the game

Hello master!
Mod manager crashes the game. In my case it looks like my mercenary dies with 1 hit and when i want to back to town my game crashes. There was no problem till i get merc.

[feature request] Add hook to "Run D2R"

I am experimenting with a grail tracker mod. One way to implement it, would be the read the save files before each launch, and update some GUI accordingly. Currently this is only possible by remembering to also press "Install Mods" before each launch.

Mod setting option for custom color

This issue is a direct result of the discussion here.

It would be nice if the D2RMM mod settings (mod.json) could get a new setting type for custom color values.

Color variables in _profilehd.json and related consist of 4 number values: red, green, blue and alpha. At the moment this would require 4 large and unintuitive separate number setting fields for each custom color you'd like to make available for your mod, and it would be unreadable and error-prone if you need a lot more like in the link above.

Unable to install certain mods, getting a runtime error.

The issue

image

Name of mods

  • Expanded Stash
  • Increase Monster Density
  • Merc Equip
  • Terror Zones

Information

Strangely, the D2RMM was working perfectly fine on the pirated version of D2R, the reason I say pirated is because first time I tried D2RMM with retail version, it simply threw a lot of errors and the game wasn't even starting, Nexusmod comments stated to re-install the game which I did not want to do as I've modded it a lot.

Fast forward a week, I decided to switch to retail version from pirated by manually saving all the modifications I've done and completely reinstalled the game moving it from the SSD directly onto the nVME Local Disk (C:).
I also did a complete reinstall of D2RMM just to make everything as a fresh start and:

  • I started D2R just to make sure it runs with D2RMM which it did.
  • I then installed the mods into the folder of D2RMM called mods
  • Out of 28, only 24 installed, 4 did not :(
  • I tried extracting the data of D2R using CascViewer but that also did not solve the problem.
  • Tried giving full admin permissions on all sub-folders along with permanently making D2R.exe to always run with Admin Rights just to make sure that Win system isn't somewhat blocking it.
  • Found another user with similar problem stating that reinstalling the game fixed the issue for him but this is a fresh install and I don't feel like waiting another 2-3 hours to redownload and install the game.
  • I've tried both version 1.5.0 & v1.6.0 and removing the saved games folder and reinstalling all the mods manually but it still throws the same error over and over.

Help is greatly appreciated, I was unable to export the full logs statement as GitHub would crash with all the overloaded information.

Thank you in advance for your assistance.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.