#LC_API

2372 messages ยท Page 3 of 3 (latest)

uncut raptor
#

but I need LC API

edgy orbit
jagged trout
#

Alternatively, tell me how it's breaking your game

#

errors, issues whatnot

#

Sometimes LCAPI isn't the actual cause and mods using it improperly or not updated to a new major version

edgy orbit
#

Removed it

#

Never had an issue

#

With hosting or joining lobbies

jagged trout
#

Yeah that means a mod enabled modded only servers

#

it's not something LCAPI does by itself

edgy orbit
#

Well whenever a person uses it

#

Or I use it

#

That's the error we get

jagged trout
#

it's not an error

#

it's expected

#

16845 is the version LCAPI will set you to when a mod uses this method

#

Specifically GameNetworkManager.Instance.gameVersionNum += 16440; on line 41

edgy orbit
#

Why is lc api forcing mod server side only then

#

When all the mods I run r client side

#

And so it provides a problem

#

That means every person has to use lc api

#

In ur lobby

jagged trout
#

because it does networking

#

and networking requires the host to have the mod

#

if you don't want to use it for that reason, then don't.

#

But it being server sided is not a bug

edgy orbit
#

Okay i see that now

#

But more company

#

For example

#

Does the exact same thing

#

As bigger lobby

#

But it doesn't use networking

jagged trout
#

I'm not sure what the comparison is

edgy orbit
#

They both do the exact same thing

#

But one requires lc api

#

One doesnt

jagged trout
#

The other one most likely just requires it to set modded only

#

I'm not sure why they do that

edgy orbit
#

But why do some require lc api

#

I dont understand that

jagged trout
#

I didn't create the mods

edgy orbit
#

If u don't have to use it

jagged trout
#

you'd have to ask the creators

edgy orbit
jagged trout
#

I'm the current maintainer of LCAPI

#

That does not mean I control who uses it and for what reasons

edgy orbit
#

Oh I see

edgy orbit
uncut raptor
#

can I use another mod for Custom Sounds?

edgy orbit
#

Ooh

edgy orbit
#

Here

#

Give him a chance :)

jagged trout
#

You may be looking for LethalLib potentially?

jagged trout
#

Current unreleased changelog:

[Unreleased]

  • Added Player.Died and Player.Hurt past-tense events.
  • Added Player.StartGrabbingItem and Player.GrabbingItem and Player.GrabbedItem events.
  • Added new Player.ShowTip(string header, string message, float duration, bool isWarning, bool useSave, string prefsKey) and Player.QueueTip(string header, string message, float duration, int priority, bool isWarning, bool useSave, string prefsKey)
    • Player.ShowTip bypasses the new tip queue.
    • Base game tips (or mods that use the HUDManager.DisplayTip method) will be treated as max priority tips for compatibility.
    • Tips now have a configurable duration in which they will stay on the screen.
    • The host can show tips to anyone, however local clients can only show tips to themselves.
    • The int priority parameter of the QueueTip method allows you to set a priority, where higher means it will be shown sooner.
      • Tips will always go to the end of their equivalent priority "list" meaning tips added after another that have the same priority will be shown after the ones added previously.
    • When a tip bypasses the queue for any reason, the currently showing tip will continue afterwards with whatever time left it had remaining as long as there were >= 1.5 seconds remaining.
      • This is the only "breaking" change as it will also affect tips shown by other plugins using other methods, which usually won't requeue the current tip. This will be monitored in case it needs to be removed.
    • With this, GameTips class has been deprecated, but will still work as expected.
  • Fixed Player.Username not updating on the radar or escape menu.
  • Added Player.PlayerObjectId which returns the player's specified player object index in places like allPlayerScripts.
#

Still working on it, but this next update should add some more useful stuff

#

I'm going to try to get Player.DroppingItem, Player.DroppedItem, and Item.Using, Item.Used as well

Player movement events are also on my todo list, so that's start and stop moving, jumping and crouching

#

Item.Selling and Item.Sold are also gonna happen eventually as well as some overall SellingItems and SoldItems, but I'm not sure what that'd, fall under for namespace reasons, probably something just general like Game, but not sure just yet

#

But the dropping/using events are the only ones guaranteed to be in this next update

jagged trout
main minnow
#

btw @jagged trout if you want to use odin serializer for LC API

main minnow
jagged trout
#

Added Player.StartGrabbingItem and Player.GrabbingItem and Player.GrabbedItem events.

main minnow
#

because I had to do a similar ish kind of thing to get NetcodePatcher to build in CI

jagged trout
#

I mean we could always just copy the files into the project lmao

main minnow
#

yeah but that really sucks ๐Ÿคฃ

#

plus we have to rename all the namespaces

#

to avoid collisions

jagged trout
#

well the download tool renames them for you

#

you give it a root

#

and it does all the templating

main minnow
#

okay that's not too bad then

jagged trout
#

but what was your idea?

main minnow
#

well i thought we could only download it as a unity package

#

so I was gonna install the package into a unity instance in CI

#

then pull out the compiled assembly

#

that unity makes

#

put that in a thunderstore package

#

and bish bash bosh

jagged trout
#

Also

#

I'm debating on just removing the vanilla support entirely as it will completely break any reason to make the network compatibility attribute

#

at this point, if you're going to use LC API, everyone on the server should have it since it uses networking anyways

#

and the rpcs are required for proper syncing

jagged trout
#

Player.DroppingItem is on more-event branch as well now

#

I'm gonna do Player.DroppedItem then I'm going to merge this into dev for more testing

main minnow
#

I get where you're coming from tho

#

LC-API has transitioned from 'lightweight thing fine for clientside mods' to 'fully networked API'

#

except all those shitty little clientside mods still exist

edgy orbit
main minnow
#

they are

edgy orbit
#

They r good cause u can join any lobby

#

And work well too

main minnow
#

I'm saying they're shitty because they used LCAPI for the bundle loading feature

#

when they should have done it themselves

edgy orbit
#

Maybe I misunderstood

jagged trout
#

At some point being held back because of people not wanting to sync mod lists is going to become too much of an issue to handle

main minnow
#

it's all good

edgy orbit
#

But don't they have to use lc api

#

To use that bundle loading festute

main minnow
#

no

#

it's part of unity

edgy orbit
#

Oh

main minnow
#

they were just being lazy

edgy orbit
#

So ur saying they stole the code?

jagged trout
#

no

main minnow
#

no, i'm saying they SHOULD have stolen the code

#

and they didn't

edgy orbit
#

Oooh

#

Lmao

#

Idk my only problem with lc api is that some random mods use them completely locking out entire players from public lobbies

jagged trout
#

This project will stagnate if I have to consider "what about people using old mods that didn't bundle load for themselves" for the next 6 months

#

Eventually a major version will release that breaks all that regardless

edgy orbit
#

And people don't realize lc api is not client side

#

So they restrain lobbies

#

Idk if that can be fixed

jagged trout
#

The problem is the longer I wait to break this, the more people will use it

#

meaning more will be affected when it does break

jagged trout
#

Right now I have a vanilla support option that disables about 2/3 of the API just so people can join vanilla lobbies with lc api

#

this is simply not an option I can keep forever

#

as it causes long standing issues with future features

jagged trout
# main minnow which APIs are left enabled?

Anything that doesn't directly interact with the Player or Item classes, and in the future, any other networked APIs that are added. So right now that's the bundle loader, and the networking class, the client text-chat command handler, and whatever 2018 made originally

main minnow
#

yeah i get where you're coming from

#

someone asked me the other day for a vanilla-compatible mod that has a live 'scrap in facility' count

#

it's like

#

no

#

you can't have both

#

Can't conveniently listen to players entering/leaving facility without networking

edgy orbit
jagged trout
#

again 16845 version will not be set automatically by LC API itself, a mod that uses LCAPI has to do that

edgy orbit
#

Ah okay

edgy orbit
#

Cause I want to be able to join vanilla servers lol

main minnow
main minnow
edgy orbit
#

Ah I see

main minnow
#

More Company checks for LC API being installed and sets the version number to 16845 if it is

edgy orbit
main minnow
#

btw @jagged trout are there events for player enter/leaving the facility?

jagged trout
edgy orbit
#

To live update instead of using the elevator checm

#

Check

jagged trout
# main minnow yeah i get where you're coming from

I might just give people a 2 month warning that it's happening lmao and tell the devs that if they are making a client sided mod, that LC API will no longer be a library they should use since it's server sided.

Barring splitting the project's client and server sided parts, which would take massive refactoring and break every mod using the api right now, I don't see another option for the longevity of the project

jagged trout
#

no idea if this works post update btw, will need to test when not busy

swift halo
#

pretty radical changes proposed here

#

why are you even building this networking into LC_API

#

shouldn't you just make it its own separate mod

#

at this point LC_API is becoming a behemoth

#

and not all developers are gonna fix their mods, even with a 2 month warning some folks are just done with them

jagged trout
# swift halo at this point LC_API is becoming a behemoth

The point of it is to be a central point for mods so they need to rarely interact with the base game making them not need to update their mods when the base game updates because if they just use LCAPI, when it updates their mods will just work

jagged trout
#

if they need to they can download a specific version for it

swift halo
#

putting that extra work on the players is not great

#

most players are not competent enough to figure that out anyway

jagged trout
#

if they can't figure this out then idk

swift halo
#

then that means any mods using the newer networking wont work...?

jagged trout
#

wym?

swift halo
#

why not segment it like the RoR2 modding community did, like LC_API_Networking LC_API_Events etc

#

as separate mods

jagged trout
#

Well that's also a breaking change

#

and I even mentioned that

swift halo
#

fair

jagged trout
#

Barring splitting the project's client and server sided parts, which would take massive refactoring and break every mod using the api right now, I don't see another option for the longevity of the project

#

but at some point radical changes will be necessary, and sooner is more preferrable ยฏ_(ใƒ„)_/ยฏ

swift halo
#

yeah :/

#

its just a bad situation ig

#

gl

#

does it make sense to leave LC_API in the state its currently in and build a new one from the ground up with a better foundation?

main minnow
main minnow
#

there's just a load of people who think 'lc_api, ew'

#

and then a load more who immediately switch back to v2 because that's what their bloody clientside mods needed

swift halo
#

Page not found ๐Ÿ˜ฎ

main minnow
#

i don't get why

main minnow
#

it's back!

swift halo
#

Very cool

main minnow
swift halo
#

sure

main minnow
#

๐Ÿ˜‚๐Ÿ˜‚

#

I remade the whole thing as an SVG

swift halo
#

Lol what why

main minnow
#

Because the logo on their website was a pretty low res PNG

#

and scaling it down even further to 256x256 was going to introduce even more artifacts

#

Remaking it as an SVG and then exporting that is the best way to ensure that the png is as high quality as possible

wintry cosmos
#

If something isn't working on the new game update is that something that should be reported here or #1174678494417010718

jagged trout
#

Preferrably the github

#

here is fine

#

if you use #1174678494417010718 @ me

#

because I don't check that channel

wintry cosmos
#

