#LC_API
2372 messages ยท Page 3 of 3 (latest)
For what?
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
Every time I have used lc api it tells me I am on game versio 16845
Removed it
Never had an issue
With hosting or joining lobbies
Yeah that means a mod enabled modded only servers
it's not something LCAPI does by itself
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
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
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
Okay i see that now
But more company
For example
Does the exact same thing
As bigger lobby
But it doesn't use networking
I'm not sure what the comparison is
The other one most likely just requires it to set modded only
I'm not sure why they do that
I didn't create the mods
If u don't have to use it
you'd have to ask the creators
R u a developer for lc api or smth
I'm the current maintainer of LCAPI
That does not mean I control who uses it and for what reasons
Oh I see
Well good luck with it
Ooh
LC API doesn't have any custom sound stuff
You may be looking for LethalLib potentially?
Current unreleased changelog:
[Unreleased]
- Added
Player.DiedandPlayer.Hurtpast-tense events. - Added
Player.StartGrabbingItemandPlayer.GrabbingItemandPlayer.GrabbedItemevents. - Added new
Player.ShowTip(string header, string message, float duration, bool isWarning, bool useSave, string prefsKey)andPlayer.QueueTip(string header, string message, float duration, int priority, bool isWarning, bool useSave, string prefsKey)Player.ShowTipbypasses the new tip queue.- Base game tips (or mods that use the
HUDManager.DisplayTipmethod) 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 priorityparameter of theQueueTipmethod 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,
GameTipsclass has been deprecated, but will still work as expected.
- Fixed
Player.Usernamenot updating on the radar or escape menu. - Added
Player.PlayerObjectIdwhich returns the player's specified player object index in places likeallPlayerScripts.
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
not item pickup?
already in
btw @jagged trout if you want to use odin serializer for LC API
ah ideal
Added Player.StartGrabbingItem and Player.GrabbingItem and Player.GrabbedItem events.
oh okay!!! sorry, i skimread
I think I know how to do it
because I had to do a similar ish kind of thing to get NetcodePatcher to build in CI
I mean we could always just copy the files into the project lmao
yeah but that really sucks ๐คฃ
plus we have to rename all the namespaces
to avoid collisions
well the download tool renames them for you
you give it a root
and it does all the templating
okay that's not too bad then
but what was your idea?
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
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
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
nah idk about that
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
They r not poopy
they are
yeah I like that feature too
I'm saying they're shitty because they used LCAPI for the bundle loading feature
when they should have done it themselves
Maybe I misunderstood
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
no, you didn't, I just didn't explain
it's all good
Oh
they were just being lazy
So ur saying they stole the code?
no
Oooh
Lmao
Idk my only problem with lc api is that some random mods use them completely locking out entire players from public lobbies
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
And people don't realize lc api is not client side
So they restrain lobbies
Idk if that can be fixed
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
Wdym by break
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
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
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
But u can't tho to my knowledge. If I have lc api and the vanilla lobby doesn't then I get the 16845 error
16845 means a mod explicitly set you to modded only
again 16845 version will not be set automatically by LC API itself, a mod that uses LCAPI has to do that
Ah okay
That was me
Cause I want to be able to join vanilla servers lol
yeah it's understandable
that's More Company doing that
Ah I see
More Company checks for LC API being installed and sets the version number to 16845 if it is
I want that mod so badly but it so far doesn't look possible
Bruh
In theory it might be but it would be a lot of work ๐ without the vanilla requirement it's not bad because lcapi makes it pretty trivial
btw @jagged trout are there events for player enter/leaving the facility?
Ah
It would be so cool
not atm, but I'll put it on my todo list
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
no idea if this works post update btw, will need to test when not busy
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
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
And I can't support these mods forever
if they need to they can download a specific version for it
putting that extra work on the players is not great
most players are not competent enough to figure that out anyway
if they can't figure this out then idk
then that means any mods using the newer networking wont work...?
wym?
why not segment it like the RoR2 modding community did, like LC_API_Networking LC_API_Events etc
as separate mods
fair
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 ยฏ_(ใ)_/ยฏ
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?
the foundation is already good
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
ugh why is it v0
Page not found ๐ฎ
it's back!
Very cool
u wanna know which bit took the longest?
sure
the fucking logo
๐๐
I remade the whole thing as an SVG
Lol what why
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
If something isn't working on the new game update is that something that should be reported here or #1174678494417010718
Preferrably the github
here is fine
if you use #1174678494417010718 @ me
because I don't check that channel
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()
What lol
He added another param that just makes the other one useless rather than just renaming it
I'm on v49
Uh nope, there were two patches after v48 and v49 for some fixes
No
@jagged trout
Zeekers released 4 versions yesterday/today
v47, v47.0.1, v48, v49
We are now on v49
still builds on 49
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?
48??
ah i never triggered the workflow
idk the build doesn't work on github
because it says this doesn't have a 5 argument overload lol
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?
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
cos you didn't change the dep ver in the csproj
I'll be phasing srtup-netcode-patcher out soon
so some of the bs will go away
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
Yes
Soon will only be csproj
due to all the work I've done on NetCode patcher
You are a king, thank you!
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?
I'll have to look into it
sounds like I forgot to set the player as holding an item
it might also be related to the recent update, cause i think it was working fine a few days ago.
potentially
well if i can help in any way pls let me know
Could you tell me which items it was broken for?
assuming like shovel?
I just tested shovel, seemed to work
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
I'll try it
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.
hm
that shouldn't make a difference since it calls the exact same stuff as it would on the host
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?
we did but I thought they had been resolved
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?

:(
you'd have to give some code and reproduction steps
because our testing has always worked
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.
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.
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
I've seen this issue before thought I had fixed it
I'll try it out
What are you trying to do?
alright I've confirmed that I can reproduce this issue, I will see what is going on
Awesome. Pls let me know if I can help
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
Should be fixed in 3.4.0
along with this
and also in The Thing?
yes I fixed it there first

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.
apparently people arent taking damage on the latest LC_API version btw
thought someone would've already pinged you about it tbf noting people have known about it being LC_API for over an hour ๐
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
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
i just tested 3.4.1 and its working great. thank you so much for the fix!
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
Could you check to see if it also happens in vanilla?
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
I can confirm the same happening to me, even when setting an extension ladder it'll re-orient itself to face the same direction every time, be it in the ship or outside
Confirmed on my side too, only other people get to see the ladder properly, while the one putting the ladder is facing wrong
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)??
A vector3 cannot be serialized directly, you need to use Vector3S as defined here: https://github.com/steven4547466/LC-API/wiki/Networking#unity-types
Gonna look into it
Interesting that it logs for you though
I'm not sure I have any logs left in the code like that one sec
ok my bad I didn't see that, but even after converting to a Vector3S it still always returns (0,0,0)
Gonna have a new version out shortly
It's out
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; }
}
๐คฆ I'm dumb
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
can confirm that it works thanks so much for the quick patch
thanks for the report
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.
Thank you for your hard work
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?
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.
We'll hide mod list was a third party mod that changed LCAPI, and LCAPI updated to change the way messages are sent and how that mod list shows. You'd have to contact the dev of that mod to get them to update since mods typically don't support third party edits like that and it's up to the editor to update when something changes
Thanks for answering, I will try to contact him or make a request to see if there is a programmer who can help with this. Thank you :)
[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?
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
<@&1184851104568201276> https://thunderstore.io/c/lethal-company/p/Skelyman/LC_API/
fake spotted