Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some advice to mod by myself as a newbie :) #4

Open
Afrodarko opened this issue Nov 2, 2023 · 2 comments
Open

Some advice to mod by myself as a newbie :) #4

Afrodarko opened this issue Nov 2, 2023 · 2 comments

Comments

@Afrodarko
Copy link

Hello Gobs/crazyjackel,

I'm trying to make small mods by myself. I want to create a new Keyword with its characteristic orbs and relics for Roundrel.

I'm using dnSpy to create this mods. I've no idea about modding or coding, that's why I wanted to ask someone, who has experience in this specific area. It will be challenging for me, but I'm good understanding new stuff and creative, so maybe, I can do something.

What I'm trying to do: "The Multishot Mod"

Keyword - Multishot X (Roundrel specific mechanic):

  • The orb is thrown X extra times
  • Damage per shot is divided by X+1 (so the damage output isn't affected by the keyword).
  • Only by default single target "normal medium sized orbs" thrown straight forwards (like daggorb, pebble, Matryorbshka) are affected by Multishot
  • Orbs like Ecchorb, Bouldorb (which aren't normal sized orbs") aren't affected by Multishot
  • Orbs that pierce or go through all enemies, that are "normal sized", can be affected by Multishot.

Orbs

Repeatorb:

  • 0 | 2 : Multishot 2
  • 1 | 2 : Multishot 3
  • 1 | 2 : Multishot 4

Multiorbs:

  • 0 | 1 Multishot 1 Multiball 1
  • 0 | 2 Multishot 1 Multiball 1
  • 1 | 2 Multishot 2 Multiball 1

Relics

Multiplication Station (rare relic): Every 4th shot has Multishot (if the orb cannot be affected, the effect is wasted)
Dull Knife (rare relic): When not dealing crit damage, add Multishot +1
Fan of Daggers (boss relic): All orbs get Multishot +2. Confusion 2. Targets are chosen randomly (if possible).
I thought, that this would be as easy as copy-pasting already exiting items and tweak around but I couldn't even find them with the Search function by searching "Daggorb" for example, which was kinda frustrating.

My questions to get started:

  1. Where can I find the orb and relic pools to at least start creating simple orbs and playing around?
  2. How can I create the Multishot Keyword the easiest way (maybe with existing mechanics)?
  3. Where do I find the "shot orb" action to "multiply" it by the X from Multishot?
    4 Where can I find the icons, that belongs to the orbs?

I think, what I need, is to know, where to find the snippets (if called so) "shot orb", multiball, "crit damage active?" "confusion", "all orbs in satchel", "target enemy", "Random target" and create conditionals (just saying by pure logical thinking).

I would appreciate it a lot, if you could help me out!

I wish you a nice day :)

P.S,: Maybe I haven't made the right questions or forgot to ask things, but for now, that would help me a lot to start modding in Peglin. If this content is balanced enough has to be tested, because I just wanted a cool mechanic that exploits more Roundrels started relic.

@crazyjackel
Copy link
Owner

Hi, sorry for my late response. Modding and Coding is difficult for a first timer and to be honest, I have not touched Peglin Modding in a while.

I would recommend learning Unity and C# before trying your hand at Modding. I would say that a large amount of the skillset for modding needs to begin with understanding how Coding works. I would recommend trying to make your own small game first before trying to add-on to others, even thought that is counter-intuitive (Shouldn't making small changes to other people's games be easier?)

Once you understand C# and how Unity feels to work you can start understanding Modding. In C#, all programs are compiled Just-In-Time, this means that your .exe builds up the code from a bunch of smaller code files and assembles it together right when the player clicks on it. When we mod in this language, what we do is we add our own code files and we use that code file to modify the other code files through injection.

Usually what that means is that we have some code happen before or after some other code happens, though occasionally we might do something a bit more complicated than that.

Our System for doing that is called BepInEx which is our mod loader and Harmony is a subsystem for BepInEx that injects our code. It takes our small code file, called a .dll (Dynamic Linked Library) and stiches it together with the other ones and then calls our code constructing a Plugin.

Instead of specifying where anything is, because I would then need to open up DnSpy myself, I will talk about an example of some code:

[HarmonyPriority(Priority.First)]
  [HarmonyPatch(typeof(RelicManager), "Reset")]
  public class RelicManagerResetPatch
  {
      public static void Prefix(RelicManager __instance)
      {
          //Register Relics
          RelicRegister.InitializeRelicsIntoPool(__instance);
      }
  }

This is a Prefix, whenever RelicManager calls the function, "Reset", our code will first occur. We will then run the function allowing the RelicRegister to InitializeRelicsIntoPool. This function takes all the Relics that I have told the register to add and then it adds them into the Relic Pool which will allow it to show up in a certain pool. I have not updated this code to the latest versions and it likely no longer works, but it is a good representation of a Prefix. You might decide instead to have some data representation of your relic saved statically in C# and then inject it into the Relic Manager to appear in runs. Try getting a Relic that does nothing to appear in game first and then worry about your feature set.

@Afrodarko
Copy link
Author

Afrodarko commented Nov 5, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants