crazyjackel / Peglin-Relic-Lib

A Library for Ease with Creating Relics
0 stars 0 forks source link

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

Open Afrodarko opened 8 months ago

Afrodarko commented 8 months ago

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):

Orbs

Repeatorb:

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 commented 8 months ago

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 commented 8 months ago

Hi Bo0tz, thank you so much for taking the time to reply. Honestly, I had no hope to get an answer, so your reply wasn't late at all.

I started learning C# and know I start understanding a bit more about all this stuff.

Not sure, if I'm gonna get to develop my own game or to mod, because I've soe other stuff to do, but I'll give it a shot.

After understanding more, I'll come back to this in the hope of getting it.

Btw, I'm Afrosito, from the Discord server. I've recently posted something similar there.

I wish you a nice Sunday! Cya

Enviado desde Outlook para Androidhttps://aka.ms/AAb9ysg


From: Jackson Levitt @.> Sent: Saturday, November 4, 2023 5:31:10 PM To: crazyjackel/Peglin-Relic-Lib @.> Cc: Afrodarko @.>; Author @.> Subject: Re: [crazyjackel/Peglin-Relic-Lib] Some advice to mod by myself as a newbie :) (Issue #4)

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.

— Reply to this email directly, view it on GitHubhttps://github.com/crazyjackel/Peglin-Relic-Lib/issues/4#issuecomment-1793489794, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A4RF7FXOPCCPYVSXFDT5MCDYCZUU5AVCNFSM6AAAAAA63TIKVKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOJTGQ4DSNZZGQ. You are receiving this because you authored the thread.Message ID: @.***>