Skip to content

Instantly share code, notes, and snippets.

View M3ales's full-sized avatar

Matthew M3ales

  • Luna Software Solutions
  • South Africa
  • 03:36 (UTC +02:00)
View GitHub Profile
@M3ales
M3ales / gist:fe836c1074ba3c9e4dddbb5c4f31121b
Last active August 15, 2017 10:54
Proposed Entity Storage per Level in Json
"level":
{
"seed":"askdaoko23kfwifsjd30892jwe"
}
"entity":
{
{
"id":"player"
"active":true
"components":
@M3ales
M3ales / rename.bat
Last active November 5, 2017 12:12
Short script to automate file renaming for custom heroes duplicated off base heroes in Darkest Dungeon. Copy the heroes/<heroname> folder, rename it to what you want, and place this file inside it. Run it, specify the old name (original hero class name), and your new name and it'll go through all the filenames, atlases, and art.darkest/info.dark…
@echo off
setlocal enabledelayedexpansion
:start
set /p "Pattern=Old Name:"
set /p "Replace=New Name:"
set /a num=0
set /a total=0
echo ------
for /D %%# in (%~dp0%Pattern%_*) Do (
echo Renaming %%#
@M3ales
M3ales / search.bat
Created November 5, 2017 13:44
Searches folder and subfolder, the content of each file for the specified string, then prints the filename, and line+character offset. To use regex, add the /r flag to both findstr checks.
@echo off
:start
echo =============
echo New Search
echo =============
set /p "search=Search String:"
echo --
findstr /s /m %search% *.*
echo ----------
echo \\\\\\\
@M3ales
M3ales / StardewNotes.md
Created July 11, 2018 12:32
Stardew Valley Modding Notes (What I've found)

Stardew Valley Notes on Game layout

Entrypoint is StardewValley.Program.cs:39 Game1 is a godclass holding the gamestate Content is loaded using Microsoft.XNA.Framework.ContentManager (StardewValley.LocalizedContentManager wraps it) Notes on Content Pipeline Stardew Valley makes use of

@M3ales
M3ales / StardewNotes.md
Last active July 10, 2020 03:43
Stardew Valley Modding Notes (What I've found)

Stardew Valley

Skip down to the Specific Datastorage Formats if you want the useful stuff. It's mostly just what I'm thinking so lots of speculation and development of reasoning (or me making lots of assumptions).

Notes on Game layout

  • Entrypoint is StardewValley.Program.cs:39
  • Game1 is a godclass holding the gamestate and most used Constants
  • Content is loaded using Microsoft.XNA.Framework.Content

The Dictionaries below are used to index most objects and are accessible under StardewValley.Game1.

public static IDictionary objectInformation;
@M3ales
M3ales / StardewModdingReference.md
Last active July 12, 2018 01:40
Item Category Reference

Item Category Reference

Description

Simplified set of all known item categories. List is WIP. Check if the items you want are in the category you want by taking a look here at the objectInformation set, and read up here to learn about the format.

Item Categories

Item.Category : int

May take any of the relevant IDs, so you can use this reference to filter items by the relevant category

@M3ales
M3ales / Game1.parseDebugInput.cs
Last active October 31, 2021 00:15
All possible debug commands and their functionality, that can be invoked from the SMAPI console by using the 'debug' command. (1.3.24)
public bool parseDebugInput(string debugInput)
{
Game1.lastDebugInput = debugInput;
debugInput = debugInput.Trim();
string[] debugSplit = debugInput.Split(' ');
try
{
if (Game1.panMode)
{
if (debugSplit[0].Equals("exit") || debugSplit[0].ToLower().Equals("panmode"))
@M3ales
M3ales / IGamePatch.cs
Created July 21, 2018 00:52
My thoughts
using System.Reflection;
using System;
namespace Bookcase.Patches {
/// <summary>
/// This interface is used to mark a class as a loadable patch by Bookcase's patch loader.
/// </summary>
internal interface IGamePatch {
_fnc_damageTarget = {
params["_target", "_numberOfWounds"];
private _parts = ["Head", "Body", "LeftArm", "RightArm", "LeftLeg", "RightLeg"];
for [{private _i = 0}, {_i < _numberOfWounds}, {_i = _i + 1}] do {
[_target, 1, selectRandom _parts, "bullet"] call ace_medical_fnc_addDamageToUnit;
};
};
private _vehicle = vehicle player;
@M3ales
M3ales / rxjs-unsubscribe.md
Last active May 11, 2022 23:09
RxJs Angular Destroyed Unsubscribed OnDestroy

RxJs Unsubscribe

Given:

export class Example implements OnDestroy {
    isLoading : boolean;
    isSaving : boolean;
    isUndoing : boolean;