Skip to content

MeterPreter57/MiniDayZ-PC

Repository files navigation

PC Browser Mini DayZ

Mini DayZ

Mods support added

Progress saving works!

Thanks Alpha Systems for that.
Click Save and Exit and wait until you will be back to the main menu.

What's new?

  • Updated "Response server simulator" now simulator allows you to inject data.js files
  • Toolkit update, now you can load your own data.js modifications using simple game.loadData(src) function
  • Toolkit game.saveCache(__dirname,files) method for storing files for offline play
  • Toolkit showcase modification

Plans for the future:

  1. Restore c2runtime.js and data.js to original source code
  2. Add mods support without changing original files
    • Mod selection from list
  3. Add server response simulator as mod
  4. Add working in-game map mod
  5. Update save editor UI & add more features
  6. Use toolkit.js to create an in-game panel that allows advanced game controls
  7. Creating helpers for better game control and easier creation of mods

Known issues:

Achievements and stats are not updated after death

Reload the page

Game saving/mods/other recently added features don't work

  1. Open the game
  2. If you want to preserve your save
    2.1. Enable the Save exporter & importer mod
    2.2. Export your save
  3. Open site information (top left corner near the url)
  4. Go to Site settings
  5. Click Delete data
  6. Reload the game and import your save

Mods

If you want to create your own mod, create javascript file in mods/ directory, for example: mods/my-mod/my-mod.js

Now you must to add exported install function:

mods/example-script/example-script.js

export function install(){

}

Now you can add some logic, for example I tried to add listener for buttons in-game that open links, and print in console.log what they want to open:

mods/example-script/example-script.js

export function install(){
	const original_open=window.open;
	window.open=function(url, target, windowFeatures){
		console.log(url,target,windowFeatures);
		original_open(url,target,windowFeatures);
	}
}

Now you need to modify mods.json, add your new mod to list:

mods.json

{
	"mods":[
		// Other mods:
		{...},
		// Your mod:
		{
			"name":"Example mod",
			"description":"Example description",
			"script":"example-script",
			"version":"1.0.0"
		}
	]
}

Testing mods

Now you can start the server, e.g. via NodeJS http-server and run the game: Browser Mini DayZ mods selector

Loading custom data.js

Below is an simple example of loading a custom data.js file:

import { game } from "../toolkit.js";

const __dirname=import.meta.url.split("/").splice(0,import.meta.url.split("/").length-1).join("/");

const offlineFiles=[
	"assets/image.png",
	"assets/audio.ogg"
];

export async function install(){
	await game.loadData(`${__dirname}/custom-data.js`);
	await game.saveCache(__dirname,offlineFiles);
}

Files structure:

mods/
└── before-dayz/
    ├── before-dayz.js
    ├── custom-data.js
    └── assets/
        ├── image.png
        └── audio.ogg  

All data.js modifications are saved to the browser memory, so offline play is possible

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages