Coder Social home page Coder Social logo

chalchiu's Introduction


chalchiu

Modding support for Solar2D Games

Designed for Coromon


Warning
Please do not report any issues that may've been caused through this project to the official game developers as they will not assist you with broken games / saves when you are using mods.
Please open an issue here instead!

Introduction

This Project aims to add mod support to Coromon but is implemented in such a way that it should also work for other Solar2D Games.

Usage

The installation of chalchiu is fairly simple:

  • Locate your Game Folder

    e.g. C:/GOG Games/Coromon/

  • Download the zip file from the latest Release and unpack all files into the game directory

    • Your Game Folder should now roughly look like this

      Please note that some files have been omitted

      πŸ“‚ C:/GOG Games/Coromon
      β”œβ”€β”€ coromon.exe
      β”œβ”€β”€ CoronaLabs.Corona.Native.dll
      β”œβ”€β”€ corona-plugins
      β”œβ”€β”€ iphlpapi.dll
      β”œβ”€β”€ libeay32.dll
      β”œβ”€β”€ lua.dll
      β”œβ”€β”€ mods
      β”œβ”€β”€ ...
      
  • Start the Game, the following things should happen:

    • A Log File named chalchiu.log is created
    • A Folder named mods is created in the game directory
    • Your Game Window Title includes information about the loaded mods

Coromon

Continue Reading...

Here you'll find information about the provided Coromon mods!

All mods are tested with the latest game version (v1.1.2 at the time of writing), don't let that stop you from trying them on other game versions though!

Available Mods

  • Trainer

    A simple trainer, which allows you to fun things like noclip, max out all your coromon, and speed up the game!

    When using the Mod Info mod, you can take a look at the available hotkeys in the mod list. Trainer Screenshot

  • Randomize Evolution

    Brings back the "Randomize Evolution" Settings (and more!) in 1.1.2 Randomize Evolution Screenshot

  • Mod Info

    Shows information about the currently loaded mods, on game startup.
    Also adds a button to the pause menu (top right corner), which allows you to bring up the menu again! Mod Info Screenshot

For Modders

Continue Reading...

Example Mods

You can find some example mods in the scripts folder.

A debug mod is also included, which will dump all modules loaded by the game into the log.
This is especially useful when you don't want to unpack the precompiled lua scripts the game uses, as just having information on the game modules is often enough to get started.

Writing a Mod

Creating a mod is fairly simple.
All you need to do is create a folder for your mod and place an init.lua inside of it.

The init.lua is the only file that is explicitly loaded by chalchiu.
You can however use require to load any files from the same directory your mod resides in.

You are expected to return a table containing some information about your mod from your init.lua.

(Example) init.lua
require("hooks") -- Will load the `hooks.lua` residing in the same directory

return {
  name        = 'Name', -- The name of your mod
  author      = '....', -- Who wrote the mod?
  version     = '....', -- Current version of your mod
  description = '....', -- The description of your mod
}

Utilities

There are some utilities you can use from within your mod.

Hooks

Hooks are an essential part of mods, as they allow you to modify modules loaded by the game as well as allowing you to dictate when a certain piece of code is run.

Hooks in chalchiu allow you to intercept lua require calls, which allows you to e.g. modify the original table and replace certain game logic with your own.

All you need is the name of a module you want to hook. (To get a list of modules you can use the debug mod)

Registering a hook
hooks.add("module.to.hook", function(table)
  -- `table` is the original table that would've been returned

  -- You can now fully alter the table, and e.g. overwrite some function:
  table["max"] = table["min"]
end)

Detours

The detour function allows you place a detour on any lua function and is often used together with hooks.

Detours can be useful for many things, e.g. modifying the players money when a save game is loaded.

Example Detour
hooks.add("classes.localPlayer", function(table)
  detour(table, "getMoney", function(original, self, ...)
    -- `original` refers to the "original" (i.e. non detoured version) of the function
    local originalMoney = original(self, ...)
    return originalMoney * 1000
  end)
end)

Globals

Every mod is loaded in its own lua environment, thus it does not have write access to the global lua table.

If you need explicit write access to the global table, you can use the globals variable, which refers to the global lua table used by the game.

Most of the time you will not need this, however this can sometimes be useful, e.g. when you want to require one of the games files.

Simple Demonstration
local not_math = require("math") -- This will fail as it will look for a `math.lua` inside of your mod!
local math = globals.require("math") -- This will load the same math as used by the game

chalchiu's People

Contributors

curve avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

coromodloader

chalchiu's Issues

Debug Menu

Hello, thanks a lot for making this mod, it's really great so far! Just a question on the debug menu - I'm trying to get a list of modules but I'm not sure how to do so. I did the following:

  • Downloaded the 2 lua files in the debug menu folder
  • Created a "debug" folder under "mods" and added the 2 lua files there
  • Started the game - the game hangs on the loading screen
  • I noticed the chalchiu.log file grew in size, but can't find anything which is similar to the hooks you used (e.g. addgold) -> Specifically I'm trying to find modules to add stylecrystals or items

Any idea what I should do? Thanks!

Chalchiu trainer not working on Steam Deck

Hi,

I’ve followed the install instructions to a T and still can’t get the install dialogue to appear, access the trainer, anything. Is this maybe a Linux limitation? Otherwise I am probably just stupid and installed it wrong lol. I copied the iphlpapi.dll and the Coromon.Mods.zip to the install folder on my SD card (primary/steamapps/common/Coromon) and unzipped it there. All seems to be present and correct but no dice on the mod appearing to activate. Is there a button I need to bind to make the trainer open? Just spitballing of course! Would love to see modding this good function on the Steam Deck.

Thanks 😊

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.