#plugins-dev-chat
1 messages Β· Page 77 of 1
do you Task.Run or _ = M().ConfigureAwait(false)
Task.Run to start the background task
uh
spyware edition?
LOL
why would you do that to yourself
no why would you want a counter
thank goodness it's not in PMER
like
you wanna know how successful you are
soonβ’

sneaky malware in the pocket
malware installed
now we need a lumma stealer
and thats it
I checked and the thread still reported as background
so idk what I did to make it work
reason #i-stopped-counting why I don't use Unity
XXXXDDDDDDDDDDDD
unless a client has a game on it
[ERROR] [LabApi] 'NullReferenceException' occured while invoking 'OnPlayerFlippedCoin' on 'Sex.Simulator.Handlers.PlayerHandler': 'Object reference not set to an instance of an object.', stack trace:
at UnityEngine.Bindings.ThrowHelper.ThrowNullReferenceException (System.Object obj) [0x00018] in <0deee1b9576d40a7a211b55014778fa6>:0
at UnityEngine.Component.get_transform () [0x00006] in <0deee1b9576d40a7a211b55014778fa6>:0
at LabApi.Features.Wrappers.Room.get_Transform () [0x00006] in <ed207da941d64f12942f0c5cc79632fc>:0
at LabApi.Features.Wrappers.Room.get_Position () [0x00000] in <ed207da941d64f12942f0c5cc79632fc>:0
fix null room is hard?
I want to run an event that "overrides" the effects of painkillers
Dawg
Can we talk
For a hot second
You'll lose brain cells
what wrong?
just a note that you're not allowed to display any kind of NSFW
Just check if the room is null or destroyed first
on servers
freaky plugin
its just a name of the plugin < 3
+1 before it gets buried
it's not hard
null room doesnt must exists
i was just saying
You'll need to patch into whatever painkillers do
how does this even happen
did you seriously expect another answer in SL
nw moment
is there not event ?
:(
patched that list like, ages ago
right
old out of use rooms, ragdolls, lockers and stuff are brought back into .List from some sort of call
idk
sexsimulator namespace are we so fr right now
why not
the one for being able to cancel the effects
Consumable::ActivateEffects
of painkillers etc
i'm gonna make a blocklist for these gifs on my end
i just cancel finish using item on exiled and then delete the item

its like
UsingItemCompleted or smth
its not a great name
yeah thats the event i use
i cancel it and delete the item
ServerOnUsingCompleted
otherwis epatch this
but you're better off patching ActivateEffets
they changed the exiled event name?
yea

i hate those attributes on the publicized assembly
why
would you clutter it
Already built the patch 
I was looking at it before I asked
its bepinex telling you how the intended is
Generator::OnRemove calls Room::Get()
yea well
what
theres a lot of things
NW's amazing habit of creating stuff in a Get method
does the generator not store
that arent meant to be saved
exiled does this too 
in certain places
AudioPlayerApi with CreateOrGet that can return null 
or only GetOrCreate
cuz Get returning null on an object that should exist 
in this scenario it probably shouldn't
TryGet
Get
GetOrCreate
nope, it gets it from base type
what if labapi cleared all wrappers when the facility is unloaded, like NWAPI did
should be done when obj is deleted
tf is this code
or like destroyed
it does delete it
but clear it to be sure
Base.ParentRoom == null || Base.ParentRoom.destroyCancellationToken.IsCancellationRequested
gotta love unity object lifetimes
before we had cancellation tokens
you had to hand-roll your own IsDestroyed property that you set in OnDestroy()
lovely
trolled
hated having to do same-frame operations when destroying objects
"remove this component, then add another one of the same type"
*calls getcomponent in one of the consuming methods*
result: the removed component

hi chat
hi
hi different profile picture
hi mr cache your transform
yes, please do
wait it should be
hi mr cache your transform and don't call it 3 times to save 5 milliseconds
admintoy performance is shit mostly because of the lack of transform caching
5 milliseconds
is a lot
but Hubert's fixed it :3
did he?
yes
he streamed it
im having pain working on same frame shit
you weren't there
check cancellation tokens
i was working on my demo project and i think it causes two items of the same itemtype and same serial to spawn
its actual dogshit
what
i had the same issue
it was funny
guns shooting
with same id etc...
wait maybe im right, i dont know, ill have to add loggers for the specific serials
but anyways making item stuff is harder than i thought
NREs without explanation fucking plaguing everything
oh my god i think i know why actually, maybe Items are null when in Pickup form? I hope not but maybe it is... idk fuck
is it even worth simulating the entire item ecosystem
huh
it didnt will help
its already that
but gameobject doesnt exist
and call .Position - null error
that doesn't help
you're checking for the wrapper reference
room.IsDestroyed
that's what you need to do
typical nw moment
no?
Room.List doesnt must contains object with null gameobject
"r is not null"
is always false
r.Base != null
is not
because of some bullshit happening
like, Room.Get being called when removing generators
at that point they should've used TryGet
ye, that works
imagine
if wrappers cached the destroyCancellationToken
and used that to determine whether the object is destroyed
the nanoseconds we would save are impeccable
The issue is that it's super easy to create stuff by accident
It's like the data stores
If you try to get a player's data store in the wrong place, it'll have a data store when it comes back
granted that one is mostly our fault - we did it in pre-destroy
r => r is {IsDestroyed: false}
@random scaffold
how would the wrapper itself be null though
nw moment
looks clearly than r?.IsDestroyed ?? false
that's how
what
the actual
okay
had me in the first half
yeah
it checks if its of that type
like a
if (obj is RealThing real & real.Thing)
day 0 of eve and paws going without an argument
i dont like u
i KNOW
IM NOT DUMB!!!!!!!!
I KNEW WHAT IS DOES
AND I KNEW WHAT THAT DID I JUST DIDNT KNOW IT DID A NULL CHECK GRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR
u suck
yes
working with null is painful asl
Nooooooooooooooo
dont die
David i have a strange question
why tf the server is 60/30 when i set tickrate
to 30
what
i don't think this is normal lol
it was me
And btw i wanna ask how can i remove the falling at all that the player never falls and like had that falling animation because i tried to patch FpcMotor::OnMove im making a custom role that has the gravity and so it looks shit
But the server has a thing called is fallung
and so does client xd
what would -1 even do
And messing with fpcmitor makes everone like flying
Uncapped I guess
Bruh
No way i can do that
And make it look like its standing
In the sky
I doubt you can do that
So sad
Can I replace human model to capybara?
make the player scaled to 0
and then spawn a capybara that follows
ya
well if you scale player to 0 theyll see it weird
so you gotta fake scale to everyone that isnt the player ur changing to capybara
okay then uh
scale the player yourself
and send the FpcScaleMessage to everyone except the player
what eve said
p much
check how player.Scale does it
Interesting
new FpcScaleMessage(hub, Vector3.zero).SendToHubsConditionally(n => n != hub)
what happens if you sent it to the hub tho
yeah
and if u dont want player looking scale 0, just hiding their model from others then youd wanna not scale them locally
If i set the AmmoStored to a lower value that what the item spawns with usually and then equip it, the ""excess"" ammo gets put into my inventory? Am i doing something wrong?
Probably a side effect, check what AmmoStored's setter does
It probably assumes you removed the magazine or something
oh i guess it never gets set and when it is selected, the _defaultCapacity makes the stuff happen

It be a pain in the butt
how would i use this? Just alone in a line?
yes
:(
Are you referencing Assembly-CSharp.dll & LabAPI.dll in your plugin
I have no clue :3
Im using Visual Studio, where would i check :o
It has a Warning icon :c
I imagine i need to add LabAPI as an assembly reference? Hm, where do i get the dll from
i normally get issues on my refrences, but they always end up working
I can import firstpass just fine but normal assembly-csharp throws this
C:\Program Files (x86)\Steam\steamapps\common\SCP Secret Laboratory Dedicated Server\SCPSL_Data\Managed
guess i will try to update my visual studio? xd
i get issues on lots of them yet they compile fine. thought it was normal
damn
LabApi looks fine for me :o
But yeah it always built fine for me, i just have a problem with using FpcScaleMessage
still nothing
Verify game files
did
Publicize the assembly see if you can use that
what? .w.
Is something maybe from with my project settings? Target framework?
nothing looks off to me
sadly no clue how publicizing works/what it even really does/how its supposed to fix my issue so id rather not use it ,_,
i dont know what that means
It's Assembly-CSharp.dll but everything is public inside
The "issue" because those are being replaced by the publicized version and vs think it doesn't exist/can't load
You know C# (and many other languages) has accessors. Or idk what to call it.
Basically saying who can access those class, fields.
SL using many place private or internal this means outside of that dll / class cant access those, publicizing makes all of those public, so you can access unaccessable classes / fields / methods, etc.
you can also use reflection for 1 time things but itβs hell for multiple things lol
You just have to have the right mindset
I always publicize
preauth event?
Lemme check it out
Preauth
postauth 
Pre join
?
Never publicize
actually
you may not be banned
because you don't "break the assembly"
π€
try it and see 
We love magic byte
Me when things only available when publicize
Publicize is brainwashing. Reflection is truth
Also do you know whats funny
When you fake a role to someone and they achieve some points it goes to the original team

Funny af so that place you can see who is a faker
*forgets a parameter*
WHY CAN'T IT FIND THE METHOD
But
It only specifies Port
What about IP?
bruh
I have no idea what I'm doing lmao
you can only redirect to another port
Wha
imagine if you sent a player to an arbitrary server
you gotta use XProxy if you wanna have servers on different IPs
-# it's being rewritten btw
Interesting
I mean the servers have entirely separate ludohosting panels and shit but maybe they might have th same IP?
I'll uh
Look into it
Well they separate servers like that to have different CPU load restrictions and shit
They run them on different hardware
Afaik
NO WAY
i'd be surprised if they NATted the two machines
you're saved
Which one do you think is more populated lmao
800% cpu load wtf
that is a sane upper llimit
does someone know if i check a type can i check the I nterfaces it has?
Thank you :3
i think something like this
elements.Key.GetInterfaces().Contains(typeof(IGameplayUI))
I can check like this too
typeof(IGameplayUI).IsAssignableFrom(elements.Key)
Yes actually ye
yes much simpler
I wonder something can i lower tps
if i load less hints in the screen
and just add them when needed and then destroy them for the player
Sum of cores usage xd
That's stupid af
Yes but stupid
I rather have individual core usage since that actually tells me something
Than just, yo you using 20% of all cores
Or whatever the value
Since Unity and therefore SL is single core app this doesn't really do anything as 200/800
If you like arbitrary number it should show an AVG of it
Me when I cant make a lvl 6, 8 , 10 kc
yes you can
Ye probably
i mean, you can have anything on the server
NO SYNC yep
You can sync it with the server and the desync wouldn't really matter with the client because it changes absolutely nothing for them
You'd have to be able to change the models to exceed the 0-3 scale in order for the clamping to matter
π
why OnPlayerUnlockingWarheadButton no CanOpen
but IsAllowed = true can open it
Lmao
did you just bold the inline code element
and italicize
||balls||
||balls||
||balls||
What does Scp1344Detected effect do?
||fortnite balls||
Is it possible to put 1344 on the player without highlighting enemies?
do you mean the wearable?
yeap
check WearableSync or something
i think you can
WearableSync.EnableWearables
use this
it will sync across everyone
and including the player
else you can manually do it
by taking a look how the method does
thx y'all
np
someone knows wtf Union does?
like i've seen this method and i was searching for something but someone said "Use union"
for a list?
what
I have 2 list and i was searching on how to sync them
in a hashset?
both of them are list
you have to use a hashset for that
union takes all values in both sets
or, well, read the docs
setA.UnionWith(setB) puts all values in B into A (if not yet added)
I need to sync them
wdym "sync them"
I have a list of Observers for a primitive
and i want to ensure that if spawned by a schematic they work fine
with both hashset
what exactly do you wanna do with the sets
Update
No because i still wanna keep the values from ManualPlayers
setA = [a,b,c]
setB = [c,d,e]
setA.UnionWith(setB)
then setA = [a,b,c,d,e]
this should help what an Union please
meth 
420-J
Leave that to the NTF
the company is a week saying every day
oh well
the water pipe broke
wait the next day
FUCK YOU BUY A NEW ONE
I pay the fucking bills and you mfs don't give me water for a week in a 40Β° weather
like
sue their ahhs
i mean we cannot
their contract disallow that
and its the only provider of water here
tfym
you don't have access to a public service
so you get fucked
how can that even be in a contract
its a private company but has pratically everything
"we are not liable for any damages"
Ask italy
its so fucking ass
im dying
it doesn't count has monopoly because they exist other companies but they are so small and need to buy from them
and in the other regions it doesn't exist so its local
i know
i knowing
Hi! I want to play the ElevatorSound in a SpeakerToy and my question is that is it possible to use the sound which is already loaded in the game?
Thanks!
np
The full sound volume is very low and it's playing it slowly bruh~5
Yeah I did that
ffmpeg -i ElevatorDoorClose.ogg -ac 1 -ar 48000 ElevatorDoorCloseMono.ogg
if you wanna add volume, -af="volume=+6dB"
it's pretty loud on my end, probably -3dB in game cause of the clientside speakertoy bug
at that point you can change the volume of the audio player
no?
or amplify it yourself
This game is a living bug
Why hit me?
Accept it lol
hit the bug
If the game is a bug you want the game to disappear
yes
volume+40db
Volume+100db
I was originally wanted to write that
the system will duck it down for you
Duck me
In Audacity I put down the quality to 0 and now it's good π
bruh
AUDACITY MENTIONED
it's good but
if you learn ffmpeg, audacity will be obsolete for small conversions
by the type i open audacity, import the file, resample it, mix it down to mono and export it, i'd be done with the conversion with ffmpeg probably 3 or more times
haiii david :3
Haiiii
can we fix audio today :3333
huh
cassie panning left and right
Make a pan cake
the report doesn't go much into detail
Thats some game design decision tbh
but sometimes (e.g. opening doors right next to you) makes cassie be audible on the right side of your ear or left
Oh
idk how they managed to have cassie not be mono
perhaps a unity 6 thing
it's infuriating (might just be me)
I feel like looking into github issues more xd
I don't get it
Okay
Oh wait we already have item for that
So we getting micro stuff in labapi
Im gonna do this
https://github.com/northwood-studios/LabAPI/issues/196
Thats easy
Thanks
Set and get!
Also while you are at it
Events:
MicroHIDChangingState
MicroHIDOpeningDoor
MicroHIDOpenedDoor
MicroHIDOpeningDoor...?
Yes inside charging
One of the micro firing module
You mean that armory door to the micro?
No
π
Yes, i know, can you add an event there?
Ye, exiled have those
You can even subscribe to CycleController.OnPhaseChanged and have a labapi event fire with OnMicroHIDPhaseChanged or something
Would be need to have like
Player, MicroHIDItem, IsAllowed [For ..ing event]
How to determine if a player is looking at a certain item? I think somehow through Physics.Raycast
You can use VisionInformation
If you want other event ideas lmk
For example
JailbirdCharging
JailbirdCharged
JailbirdInspect (ing? /ed?)
Oh and events for 3114
And 127 for changign level and stuff , idk if has event, doesn't need to be labapi just a normal C# one is enough
What does target argument mean?
what ur checking if is in view
It has Vector3 type
yes because its the position ur checking if is in view
position
yea
thx y'all
So I have heard
A few days ago
That you might be able to change bullet inaccuracy / spread?
If you don't mind me asking, what might that generally look like?
Someone knows what this means?
[2025-07-22 11:32:14.745 +00:00] [STDOUT] Unknown message id: 16484 for connection: connection(0). This can happen if no handler was registered for this message.
[2025-07-22 11:32:14.745 +00:00] [STDOUT] NetworkServer: failed to unpack and invoke message. Disconnecting 0.
is bro coding in notepad
That's dope!
it was faster to open in notepad than in Rider
fair
So that way I an increase/decrease the existing shit rather than overriding
you might as well use an existing attachment
i mean
idk
Something you send isn't right
Strange im using the same method as always
what are you sending to the server πππ
at cyn
OH i was using List
instead of ReadyList
Check what would be that message id
so sad
What
a primitive

can we [Obsolete(error: true)] Player.List
Fr
Zero
?
Can I steal your idea about Client side primitives
inaccuracy is weird anyway, not sure why you couldn't just override the value
yes
I mean thats not the only thing i do
so pretty much the concept wouldn't work at all
client side primitives are just like for optimizing the server
but trust me there's alot behind
I can try atleast
Because I still want the attachments people put on to matter
Real
Like why use barrel attachments if they're just gonna get overrided anyways?
well
the uh
omg
The uh u uh
steam update
like trust me
5 months of work
to get in this state
like every day
and debugging alot
so
if i really wanted to i could make it happen
but i don't have a reason to
I honestly always will say it
you guys saw the fraction
of the code
Ye ik
that is a small section the backend of the editor is insane
I even forgot it
Lol
Not really care about the editor tbh
idk why you gotta do that magic with unity π
I ain't gonna start fucking unity
i would rather keep to the original workflow of
3D object -> cube
and have it be exported without all this magic meoweditorprimitive stuff
2D Object => texttoy
I didn't need to do all that bullshit with max ammo did I
I have alot going on
I could've just editted attachments
*UI -> Text - TextMeshPro
Am I wrong
Just use blender
Tell me I'm wrong
Export into obj
Because otherwise I'm going to completely rework it
Have fun loading into sl
blender ??? mer
you might be able to use attachment params for extra ammo
but magazine._defaultCapacity = maxAmmo;
Is to not make it
WHY DOES IT TAKE 3 SECONDS TO MINIMIZE UNITY
skill unity issue
Where is 1D?
in yo
yoyo
Yo does anyone have the custom info rejection code? I may have messed up my hex codes since previously allowed colors are now complaining on the client
uhhh
i forgot where it is
but 14.1 made it available for server
ok its in NicknameSync.ValidateCustomInfo(
I through after new CSG we can use any color
no
The client disagrees
I disagree with the client
client doesnt let you fake a nw badge
I get the restriction about that but like
They have a β
Just fail if has that unicode
The long awaited badge rework when?
1.12.2
I saw that my server is lagging a shit ton and i think the reason is PlayerValidatedVisibilityEventArgs because if i set npcs and everyone has Scp079 (not an FPCRole) server goes back to 60
how could i fix this
Visibility check is ran every tick for every player no?
So if you have something expensive yeah
public static void Visibility(PlayerValidatedVisibilityEventArgs ev)
{
if (ev.Player.IsDummy) return;
if(ATOHPlugin.Instance.isBirthday && ev.Player.GetRawUserId() == BirthdayId)
{
ev.IsVisible = false;
return;
}
Tower tower = ev.Player.GetCurrentTower();
Hubs hubs = ev.Player.GetCurrentHub();
if (tower != null && tower.Players.Contains(ev.Target))
{
ev.IsVisible = true;
return;
}
if(hubs != null && hubs.Players.Contains(ev.Target))
{
ev.IsVisible = true;
return;
}
ev.IsVisible = false;
}
public static Tower GetCurrentTower(this Player player)
{
var currentHub = Tower.Towers.FirstOrDefault(x => x.Value.Players.Contains(player));
return currentHub.Value;
}
This is both the same
No im checking if the tagert
Can you switch towers?
Yes
I think best could be a dictionary?
for EACH player
No
The best would be assigning a Tower ID to every player and checking that
and also hub
Like how?
if i just add the player to a dictionary with that
that should be the same
Because 100% a player is in a hub or a tower
public static void Visibility(PlayerValidatedVisibilityEventArgs ev)
{
if (ev.Player.IsDummy) return;
if(ATOHPlugin.Instance.isBirthday && ev.Player.GetRawUserId() == BirthdayId)
{
ev.IsVisible = false;
return;
}
UUID towerId = ev.Player.GetCurrentTowerID();
UUID hubs = ev.Player.GetCurrentHubID();
if (tower != null && towerId == ev.Target.GetCurrentTowerID())
{
ev.IsVisible = true;
return;
}
if(hubs != null && hubs == ev.Target.GetCurrentHubID())
{
ev.IsVisible = true;
return;
}
ev.IsVisible = false;
}
From 4 loops to 0
and then you add logic for storing the IDs in the player
I can do that
everytime you join a tower
it just adds it to a dictionary
and it checks that in GetCurrentTower
Why dictionary?
its not unique for each player
But the tower itself is
its 1 for everyone
obv it is
so you know which player is in which tower
but like how do i get the id??
Im confused
At cyn
Thats the same thing
im saying lol
i save it in a dictionary<Player, Tower> and then modify GetCurrentHub/Tower to use that
class CustomPlayer : CustomDataStore<CustomerPlayer> {
public UUID towerId = UUID.empty;
public UUID hubId = UUID.empty;
public void MoveToTower(UUID towerId) {
this.towerId = towerId;
//hub.Move = new Vector3(...)
}
}
I have already a datastore
ok i didn't think about this
Thats the point of the DataStore
internal sealed class DisplayDataStore(Player player) : CustomDataStore(player)
currently mine
I mean if it is DisplayDatastore idk if it is a good idea to mix-match features
im renaming it so
PlayerDataStore
public static Tower GetCurrentTower(this Player player)
{
DataStorePlayer store = player.GetDataStore<DataStorePlayer>();
if (store.IdentifierTower == string.Empty)
return null;
return Tower.Towers[store.IdentifierTower];
}
i think at this state should be far better
are you making a tower defence game
no
its the project that one with a massive amount of primitives
same stuff im doing for the past year
lol
When
string.IsNullOrEmpty
Not sure why people use string.Empty anyway
stylecop says use string.Empty instead of ""
Max/Current 
"there difference between String.Empty and ββ are pretty small, but there is a difference. ββ actually creates an object, it will likely be pulled out of the string intern pool, but stillβ¦ while String.Empty creates no objectβ¦ so if you are really looking for ultimately in memory efficiency, I suggest String.Empty."
Strings are interned
41 npcs, 1 player
There is no difference other than personal preference
Oh. That is just the dummy code being shit no?
idk
if i set them spectator
pretty sure server is shitting itself after 20 dummies
Of course, personally, seeing String.Empty is nicer to search back in the project instead of looking for ""
Of course, cause there is no player processing in spectator
if they are alive, they get the same processing time as other players
might even be worse
with 19 its 57
Do you actually plan to have 42 players though
Did you do what Cyn did, relative position caching
No?
i've never done it
Then do that
because i couldn't figure it out
That's the biggest bottleneck
how to do it
i saw the code of those fucking Relative Position
and couldn't understand jack shit
I spawned 36 dummies, the performance is abysmal
and i think ced did something
here cedmod does something
and then clears it
oh wait
its not even caching
lol
yea but where tf its this writer in the thousands used for the relative position
yes
its like 2 months
i had better things to remember lol
in case it works
im publishing as a separate plugin for everyone
You said you were joking smh
Could've been serious
Also do you use cedmod
Then you're cooked af
Better unpatch it
you are always in the bus crazy
Gonna kill android
lol
I'm also in the train at times
Cedmod is broken for us
Lmfao
Had to disable
About this
i don't think you can do it
because if you wanna leave the code with the same logic you can't
because of this
Patch
Then patch it
This one has already a cache
or am i crazy?
It's per player per player
The position is still recalculated multiple times
Bruh
public static Dictionary<ReferenceHub, RelativePosition> Positions = [];
private static FpcSyncData GetNewSyncData(ReferenceHub receiver, ReferenceHub target, FirstPersonMovementModule fpmm, bool isInvisible)
{
var position = Positions.TryGetValue(target, out var existing) ? existing : new RelativePosition(target.transform.position);
FpcSyncData prevSyncData = FpcServerPositionDistributor.GetPrevSyncData(receiver, target);
FpcSyncData fpcSyncData = isInvisible ? default(FpcSyncData) : new FpcSyncData(prevSyncData, fpmm.SyncMovementState, fpmm.IsGrounded, position, fpmm.MouseLook);
FpcServerPositionDistributor.PreviouslySent[receiver.netId][target.netId] = fpcSyncData;
Positions[target] = position;
return fpcSyncData;
}
i think the method with proper caching should be like this
because thats the only section in the write you can optimize to not entirely redo the method
idk @upper vapor let me know what you think because my tiny brain its ok
and this is not patched by the big cedmod
and idk i think this could be correct?
yes because this lags the shit out of the server