Well the only real thing I want to mention (because it's the only thing that broke my mod) is Features.Player.Get().Position throws an error now every time I run it. Im not on rn to get a screenshot of the log but iirc it was trying to access a base game rpc method for syncing the location but couldn't find the method (maybe the update renamed or removed it)

#

I'll get a screenshot when I can

#

So MissingMethodException of PlayerControllerB.UpdatePlayerPositionServerRpc()

jagged trout
#

oh nice

#

nah no way bro

#

lmao

wintry cosmos
#

What lol

jagged trout
#

He added another param that just makes the other one useless rather than just renaming it

wintry cosmos
#

A very zeekers thing to do

#

Well hopefully that means it's a simple fix

jagged trout
#

it should be

#

it's v47 right?

#

yes, it is

wintry cosmos
#

I'm on v49

jagged trout
#

what

#

oh dev branch?

#

the update yesterday is v47

wintry cosmos
#

Uh nope, there were two patches after v48 and v49 for some fixes

main minnow
#

No

#

@jagged trout

#

Zeekers released 4 versions yesterday/today

#

v47, v47.0.1, v48, v49

#

We are now on v49

jagged trout
#

still builds on 49

main minnow
#

Ye not much changed from 47-> 49

#

mostly just patch updates

jagged trout
#

also

#

uh

#

github actions don't build

#

because the repo with the deps is outdated

#

I'm not entirely sure how the build workflow gets the deps

#

so idk how to fix it

#

this thing

#

No overload for method 'UpdatePlayerPositionServerRpc' takes 5 arguments

#

odd

#

@main minnow able to update the package?

main minnow
#

ah i never triggered the workflow

jagged trout
#

idk the build doesn't work on github

#

because it says this doesn't have a 5 argument overload lol

main minnow
#

i'm triggering a workflow run now

#

v49.0.0-alpha.1 should be up in ab 15 mins

jagged trout
#

should just be able to re-run my actions?

#

oh wait the workflow directly targets v45

#

Could I make it always get latest?

#

@main minnow you know if that's possible?

main minnow
#

but I wouldn't recommend it

jagged trout
#

hm

#

I suppose for now I'll manually update it

#

Error: ENOENT: no such file or directory, scandir '/home/runner/.nuget/packages/lethalcompany.gamelibs.steam/49.0.0-alpha.1'

#

Ok I'm not sure why it doesn't work then tbh

#

49.0.0-alpha.1 is the version I put in

main minnow
#

I'll be phasing srtup-netcode-patcher out soon

#

so some of the bs will go away

jagged trout
#

oh ok

#

so there's

#

3 places I gotta update then, yeah?

#

build publish and csproj?

#

seems to

#

@wintry cosmos that should be out soon

#

whenever thunderstore decides to update

main minnow
#

Soon will only be csproj

#

due to all the work I've done on NetCode patcher

wintry cosmos
idle crane
#

im working on a mod that enables twitch chat to give players an item on command. seeing LC_API's Feature.Item.CreateAndGiveItem() method i figured that would do what i needed, but when an item is given to a player via that method, im running into weird inconsistent issues where players cant use the items they get, or even sometimes cannot change what item the have equipped. dropping the items and picking them back up seems to help but im assuming im doing something wrong that is causing the issues. does anyone have any ideas?

jagged trout
#

I'll have to look into it

#

sounds like I forgot to set the player as holding an item

idle crane
#

it might also be related to the recent update, cause i think it was working fine a few days ago.

jagged trout
#

potentially

idle crane
#

well if i can help in any way pls let me know

jagged trout
#

assuming like shovel?

#

I just tested shovel, seemed to work

idle crane
#

yea so i tested more and figured out how to replicate it

#

if you give yourself 2 shovels, so you get one put into your hands, and then the other one goes to slot 2, then switch to slot 2 and try to hit something, then you will be unable to change items or use the item held until you drop it and pick it back up

#

so the first shovel that spawns in your hand works fine, its the second that only breaks when you try to hit something with the shovel

jagged trout
#

I'll try it

idle crane
#

oh, something else that for some reason i didnt realize might be relevant until now, the player im giving the item to is a client, not the host. the CreateAndGiveItem call is happening on the host, but im also just realizing i didnt test it on the host player.

jagged trout
#

hm

#

that shouldn't make a difference since it calls the exact same stuff as it would on the host

past sedge
#

Hey! I'm using this for networking, and I have a suspicion there's been issues with it

Have you guys gotten reports of messages not being sent or messages not being received?

main minnow
#

we did but I thought they had been resolved

past sedge
#

Ah
Unfortunate
I'm not 100 percent sure, could be my problem
Currently making some temporary custom networking to see if it is
In the meantime, do you have maybe a rough estimate of how long it might take to fix if it's on your end?

main minnow
past sedge
#

:(

jagged trout
#

you'd have to give some code and reproduction steps

#

because our testing has always worked

idle crane
# jagged trout that shouldn't make a difference since it calls the exact same stuff as it would...

i did a little more testing, its effecting shovels but not flashlights. if the shovel spawns into your hands, then everything works. if it instead gets placed into any other inventory slot, everything is fine until you switch to that slot and try to swing the shovel. when you swing there is no audio clip on impact and it does not deal damage, it will also stop you from being able to swap inventory items until you drop it. each shovel thats spawned in an inventory slots that the player does not have currently selected is effected by it, though once its dropped, it can be picked back up and things work smoothly again. it happens both on clients and the host, though in my testing all give calls have been made on the host.

gleaming badge
#

I was also having issues with spawning items into player hand, but it was really inconsistent, some times it worked some times it didn't and it looked vary random.
At the end I noticed that sometime when hosting new lobby I'm getting this error and that's when giving items does not work.
I got that error at many different occasions, when hosting game on new file/on old, on first connect/on third, and i dont really know what course's it, but I hope this will somewhat help as .Start is private.

dense scarab
#

sorry if this is a dumb question, but how do i use the API for networking? The wiki page on the github is super confusing

jagged trout
jagged trout
idle crane
#

Awesome. Pls let me know if I can help

jagged trout
#

lmao

#

it's because the shovel sets the player as 2 handed to prevent them from switching during the hit

#

but for some reason when it's added and not switched to, it never completes its hit

jagged trout
main minnow
jagged trout
main minnow
jagged trout
#

speaking of which. Barring any errors, this will be my last major/minor release to LC API

#

Any releases from this point on from me will only contain bug fixes.

rose carbon
jagged trout
#

oh fuck

#

I know why

rose carbon
#

thought someone would've already pinged you about it tbf noting people have known about it being LC_API for over an hour ๐Ÿ˜‚

jagged trout
#

nope

#

I even had it fixed

#

but I forgot to commit it

#

There was a github issue 1 hour ago that I didn't see

jagged trout
#

at least only 42k people downloaded the mod and only a fraction of that 40k will have played, and a fraction of that fraction will actually know what caused the issue

#

lmao

idle crane
last ridge
#

i'm having an error in 3.4.1 where dropped items all face the same direction no matter where the player faces. i thought that maybe it was another mod so i made an r2modman profile with only bepinex and lcapi installed and it still happens. i also tried clearing all the data in my LocalLow > ZeejerssRBKX > Lethal Comapny folder to see if it was some kinda thing getting saved there breaking it but i still get the problem. the only stuff i get in logs when i drop items is two lines that say

[Info :Lethal Company API] False
[Info :Lethal Company API] False

not sure if anyone else is getting this error or if its some freak thing on my machine, i couldn't really find anyone mentioning it when i searched and i also didn't know where to report this so im just putting it here cuz steven seems active here

main minnow
last ridge
#

just relaunched on vanilla and its not happening there

#

i also just tried uninstalling and reinstalling the game on steam to see if it was something there but it still happens

polar sand
urban remnant
#

Confirmed on my side too, only other people get to see the ladder properly, while the one putting the ladder is facing wrong

dense scarab
# jagged trout What are you trying to do?

I've mostly managed to figure it out on my own, however for some reason it doesn't send the message properly? I send a vector3 called "pos," which depends on some other stuff, so for example it could be (8.04, 0.24, -14.25) but then when the other client receives the message, it always comes back with (0,0,0)??

jagged trout
jagged trout
#

Interesting that it logs for you though

#

I'm not sure I have any logs left in the code like that one sec

dense scarab
jagged trout
#

I'll check it out

#

can you send me your code?

jagged trout
#

It's out

dense scarab
# jagged trout can you send me your code?

because of discord character limit I had to remove all the stuff I don't think is important for you to know to help me, but here's (I think) all the necessary code:

[BepInPlugin(PluginInfo.PLUGIN_GUID, PluginInfo.PLUGIN_NAME, PluginInfo.PLUGIN_VERSION)]
public class Plugin : BaseUnityPlugin
{
    private void Awake()
    {
        //plugin registering stuff
        Network.RegisterAll();
    }

    [HarmonyPatch(typeof(PlayerControllerB), "Update")]
    [HarmonyPostfix]
    static void Update(ref PlayerControllerB __instance)
    {
    //Code to determine if next block should run and to get the pos
                Debug.Log("Received pos should be "+ pos);
                Vector3S Spos = new Vector3S(pos.x, pos.y, pos.z);
                Network.Broadcast("LethalComFunnyMessage1", new ExampleClass() { pos = Spos });
    }

    [NetworkMessage("LethalComFunnyMessage1")]
    public static void ExampleHandler(ulong sender, ExampleClass message)
    {
        Debug.Log("Received position "+message.pos.vector3);
    }
}

public class ExampleClass
{
    [JsonIgnore]
    public Vector3S pos { get; set; }
}
jagged trout
#

you set it to json ignore...

#

it won't serialize it

dense scarab
#

๐Ÿคฆ I'm dumb

jagged trout
#

Also, you don't need to create a new Vector3S yourself

#

there's an implicit cast

#

new ExampleClass() { pos = pos } should work

#

assuming pos is a Vector3

last ridge
jagged trout
jagged trout
#

Alright since no game-breaking bugs have been reported in the last few days I'm going to be going through with the archival of my fork.

I've merged my fork back into the main repo if anyone wants to develop LC_API in the future, but I am currently working on other things and can no longer develop LC_API anymore.

gleaming badge
zinc dirge
#

Why if I have the HideModList installed, every time I enter the game, the LC API causes this question to be executed, causing the mods message on the right to appear for all of us every time a player enters the lobby?

jagged trout
#

HideModList probably never updated

#

idk though I didn't make it

zinc dirge
#

But this has been happening since some LC_API updates, I'm asking here in case you changed anything in the code regarding this.

I don't know if you know what notification I'm referring to, maybe it's HideModList's fault for not updating, I'm not sure.

jagged trout
zinc dirge
coarse trout
#

[Warning:Lethal Company API] Waiting to send network message. Waiting on host?: True Waiting on local player?: True
[Error :Lethal Company API] Dropping network message

#

any reason whythis happenning?

brisk steppe
#

I have installed Advanced Company today and there has error with LC_API.

[Info : Unity Log] Connection approval callback! Game version of client request: 49,76561198025358078
[Info : Unity Log] Joining client id: 1; Local/host client id: 0
[Info : Unity Log] Approved connection?: False. Connected players #: 1
[Info : Unity Log] Disapproval reason: Game version mismatch! Their version: 16489. Your version: 49
[Message:AdvancedCompany] OnClientDisconnect for 1
[Info : Unity Log] Disconnect callback called

strong crane
#

fake spotted

spice basalt
#

only mod that has a dependencie for this is player dog model and better death notes should i leave this on or? ive got 200 mods and im not sure if this should be on or not

#

@jagged trout