Skip to content

Instantly share code, notes, and snippets.

View l-Luna's full-sized avatar

Luna l-Luna

  • Somewhere
View GitHub Profile
@l-Luna
l-Luna / blah blah.md
Last active January 19, 2021 18:33
Opus Magnum modding: How to
  1. Backup your Lightning.exe. These tools won't damage it, but you might - rename it to something like LightningBackup.exe.
  2. Compile Opus Modded (produces mapped & patched decompiled output) and OpusPatcher (helps dump scrambled strings). Copy mappings.csv, keys.txt, and patch.diff from Opus Modded to somewhere else, you'll need those.
  3. Run OpusPatcher.exe, passing the path to your Lightning.exe as the first command line argument, and the path to your keys.txt as the second. It creates a new Lightning.exe in the directory you ran it - move it to the normal Opus Magnum folder and run it. It must be named Lightning.exe, and I think it has to be in the correct folder (though I haven't tested). It won't start the game, instead creating out.csv. Avoid overwriting your original Lightning.exe. Don't worry if you do - Steam can redownload it. It's just annoying.
  4. Run Opus Modded.exe, passing the path to your Lightning.exe as the first argument and path to mappings.csv a

Now with 100% less recompiling! And 100% more downloading. Sorry.

Download the following:

  • The two executables (Opus Patcher, Modded Opus), which you can get from the releases on their respective repos (on my GitHub profile). -The former runs on .NET Framework, which is required to patch with Opus Magnum's executable, and the latter runs on .NET Core, which has libraries I rely on.

  • Mono.Cecil, available from NuGet (https://www.nuget.org/). If you're unfamiliar with NuGet and simply want to play, download the package using the link on the sidebar, rename it from a .nupkg to a .zip, extract it to a folder, and copy Mono.Cecil.dll from the net40 directory.

    • Mono.Cecil provides tools for patching an executable, used to extract strings from the game.
@l-Luna
l-Luna / om cycle order.md
Last active August 19, 2022 09:38
Opus Magnum's cycle order

At the start of a cycle,

  1. Grab and Drop instructions are executed
  2. Glyphs are updated (start of cycle)
  3. All other instructions are executed
  4. Collisions are checked

At the end of a cycle,

  1. Glyphs are updated (end of cycle)
  2. Area is measured
  3. The cycle count is updated
@l-Luna
l-Luna / More customisations for Everest.yaml
Last active January 4, 2022 14:51
More customisations options for Everest's map.meta.yaml files.
# blah blah
# map metadata stuff idk
# all of this stuff is defined per-side and doesn't affect other sides
# if this isn't present, hearts use their regular appearance.
Hearts: # A list of hearts. An index parameter is added to crystal hearts to pick the right heart. Heart 0 is used for the chapter panel. This allows for multiple seperate hearts, like Shade World's golden heart but with a poem, or GMHS's fake heart (but with a fake poem too).
- Preset: "a_side" # For using a heart specified in code. Everest specifies the "a_side", "b_side", "c_side", and "farewell" hearts, and mods can add extras (e.g. "d_sides_graphics_pack:d_side").
- Poem: "some_cool_poem" # Alternate hearts need to specify their poems (unless they want the same name). If empty, no text will appear.
GuiSprite: "heartgem_yellow" # Idk the actual name, but this points to an entry in XML, used for the poem UI and panel UI (if heart 0). Slightly less easy than in ASH, but more flexible.
InGameSprite: "heartgem_yellow" # Same as above, bu
@l-Luna
l-Luna / collections.md
Last active January 24, 2022 16:14
Collection Literals

Collection Literals

How far this goes

This proposal is not intended to add support for general-purpose custom initializer syntax for any kind of object, nor is it intended to allow for custom DSLs in Java. This is for simple shorthand:

Map<String, Object> values = { "a": "alpha", "b": "beta", null: this };

var list = ArrayList<String> { "a", "b", "c" };

Set checked = HashSet&lt;&gt; { NORTH, SOUTH, NORTHWEST, };
import Data.Binary.Get
import qualified Data.ByteString.Lazy as BSS
import Data.Bits (Bits((.|.), (.&.), shiftL))
import Data.Text.Encoding (decodeUtf8)
import Data.Text (unpack)
import qualified Data.Map as M
import Data.Char (chr)