olegbl / d2rmm Goto Github PK
View Code? Open in Web Editor NEWMod Manager for Diablo II: Resurrected
Home Page: https://www.nexusmods.com/diablo2resurrected/mods/169
License: MIT License
Mod Manager for Diablo II: Resurrected
Home Page: https://www.nexusmods.com/diablo2resurrected/mods/169
License: MIT License
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:
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.
I have multiple folders for D2RMM. For both my 1.7.0 folders auto-update doesn't work:
Both of them run as administrator.
Attached is a simple test mod to alter ExpRatio column in Experience.txt.
In the result the column remains unchanged. With any other column name the values change correctly.
For example NumberedRuneNames is safe for run players on the battle.net realms.
But HoradricForging is not.
And StackableRunes is safe partly (only runes skin is changed, but stack feature is not works on battle.net realm).
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.)
Hi, D2RMM is great for applying existing mod, but I found it not that great to create mod.
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>
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?
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.
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.
Button to clear all logs, so next install cycle will start with a clean slate.
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.
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.
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.
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.
hello !
very glad for this mod manager !
is it by any chance possible to run on linux ?
regards,
Michael
Suggestions for some new features
Add switch buttons for various parameters, etc
D2RMM can also be an excellent D2R starter
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.
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:
Possible solutions:
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
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.
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.
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.
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:
mods
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.