Giter Site home page Giter Site logo

risk-of-thunder / r2api Goto Github PK

View Code? Open in Web Editor NEW
132.0 8.0 51.0 40.79 MB

A modding API for Risk of Rain 2

Home Page: https://thunderstore.io/package/tristanmcpherson/R2API/

License: MIT License

C# 99.75% Shell 0.25%
bepinex monomod risk-of-rain-2 hacktoberfest modding

r2api's People

Contributors

abbasboumelhem avatar awokeinanenigma avatar bb010g avatar bbepis avatar cheeeeeeeeeen avatar demojameson avatar dgosling avatar fmradio11 avatar goorakh avatar grahammthomas avatar harbingerofme avatar jacedadorito avatar kingenderbrine avatar komradespectre avatar kylewill0725 avatar mistername avatar nebby1999 avatar passivepicasso avatar phedg1studios avatar priscillalala avatar reinms avatar thetimesweeper avatar thinkinvis avatar tristanmcpherson avatar vale-x avatar varstyx avatar windows10ce avatar xiaoxiao921 avatar yekoc avatar yoshisman8 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

r2api's Issues

R2API Causing Game Stutters

After me and some friends installed R2API we started experiencing stutters every few seconds in game im not sure whats causing it but we removed all other plugins narrowing it down to R2API

SurvivorAPI misidentifies survivors with missing newline characters.

There are two locals for SurvivorDef in CharacterSelectBarController.Build, and that fucntion loops through survivors two times. R2API emits ldloc for the first local, not the second. This causes whatever survivor was added last to be logged as the one missing the Environment.Newline, not the one actually causing the issue.

[BUG] Boss Items drop from chests

Pretty straight forward issue. Chests are dropping boss items rarely. Seemingly at the same rarity of red items. Can confirm I've gotten them from small and medium chests.

[Bug] Green Chests

As far as I can tell, it seems that currently R2API somehow sets green chests to only drop red items.
Edit: As a side note, this is a really fun way to play the game and if you fix it, maybe add a way to turn it on or off as a feature.

Error

ItemExchange[Error : BepInEx] Missing the following dependencies for [ItemExchange]:

  • com.bepis.r2api this error comes up every time i start ror2 then i can play but the mods dont work
    i allready have the newest version of r2api (as much as i know) and bepinex

[Question] No implementations for master spawn events?

Currently investigating SkillsAPI and ItemEffectsAPI, and after reading through the game api, there seems to be no static actions/events for when a character master is created. There are virtual methods implemented in the Run class, however that's not injection friendly at all. My current workaround is to detect changes to the read only master list, this is guaranteed to work since the add and remove methods get called on OnEnable and OnDisable. Is there an event that im missing?

[Feature] Content Handler for IL Patched

Or you can make a ContentHandler-like class for patchers and hooks that keeps track of what each mod uses/creates

A ContentHandler for IL patches that could apply the reverse patch would be awesome

[Feature Request] UserProfileAPI

We need a UserProfileAPI that has a useful consumption for mod developers. We will need to figure out how we want this to look for each area (Achievements, etc). We'll want to write down more of how this will be used as I was only given a small use case.

(CommandHelper) Non-static console commands throws generic error

If you forget to set a CC method to static then you'll get a generic "method arguments are incompatible" error during startup, regardless of what's written inside the method.

Example:
[ConCommand(commandName = "test", flags = ConVarFlags.None, helpText = "test")]
public void CCTest(ConCommandArgs args){ }
Instead of:
[ConCommand(commandName = "test", flags = ConVarFlags.None, helpText = "test")]
public static void CCTest(ConCommandArgs args){ }

I can't get the exact point that causes the error as DNSpy wont go that far, but the error occurs somewhere directly after the while loop of R2API.Utils.HandleCommandsConvars() - outside of it (step next three times from the end of HandleCommandsConvars(), looks like it's @this.concommandCatalog[conCommandAttribute.commandName.ToLower(CultureInfo.InvariantCulture)] = new RoR2.Console.ConCommand {... that's doing it).

CommandHelper should check if the method being registered is static or not and skip it if it isn't, instead of throwing a generic error, also (if possible) warning the user which CCs have been skipped, so that the user can easily tell what the problem is and the mod author can easily fix it.

R2API Incompatible with 5.0.0.0's new features

Using R2API, I can no longer get passed the introduction screen. I go into the BepInEx console log and get this:

[Info : Unity Log] Initializing system: BodyLoadoutManager
[Error : Unity Log] NullReferenceException: Object reference not set to an instance of an object
Stack trace:
RoR2.Loadout.GenerateViewables () (at <031d45f6d872453e8ed1fb7ad036d5b9>:0)
RoR2.Loadout+BodyLoadoutManager.Init () (at <031d45f6d872453e8ed1fb7ad036d5b9>:0)
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at :0)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at :0)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at :0)
RoR2.SystemInitializerAttribute.Execute () (at <031d45f6d872453e8ed1fb7ad036d5b9>:0)
DMD<RoR2_RoR2Application::OnLoad>?-652483072._OnLoad (RoR2.RoR2Application ) (at <5a8111aec177461d81b87e608f99cfac>:0)
R2API.R2API+<>c.<.ctor>b__9_2 (On.RoR2.RoR2Application+orig_OnLoad orig, RoR2.RoR2Application self) (at <58e3b476e82c4450a70aa5a57825fb7c>:0)
DMD<>?-1885116032._Hook<RoR2_RoR2Application::OnLoad>?-1682195968 (RoR2.RoR2Application ) (at :0)
RoR2.RoR2Application.Awake () (at <031d45f6d872453e8ed1fb7ad036d5b9>:0)

Adaptive Chest and Cleansing Pool not working

[Error : Unity Log] InvalidOperationException: Cannot call Choose() without available choices.
Stack trace:
WeightedSelection`1[T].Evaluate (System.Single normalizedIndex) (at <9adb18c5484340e58a7afc9827db1de0>:0)
RoR2.BasicPickupDropTable.GenerateDrop (Xoroshiro128Plus rng) (at <9adb18c5484340e58a7afc9827db1de0>:0)
RoR2.RouletteChestController.GenerateEntriesServer (RoR2.Run+FixedTimeStamp startTime) (at <9adb18c5484340e58a7afc9827db1de0>:0)
RoR2.RouletteChestController.BeginCycleServer () (at <9adb18c5484340e58a7afc9827db1de0>:0)
RoR2.RouletteChestController+Cycling.OnEnter () (at <9adb18c5484340e58a7afc9827db1de0>:0)
RoR2.EntityStateMachine.SetState (EntityStates.EntityState newState) (at <9adb18c5484340e58a7afc9827db1de0>:0)
RoR2.EntityStateMachine.FixedUpdate () (at <9adb18c5484340e58a7afc9827db1de0>:0)

InvalidOperationException: Cannot call Choose() without available choices.
at WeightedSelection`1[T].Evaluate (System.Single normalizedIndex) [0x00008] in <9adb18c5484340e58a7afc9827db1de0>:0
at RoR2.BasicPickupDropTable.GenerateDrop (Xoroshiro128Plus rng) [0x0000c] in <9adb18c5484340e58a7afc9827db1de0>:0
at RoR2.RouletteChestController.GenerateEntriesServer (RoR2.Run+FixedTimeStamp startTime) [0x00066] in <9adb18c5484340e58a7afc9827db1de0>:0
at RoR2.RouletteChestController.BeginCycleServer () [0x00028] in <9adb18c5484340e58a7afc9827db1de0>:0
at RoR2.RouletteChestController+Cycling.OnEnter () [0x0002f] in <9adb18c5484340e58a7afc9827db1de0>:0
at RoR2.EntityStateMachine.SetState (EntityStates.EntityState newState) [0x00050] in <9adb18c5484340e58a7afc9827db1de0>:0
at RoR2.EntityStateMachine.FixedUpdate () [0x00008] in <9adb18c5484340e58a7afc9827db1de0>:0

(Filename: <9adb18c5484340e58a7afc9827db1de0> Line: 0)

I have no other mods installed Playing on Dedicated server
Its always giving me Syringe after few seconds

Cleansing Pool is simply not working i click and does nothing

20191225122725_1
20191225140854_1
20191225140902_1

ItemDropAPI causes overgrown printers to not select an item.

Cause:
in ItemDropAPI.RunOnBuildDropTable orig(self) is not called, and the game never builds a list of available boss tier items.

Relevant stack trace:

[Error  : Unity Log] ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: Range cannot have size of zero.
Stack trace:
Xoroshiro128Plus.RangeUInt32Uniform (System.UInt32 maxExclusive) (at <5cdee1c8afdf42e2a8df7bd1ae8dc681>:0)
Xoroshiro128Plus.RangeInt (System.Int32 minInclusive, System.Int32 maxExclusive) (at <5cdee1c8afdf42e2a8df7bd1ae8dc681>:0)
Xoroshiro128Plus.NextElementUniform[T] (System.Collections.Generic.List`1[T] list) (at <5cdee1c8afdf42e2a8df7bd1ae8dc681>:0)
RoR2.ShopTerminalBehavior.<GenerateNewPickupServer>g__Pick|17_1 (System.Collections.Generic.List`1[T] list) (at <5cdee1c8afdf42e2a8df7bd1ae8dc681>:0)
RoR2.ShopTerminalBehavior.GenerateNewPickupServer () (at <5cdee1c8afdf42e2a8df7bd1ae8dc681>:0)
RoR2.ShopTerminalBehavior.Start () (at <5cdee1c8afdf42e2a8df7bd1ae8dc681>:0)```

ModlistAPI throwing errors across all versions that have it.

Every version of r2api , even ones released to thunderstore and current bleeding-edge versions, has some kind of issues with the modlistAPI code.

  • Invalid config
  • Kickking players on connection
  • stacktrace on private games

How did this ever get through?

Proposed solution: Comment out the code in releases until this is stable.

[Feature] SkillAPI

A API to access GenericSkill, create new ones, and change existing ones.

monomod patch detecting

consider detecting if the mm patch was applied by warning in the console if it isn't.


Beep, boop, I'm a bot! This issue was created by @Harb in #r2api.

Fix reflection unit tests

Right now, the automated builds fail (and manual ones too). Since we're going ahead and releasing regardless of the results of theses tests, it might be wise to review if:

  • Those tests fail for legitimate reasons
  • We need those tests in the first place

Difficult to get list of loaded submodules.

APISubmoduleHandler currently has a public method to check if a submodule is loaded, however, the instance that loads the submodules is created as a local var during the R2API constructor. This makes it impossible to access without manually IL hooking the R2API constructor.

Some kind of static access to loaded submodules would be very helpful for interop. A static event that is invoked right after all submodules are loaded would be awesome, but I could settle for a static method or hashset.

2.4.2 doesn't let me past welcome screen

Title. I try to get through and it won't let me click anything. I tried a mod that skipped the welcome screen but then I couldn't click on anything in the menu.

[Bug] SurvivorAPI locks survivors

There is currently a bug in the SurvivorAPI where adding additional survivors effectively does nothing beyond adding two more, and additionally breaks all other survivors not allowing them to be used. For some reason having dnSpy's patched verison of mono-2.0-bdwgc.fll makes the API work as expected.

bepinex dependency wrong

the thunderstote dependency is on 2.0.0, while the current r2api needs at least thunderstore version 3.0.0 of bepinex


Beep, boop, I'm a bot! This issue was created by @Harb in #r2api.

[Feature Request] Add hooks in Scene Director for changing spawn of interactables

Currently we have hooks for item drop chances and rates, but nothing for spawning interactables with the same methodology. I propose we add a new class for managing these called InteractablesAPI or maybe a more generic StageAPI (considering that this will not be a large hook) that functions similarly to ItemDropAPI where you can specify which type of interactable (I'm thinking shrines in particular but this could extend if it's applicable) you want via an enum and it's spawn chance / spawn count. Spawn count will be more involved as currently it is based upon the interactablesBudget but we can hook to ignore that for these interactables and override it.

Startup failure when not in own folder in plugins

When r2api is sitting at the root of the plugins folder, it can't startup correctly.
Workaround: move the r2api plugins files into their own R2API folder.

[Error  : Unity Log] NullReferenceException: Object reference not set to an instance of an object
Stack trace:
R2API.Utils.APISubmoduleHandler.<LoadRequested>g__getAssemblies|4_0 () (at <9ef6563d9c7248e786c3a8e22e040bec>:0)
R2API.Utils.APISubmoduleHandler.LoadRequested () (at <9ef6563d9c7248e786c3a8e22e040bec>:0)
R2API.R2API..ctor () (at <9ef6563d9c7248e786c3a8e22e040bec>:0)
UnityEngine.GameObject:AddComponent(Type)
BepInEx.Bootstrap.Chainloader:Start()
UnityEngine.Application:.cctor()
RoR2.CharacterSpawnCard:Awake()

Custom items can break run reports

This is because in the <itemStacks> field, each item picked up is made a tag and expanded to their itemIndex enum "string". This goes weirdly for custom items with spaces.
We will need to change RoR2.RunReport.PlayerInfo.itemStackRules.

I propose making the tags for custom items as "CUSTOMXXX" where XXX is the index of the item.

R2API causes graphics stutter

Prerequisite: use a high refresh rate (144hz) monitor to see substantial frame delay introduced every second or two with R2API.

On a clean installation of Risk of Rain 2 (delete winhttp.dll, delete BepInEx, delete doorstop_config.ini);

  1. Extract latest BepInEx to Risk of Rain 2 dir
  2. Launch RoR2 with nothing but BepInEx, observe no FPS spikes
  3. Exit RoR2 and extract R2API (Azure artifact latest) into BepInEx dir
  4. Launch RoR2 with nothing but BepInEx and R2API and observe FPS stutter every 1-2 seconds

Something introduced with R2API artifacts is slow and interrupting smooth FPS. Time to profile some methods.

LobbyConfigAPI Example?

I tried a few things but never got anything to work other than the category showing and the description. Not sure how to add choices.

Is there an example anywhere?

[Feature] SurvivorStatsAPI

A API to access common stats of survivors, like base move speed and the like.
Should allow multiple mods to access the same stat, applying the change incrementally
Some kind of ordering would be needed for that too, or flags that allow a couple of complete ovveride instead of incrementally adding the changes.
If two mods ovveride the value, an error message should appear, informing of the conflict.

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.