risk-of-thunder / r2api Goto Github PK
View Code? Open in Web Editor NEWA modding API for Risk of Rain 2
Home Page: https://thunderstore.io/package/tristanmcpherson/R2API/
License: MIT License
A modding API for Risk of Rain 2
Home Page: https://thunderstore.io/package/tristanmcpherson/R2API/
License: MIT License
Don't forget to update it too.
Exposing this to other mods might help them give out warnings when they might have been outdated by the game updating.
Line 24 in 99b76e2
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
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.
When using the BepInExPack 3.0.0 to import the R2API mod gets error.
Error message is here.
https://gist.github.com/Bear1110/a5430f150e264cdb196828e716072124
I event download the R2API version from Azure (2.3.2)
It still doesn't work.
Can anyone help me ? Thanks
Maybe related this updating?
https://steamcommunity.com/games/632360/announcements/detail/3724971346869698315
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.
Might want to make the config collapsed default only if it doesn't fit on the screen entirely, it's annoying to always need to open difficulty
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.
When folders are incorrectly placed into the r2api folder, they aren't scanned ofr r2api submole depencies
This means it's impossible to depend on multiple aspects of r2api in one mod.
ItemExchange[Error : BepInEx] Missing the following dependencies for [ItemExchange]:
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?
On.RoR2.RoR2Application.UnitySystemConsoleRedirector.Redirect += (orig) { };
This boss doesn't drop green items, unlike other bosses, so the DropBossRewards override needs to be updated.
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
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.
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.
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)
[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
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)```
Title says all. Tried installing mods, getting nothing but errors / issues so just wanna be sure. Thanks!
Every version of r2api , even ones released to thunderstore and current bleeding-edge versions, has some kind of issues with the modlistAPI code.
How did this ever get through?
Proposed solution: Comment out the code in releases until this is stable.
A API to access GenericSkill, create new ones, and change existing ones.
Testing if webhooks work
The manifest links to an old version of BepInEx on thunderstore.
Beep, boop, I'm a bot! This issue was created by @Harb
in #thunderstore
.
Pls update it fast
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
.
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:
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.
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.
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.
When steam crashes, r2api will display it's build warning as steam build id becomes 0
Beep, boop, I'm a bot! This issue was created by @Harb
in #r2api
.
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
.
Line 12 in 28e61b7
missing [R2APISubmoduleInit(Stage = InitStage.UnSetHooks)]
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.
[Feature Request] Configurable location to store ModData (SaveData/Metadata), default to '/BepInEx/ModData'?
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()
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.
Bep update is drawing nearer, so we shouldn't forget to fix this before shipping.
Line 160 in c12e15d
Porting Ryan's Ingame Rule UI functionality to R2API.
I'll get it done soon™️
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);
Something introduced with R2API artifacts is slow and interrupting smooth FPS. Time to profile some methods.
Notably "setPropertyValue".
We should investigate and either fix or disable.
Used an older release to change it and it worked fine, used latest inc bleeding edge and it refused to adjust.
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?
An API that lets you change ItemEffects.
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.