#Component Based Custom Item API (CBCI API)

1 messages · Page 1 of 1 (latest)

fallen hazel
oak spoke
#

tip: you can make attributes generic as of C# 11

-[CustomItemAttributeBase(typeof(ColliderExplodeComponent<TestGrenadeInstance>))]
+[CustomItemAttributeBase<ColliderExplodeComponent<TestGrenadeInstance>>]
stuck pecan
#

Could be something I'm doing wrong though

oak spoke
#

sobbing

#

this package is built for net framework 4.8.1

#

-# you can't develop for that on linux

stuck pecan
#

I did not even notice the version

oak spoke
#

generally a nuget package author should make their plugin target net48 or netstandard2.1

stuck pecan
fallen hazel
oak spoke
#

huh

fallen hazel
oak spoke
#

illegal

#

how do you target that then

fallen hazel
#

but I am on linux

#

see top of screen

oak spoke
#

umm

stuck pecan
fallen hazel
woven pagoda
#

bigger version possible -> select it

#

that's my reasoning

#

😋

oak spoke
#

Drake laptop

#

Then you should've chosen .NET 10

woven pagoda
#

tried to already

#

didn't end well

oak spoke
#

Yeah

#

Soon we'll have .net 10 in Unity

#

-# only a matter of decades

woven pagoda
#

fortunately the c# version is more important for general dev experience

#

and that is platform independent

#

I had to do some weird workarounds to get required and init to work

#

but doable

oak spoke
#

Yep

#

You can use PolySharp from NuGet

#

But I prefer manually adding what I need

#

Records are goated

woven pagoda
#

the only thing I truly miss are default implementations for interfaces

#

that would simplify my code so much

oak spoke
#

just reference mscorlib from the game files

woven pagoda
#

I see how it could work

#

but it hurts my brain

oak spoke
fallen hazel
#

Update v0.1.5

The External Compatibility & Default Component Update

This update many new components and is now compatible with ProjectMER and RaCustomMenu.

Note: RaCustomMenuLabApi doesn't have a currently working release to my knowledge. I have attached a fixed version of the plugin to the latest Release on github.

New Components:

  • Explosion Action Component: Executes a method of an itemInstance when the CI grenade explodes
  • Dameagable Item Component: Provides default behaviour for an item taking damage. Used by HeldItemModel if the Schematic is set up properly
  • Held Item Model (component): Attaches an item to the player who is holding the item in their hand
  • Pickup Model (component): Attaches an item to the pickup of the dropped item
  • Infinite Radio Battery Component: Prevents the radio item from using any charge
  • Radio Button Link Component: Executes methods of an itemInstance depending on which button they press

Github: https://github.com/OMEGA3065/CBCI-API/
Latest Release: https://github.com/OMEGA3065/CBCI-API/releases/latest
NuGet package: https://www.nuget.org/packages/Omega3065.ComponentBasedCustomItemAPI/

#

Also: I have no clue how accurate the NuGet package download count is, but it reached 500 downloads total so yay!

woven pagoda
# oak spoke

i ran into an issue with the Stack type being defined in both

#

this only happens for the stack

#

lists, dicts etc. work fine

#

do you know smth bout this?

oak spoke
#

Oh wait

#

Did you add that?

woven pagoda
#

yes

oak spoke
#

What else are you referencing

woven pagoda
oak spoke
#

Wtf is Microsoft.CSharp

woven pagoda
#

great question

oak spoke
#

This should solve the issue

woven pagoda
#

will check

vivid spruce
oak spoke
#

ages ago

fallen hazel
#

@mellow epoch

mellow epoch
fallen hazel
#

also HI

mellow epoch
#

yup

#

one pr i didnt make even tho i should have was RaCustomMenu compat straight up not working as it wasnt detecting RaCustomMenu actually being loaded

fallen hazel
fallen hazel
#

Oh yeah I do think I ran into that issue on a prod server

#

couldn't figure out why

mellow epoch
#

something to do with yelding

#

if instead of periodically checking you just check it after 5 seconds it works perfectly fine

fallen hazel
#

@mellow epoch I've pushed an update. The update nuget version has to index tho so it might take a bit (it says at most 1hr but iirc it's usually sub 5 minutes)

mellow epoch
#

🙏

#

btw great library, besides that stuff i generally didnt have any issues

fallen hazel
#

the only reason it exists is cos there wasn't really anything for labapi and exiled CI was pissing me off since you can repurpose like 0% of your code