#plugins-dev-chat

1 messages Β· Page 77 of 1

grand flower
#

Don't await anything on the main thread and you're good

upper vapor
#

do you Task.Run or _ = M().ConfigureAwait(false)

grand flower
#

Task.Run to start the background task

upper vapor
#

uh

celest thorn
#

spyware edition?

upper vapor
#

WTF

#

1800 seconds

celest thorn
#

LOL

upper vapor
#

why would you do that to yourself

celest thorn
#

no why would you want a counter

upper vapor
#

thank goodness it's not in PMER

celest thorn
#

like

upper vapor
#

you wanna know how successful you are

celest thorn
upper vapor
untold raft
#

sneaky malware in the pocket

celest thorn
#

now we need a lumma stealer

#

and thats it

grand flower
#

so idk what I did to make it work

upper vapor
#

magic

#

killing unity

grand flower
#

reason #i-stopped-counting why I don't use Unity

upper vapor
#

XXXXDDDDDDDDDDDD

grand flower
#

unless a client has a game on it

slate flume
#

Okay

#

Is there a way to like

#

Cancel the effects of an item a player uses

random scaffold
#

[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?

slate flume
slate flume
#

Can we talk

#

For a hot second

grand flower
#

You'll lose brain cells

slate flume
random scaffold
#

what wrong?

upper vapor
#

just a note that you're not allowed to display any kind of NSFW

grand flower
#

Just check if the room is null or destroyed first

upper vapor
#

on servers

slender lynx
#

freaky plugin

random scaffold
slate flume
grand flower
#

it's not hard

random scaffold
upper vapor
grand flower
#

You'll need to patch into whatever painkillers do

slate flume
#

Die

upper vapor
grand flower
#

did you seriously expect another answer in SL

grand flower
hearty shard
slate flume
#

:(

grand flower
#

patched that list like, ages ago

grand flower
#

not ideal

random scaffold
hearty shard
#

idk

teal junco
#

sexsimulator namespace are we so fr right now

random scaffold
#

why not

hearty shard
#

ig only exiled has that event

teal junco
#

wait only exiled has that event

#

wait what event

hearty shard
#

the one for being able to cancel the effects

upper vapor
random scaffold
#

very long time taken to find gif

#

bruh

hearty shard
#

of painkillers etc

teal junco
#

oh okay

#

i didnt even know that was an event

upper vapor
#

i'm gonna make a blocklist for these gifs on my end

teal junco
#

i just cancel finish using item on exiled and then delete the item

hearty shard
#

its like

#

UsingItemCompleted or smth

#

its not a great name

teal junco
teal junco
#

i cancel it and delete the item

upper vapor
hearty shard
#

otherwis epatch this

upper vapor
#

but you're better off patching ActivateEffets

hearty shard
upper vapor
#

yea

upper vapor
#

i looked at base game xd

hearty shard
upper vapor
#

why

#

would you clutter it

slate flume
#

I was looking at it before I asked

hearty shard
#

its bepinex telling you how the intended is

slate flume
#

I was just hoping it would be bet ter

#

Because fuck this

upper vapor
#

kek

terse bone
hearty shard
#

id like it kept

hearty shard
upper vapor
hearty shard
#

theres a lot of things

grand flower
upper vapor
#

does the generator not store

hearty shard
#

that arent meant to be saved

hearty shard
hearty shard
#

in certain places

grand flower
#

That's just stupid

#

Make a Get method, and a GetOrCreate method

upper vapor
hearty shard
upper vapor
#

why

hearty shard
#

cuz Get returning null on an object that should exist kek

grand flower
#

in this scenario it probably shouldn't

hearty shard
#

well no

#

but thats an issue with .Get() being used to remove smth

upper vapor
#

TryGet
Get
GetOrCreate

hearty shard
#

which idk why it would

terse bone
upper vapor
#

what if labapi cleared all wrappers when the facility is unloaded, like NWAPI did

hearty shard
#

should be done when obj is deleted

upper vapor
#

tf is this code

hearty shard
#

or like destroyed

upper vapor
#

but clear it to be sure

upper vapor
#

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

hearty shard
#

trolled

upper vapor
#

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

true cedar
#

hi chat

celest thorn
#

hi

upper vapor
#

hi different profile picture

celest thorn
upper vapor
#

yes, please do

celest thorn
#

wait it should be

#

hi mr cache your transform and don't call it 3 times to save 5 milliseconds

upper vapor
#

admintoy performance is shit mostly because of the lack of transform caching

hearty shard
#

did he?

celest thorn
upper vapor
#

he streamed it

teal junco
celest thorn
#

you weren't there

upper vapor
teal junco
#

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

upper vapor
#

what

teal junco
#

no im wrong

#

its fucky for some other reason i dont know

celest thorn
#

it was funny

#

guns shooting

#

with same id etc...

teal junco
#

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

upper vapor
#

huh

random scaffold
#

its already that

#

but gameobject doesnt exist

#

and call .Position - null error

upper vapor
#

you're checking for the wrapper reference

#

room.IsDestroyed

#

that's what you need to do

random scaffold
#

typical nw moment

upper vapor
#

more like... basic C#

#

and unity

random scaffold
#

Room.List doesnt must contains object with null gameobject

upper vapor
#

"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

slate flume
#

Room.List.Where(x=>x.Base)

#

?

upper vapor
#

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

grand flower
#

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

true cedar
#

why

#

why not just

#

!r.IsDestroyed

grand flower
#

Would probably also work

#

I just null check when I can in this scenario

true cedar
#

oh

#

thats kinda smart i didnt realize that null checked

upper vapor
#

how would the wrapper itself be null though

grand flower
#

nw moment

true cedar
#

looks clearly than r?.IsDestroyed ?? false

grand flower
#

that's how

upper vapor
#

the actual

#

okay

#

had me in the first half

hearty shard
#

it checks if its of that type

true cedar
#

fuck you

#

shut up eve!!

hearty shard
#

like a

if (obj is RealThing real & real.Thing)

upper vapor
#

day 0 of eve and paws going without an argument

hearty shard
true cedar
#

IM NOT DUMB!!!!!!!!

hearty shard
#

yeah but

#

u didnt!

true cedar
#

I KNEW WHAT IS DOES

#

AND I KNEW WHAT THAT DID I JUST DIDNT KNOW IT DID A NULL CHECK GRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR

hearty shard
#

u suck

upper vapor
#

"if null is Something"

hearty shard
#

yes

teal junco
#

working with null is painful asl

unique crane
#

if(null is null nullObj)

unique crane
#

dont die

celest thorn
#

why tf the server is 60/30 when i set tickrate

#

to 30

unique crane
#

what

slender lynx
celest thorn
#

but the server is doing over

unique crane
#

uuuuuuuuuuuuuuuuuuuuuh

#

Ill see

celest thorn
#

i don't think this is normal lol

unique crane
#

Hmmmmmmmmmmmmmmmm

hearty shard
#

it was me

celest thorn
# unique crane uuuuuuuuuuuuuuuuuuuuuh

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

unique crane
#

Thats client sided im sure

#

its anim

celest thorn
#

But the server has a thing called is fallung

unique crane
#

and so does client xd

hearty shard
celest thorn
#

And messing with fpcmitor makes everone like flying

unique crane
hearty shard
#

oh okay

#

interesting

celest thorn
#

No way i can do that

#

And make it look like its standing

#

In the sky

unique crane
#

I doubt you can do that

celest thorn
#

So sad

restive turret
#

F

#

cant have fun things

fresh jay
#

Can I replace human model to capybara?

hearty shard
#

and then spawn a capybara that follows

upper vapor
#

ya

fresh jay
fresh jay
#

0 scale

hearty shard
upper vapor
#

okay then uh

#

scale the player yourself

#

and send the FpcScaleMessage to everyone except the player

#

what eve said

hearty shard
#

p much

upper vapor
#

check how player.Scale does it

fresh jay
#

Interesting

unique crane
#

new FpcScaleMessage(hub, Vector3.zero).SendToHubsConditionally(n => n != hub)

celest thorn
#

what happens if you sent it to the hub tho

unique crane
#

Well then you get scaled locally

#

xd

hearty shard
#

yeah

#

and if u dont want player looking scale 0, just hiding their model from others then youd wanna not scale them locally

plain gazelle
#

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?

grand flower
#

Probably a side effect, check what AmmoStored's setter does

#

It probably assumes you removed the magazine or something

plain gazelle
#

oh i guess it never gets set and when it is selected, the _defaultCapacity makes the stuff happen

grand flower
#

It be a pain in the butt

plain gazelle
#

it was just missing a manual
magazineModule.ServerResyncData();

#

.w.

plain gazelle
grand flower
#

yes

plain gazelle
grand flower
#

missing a using?

#

see quick fixes

plain gazelle
#

nothing there

grand flower
#

Are you referencing Assembly-CSharp.dll & LabAPI.dll in your plugin

plain gazelle
#

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

grand flower
#

dedicated server

#

also seems like that dll has a problem

warped prairie
#

i normally get issues on my refrences, but they always end up working

plain gazelle
#

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

warped prairie
#

i get issues on lots of them yet they compile fine. thought it was normal

plain gazelle
#

damn

#

LabApi looks fine for me :o

#

But yeah it always built fine for me, i just have a problem with using FpcScaleMessage

warped prairie
#

yea very wierd idk.

#

FPC stuff way below my pay grade i have zero clue PepeLa

plain gazelle
grand flower
#

Verify game files

plain gazelle
#

did

grand flower
#

Publicize the assembly see if you can use that

plain gazelle
#

what? .w.

grand flower
plain gazelle
#

Is something maybe from with my project settings? Target framework?

grand flower
#

nothing looks off to me

plain gazelle
#

sadly no clue how publicizing works/what it even really does/how its supposed to fix my issue so id rather not use it ,_,

grand flower
#

Want me to dm you the publicized assembly

#

see if it works

plain gazelle
#

i dont know what that means

grand flower
#

It's Assembly-CSharp.dll but everything is public inside

restive turret
restive turret
icy knoll
#

you can also use reflection for 1 time things but it’s hell for multiple things lol

royal mica
restive turret
#

I always publicize

slate flume
#

I'm still trying to figure out how I can redirect incoming connettions

#

:/

upper vapor
#

preauth event?

slate flume
#

Lemme check it out

unique crane
#

Preauth

icy knoll
#

postauth TrollDespair

restive turret
#

Pre join

slate flume
royal mica
upper vapor
#

actually

#

you may not be banned

#

because you don't "break the assembly"

#

πŸ€“

upper vapor
restive turret
upper vapor
#

oh that's a labapi method

#

should work

#

β„’

restive turret
royal mica
restive turret
#

Also do you know whats funny

#

When you fake a role to someone and they achieve some points it goes to the original team

restive turret
#

Funny af so that place you can see who is a faker

upper vapor
slate flume
#

It only specifies Port

#

What about IP?

upper vapor
#

bruh

slate flume
#

I have no idea what I'm doing lmao

upper vapor
#

you can only redirect to another port

slate flume
#

Wha

upper vapor
#

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

slate flume
#

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

upper vapor
#

hope and pray

#

it's not very likely if you have two different (virtual) machines

slate flume
#

Well they separate servers like that to have different CPU load restrictions and shit

#

They run them on different hardware

#

Afaik

upper vapor
#

servers as in... ptero nodes or wh-

#

you're cooked

#

99%

slate flume
#

NO WAY

upper vapor
#

i'd be surprised if they NATted the two machines

slate flume
#

That's fucking huge

upper vapor
#

you're saved

slate flume
#

Which one do you think is more populated lmao

restive turret
#

800% cpu load wtf

royal mica
#

that is a sane upper llimit

restive turret
#

My cpu max is 100

#

Like what

celest thorn
#

does someone know if i check a type can i check the I nterfaces it has?

restive turret
#

Yes

#

type.Interfaces

#

Wait i have a code for it

celest thorn
#

Thank you :3

#

i think something like this

elements.Key.GetInterfaces().Contains(typeof(IGameplayUI))
restive turret
#

Nvm I used Weaving

#
            return true;```
#

Probably easier or smth

celest thorn
restive turret
#

Yes actually ye

celest thorn
#

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

unique crane
restive turret
unique crane
#

There literally is

#

200%/800%

restive turret
#

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

carmine prawn
#

stupid DoorPermissionFlags and KeycardLevels

restive turret
#

If you like arbitrary number it should show an AVG of it

restive turret
carmine prawn
#

yes you can

upper vapor
#

Mathf.Clamp:

#

oh

#

RIGHT

#

okay

#

let me guess, the client will clamp them

restive turret
#

Ye probably

upper vapor
#

i mean, you can have anything on the server

carmine prawn
#

NO SYNC yep

slate flume
#

You'd have to be able to change the models to exceed the 0-3 scale in order for the clamping to matter

carmine prawn
#

πŸ’€

#

why OnPlayerUnlockingWarheadButton no CanOpen

#

but IsAllowed = true can open it

restive turret
#

Β―_(ツ)_/Β―

#

Didn't you need to actually have a card for it?

carmine prawn
#

no card

#

just hand

#

πŸ’€

#

labapi moment

restive turret
#

Lmao

upper vapor
#

and italicize

carmine prawn
restive turret
#

||balls||

random scaffold
#

||balls||

slate flume
#

||balls||

vivid thorn
#

What does Scp1344Detected effect do?

upper vapor
#

it has a bit of an overlay and plays a sound cue when enabled

celest thorn
#

||fortnite balls||

vivid thorn
#

Is it possible to put 1344 on the player without highlighting enemies?

upper vapor
#

do you mean the wearable?

vivid thorn
#

yeap

upper vapor
#

check WearableSync or something

celest thorn
#

i think you can

celest thorn
#

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

vivid thorn
#

thx y'all

upper vapor
#

np

celest thorn
#

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?

upper vapor
#

what

celest thorn
#

I have 2 list and i was searching on how to sync them

upper vapor
#

unions as a concept means the value can be be a or b

#

do you mean set unions?

celest thorn
#

ManualPlayers.Union(SpawnedBy.PlayersLoaded)

#

like this

upper vapor
#

in a hashset?

celest thorn
#

both of them are list

celest thorn
#

like i've never seen it

#

thats why im asking

upper vapor
#

setA.UnionWith(setB) puts all values in B into A (if not yet added)

celest thorn
#

I need to sync them

upper vapor
#

wdym "sync them"

celest thorn
#

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

upper vapor
#

what exactly do you wanna do with the sets

celest thorn
#

Update

upper vapor
#

this?

celest thorn
upper vapor
#

zero...

#

have you pressed quick documentation on UnionWith

celest thorn
#

no?

upper vapor
#

setA = [a,b,c]
setB = [c,d,e]
setA.UnionWith(setB)
then setA = [a,b,c,d,e]

celest thorn
#

lol

#

ok sorry for being dumb

#

ig the same should be already self explanatory

upper vapor
#

you're doing finals, have you learned about set theory 😭

#

it's okay

royal mica
#

this should help what an Union please

upper vapor
#

basic math

#

yes

celest thorn
#

No i mean

#

i know the concept in math

#

idk

#

why my brain shut off

#

so

royal mica
#

meth Danki

celest thorn
#

Its hot asf in my room rn

#

without any water

upper vapor
celest thorn
upper vapor
celest thorn
#

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

upper vapor
#

sue their ahhs

celest thorn
#

i mean we cannot

#

their contract disallow that

#

and its the only provider of water here

upper vapor
#

tfym
you don't have access to a public service

celest thorn
#

so you get fucked

upper vapor
#

how can that even be in a contract

celest thorn
upper vapor
#

"we are not liable for any damages"

celest thorn
#

its so fucking ass

#

im dying

celest thorn
#

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

upper vapor
celest thorn
#

isn't don't die

#

lol

#

not dying

upper vapor
#

i know

celest thorn
#

i knowing

worn gull
#

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?

worn gull
#

Thanks!

upper vapor
#

np

worn gull
upper vapor
#

idk what format these are

#

you gotta convert them to 48000Hz mono

worn gull
#

Yeah I did that

upper vapor
#

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

celest thorn
#

This game is a living bug

upper vapor
#

hit the bug

celest thorn
#

If the game is a bug you want the game to disappear

upper vapor
#

yes

restive turret
celest thorn
restive turret
#

I was originally wanted to write that

upper vapor
#

the system will duck it down for you

restive turret
#

Duck me

celest thorn
#

;((((

#

So sad

worn gull
upper vapor
#

bruh

celest thorn
upper vapor
#

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

restive turret
#

I add a computer like effect to it

#

Like glados speaking effect

upper vapor
#

haiii david :3

unique crane
#

Haiiii

upper vapor
#

can we fix audio today :3333

unique crane
#

huh

upper vapor
#

cassie panning left and right

restive turret
#

Make a pan cake

upper vapor
#

?

upper vapor
#

the report doesn't go much into detail

unique crane
#

Thats some game design decision tbh

upper vapor
#

but sometimes (e.g. opening doors right next to you) makes cassie be audible on the right side of your ear or left

unique crane
#

Oh

upper vapor
#

idk how they managed to have cassie not be mono

#

perhaps a unity 6 thing

#

it's infuriating (might just be me)

unique crane
#

I feel like looking into github issues more xd

upper vapor
#

bruh

#

okay

#

can you send the audio mixer

#

(if you're allowed to)

restive turret
upper vapor
#

pan

#

🍰

restive turret
#

Uh

#

Sure ig

unique crane
#

Can micro be classified as firearm?

#

I guess

#

so I put it in correct folder

restive turret
#

It's a ExperimentalItem

#

Or whatever the category of it

unique crane
#

Okay its just ModularItem

#

Okay

restive turret
#

Okay

unique crane
#

Oh wait we already have item for that

restive turret
#

So we getting micro stuff in labapi

unique crane
#

Thats easy

restive turret
#

Thanks

#

Set and get!

#

Also while you are at it

#

Events:
MicroHIDChangingState
MicroHIDOpeningDoor
MicroHIDOpenedDoor

unique crane
#

MicroHIDOpeningDoor...?

restive turret
#

Yes inside charging

unique crane
#

What

#

I dont get it

restive turret
#

One of the micro firing module

unique crane
#

You mean that armory door to the micro?

restive turret
#

Has a thing that let you open the door

#

Wanna contol that

unique crane
#

Huh

#

That is some feature I dont know about

restive turret
#

If you charge the micro and fire it opens door

#

You didn't know that??

unique crane
#

No

restive turret
#

😭

unique crane
#

Oh there actually is

#

wtf

restive turret
#

Yes, i know, can you add an event there?

unique crane
#

People wanted micro events too, right?

#

I guess Ill make them then

restive turret
#

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]

vivid thorn
#

How to determine if a player is looking at a certain item? I think somehow through Physics.Raycast

restive turret
#

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

vivid thorn
hearty shard
vivid thorn
#

It has Vector3 type

hearty shard
upper vapor
#

position

hearty shard
#

yea

vivid thorn
#

thx y'all

slate flume
#

So I have heard

#

A few days ago

#

That you might be able to change bullet inaccuracy / spread?

upper vapor
#

through attachment parameters

#

the inaccuracy at least

slate flume
#

If you don't mind me asking, what might that generally look like?

upper vapor
#

and then set the parameter on any enabled attachment

celest thorn
#

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.

icy knoll
slate flume
upper vapor
slate flume
#

Can I add my own server attachment?

#

That is just inaccuracy?

slate flume
#

So that way I an increase/decrease the existing shit rather than overriding

upper vapor
#

i mean

#

idk

restive turret
celest thorn
upper vapor
#

at cyn

celest thorn
#

instead of ReadyList

restive turret
#

Check what would be that message id

celest thorn
#

so sad

restive turret
#

What

celest thorn
restive turret
upper vapor
celest thorn
restive turret
#

Zero

celest thorn
#

?

restive turret
#

Can I steal your idea about Client side primitives

upper vapor
celest thorn
#

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

restive turret
#

I can try atleast

slate flume
restive turret
#

Fake sending spawn, fake destroying

#

Or something idk

restive turret
slate flume
restive turret
#

*Fake

#

Udk

upper vapor
#

the uh

#

omg

restive turret
#

The uh u uh

upper vapor
#

steam update

celest thorn
#

like trust me

#

5 months of work

#

to get in this state

#

like every day

#

and debugging alot

#

so

upper vapor
restive turret
#

Eh I will just stay at my light manager shit

#

8ts broken af

celest thorn
#

you guys saw the fraction

#

of the code

restive turret
#

Ye ik

celest thorn
#

that is a small section the backend of the editor is insane

restive turret
#

I even forgot it

celest thorn
#

Lol

restive turret
upper vapor
restive turret
#

I ain't gonna start fucking unity

upper vapor
#

i would rather keep to the original workflow of

#

3D object -> cube

#

and have it be exported without all this magic meoweditorprimitive stuff

slate flume
#

WAIT

#

FUCK

#

😭

restive turret
slate flume
#

I didn't need to do all that bullshit with max ammo did I

celest thorn
#

I have alot going on

slate flume
#

I could've just editted attachments

celest thorn
#

im insane

#

thats why

upper vapor
restive turret
#

Just use blender

slate flume
#

Tell me I'm wrong

restive turret
#

Export into obj

slate flume
#

Because otherwise I'm going to completely rework it

restive turret
#

Have fun loading into sl

upper vapor
true cedar
#

blender ??? mer

upper vapor
celest thorn
#

best way to make schematics

#

by coding them

restive turret
upper vapor
restive turret
#

skill unity issue

grave eagle
restive turret
#

in yo

grave eagle
#

yoyo

tulip kiln
#

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

hearty shard
#

i forgot where it is

#

but 14.1 made it available for server

#

ok its in NicknameSync.ValidateCustomInfo(

tulip kiln
#

I see

#

Thanks <3

restive turret
tulip kiln
#

The client disagrees

restive turret
#

I disagree with the client

hearty shard
#

client doesnt let you fake a nw badge

restive turret
#

I get the restriction about that but like

#

They have a βœ“

#

Just fail if has that unicode

static meteor
#

The long awaited badge rework when?

restive turret
#

1.12.2

celest thorn
#

both in mc and SL

restive turret
#

Ah

#

1.23.4

celest thorn
#

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

hearty shard
#

remove the event

#

troll

royal mica
#

So if you have something expensive yeah

celest thorn
#

Im just checking 2 dictionaries

#

and if the taget is inside a list

#

lol

royal mica
#

I would say try to time it tbh

#

and see what causes the holdup

celest thorn
#
    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

royal mica
#

Wiat you are double checking

#

oh nvm

celest thorn
royal mica
#

Can you switch towers?

celest thorn
royal mica
#

cause this looks quite expensive to run

#

you are running 4 loops

celest thorn
#

I think best could be a dictionary?

royal mica
#

for EACH player

#

No

#

The best would be assigning a Tower ID to every player and checking that

#

and also hub

celest thorn
#

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

royal mica
#
    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

celest thorn
#

I can do that

#

everytime you join a tower

#

it just adds it to a dictionary

#

and it checks that in GetCurrentTower

royal mica
#

Why dictionary?

celest thorn
#

Player Key

#

Tower Value

royal mica
#

No, like why Dictionary

#

You have a unique Tower ID

celest thorn
#

its not unique for each player

royal mica
#

But the tower itself is

celest thorn
#

its 1 for everyone

celest thorn
royal mica
#

so you know which player is in which tower

celest thorn
#

but like how do i get the id??

royal mica
#

GetCurrentHubID()

#

You store it on the player when they join a twoer

celest thorn
#

Im confused

celest thorn
#

Thats the same thing

#

im saying lol

#

i save it in a dictionary<Player, Tower> and then modify GetCurrentHub/Tower to use that

royal mica
#
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(...)
  } 
}
celest thorn
#

I have already a datastore

royal mica
#

Then you can store the TowerId

#

no need for a dictionary

celest thorn
#

ok i didn't think about this

royal mica
#

Thats the point of the DataStore

celest thorn
#

currently mine

royal mica
#

I mean if it is DisplayDatastore idk if it is a good idea to mix-match features

upper vapor
#

PlayerDataStore

icy knoll
#

i use Data Stores for ruei displays too

#

in textchat.ruei

celest thorn
#
    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

icy knoll
#

are you making a tower defence game

celest thorn
#

its the project that one with a massive amount of primitives

#

same stuff im doing for the past year

#

lol

upper vapor
#

Not sure why people use string.Empty anyway

icy knoll
upper vapor
#

StyleCop my ass

#

2 chars vs...

#

Idk

celest thorn
#

nope

#

and i changed everything

upper vapor
celest thorn
modern lark
# upper vapor 2 chars vs...

"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."

celest thorn
#

41 npcs, 1 player

upper vapor
#

There is no difference other than personal preference

royal mica
celest thorn
#

if i set them spectator

royal mica
#

pretty sure server is shitting itself after 20 dummies

modern lark
celest thorn
#

it works

#

fine

royal mica
#

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

celest thorn
#

with 19 its 57

upper vapor
#

Do you actually plan to have 42 players though

celest thorn
#

idk

#

really idk

#

I could lie and tell you yes

upper vapor
celest thorn
#

i've never done it

upper vapor
#

Then do that

celest thorn
#

because i couldn't figure it out

upper vapor
#

That's the biggest bottleneck

celest thorn
#

how to do it

#

i saw the code of those fucking Relative Position

#

and couldn't understand jack shit

royal mica
#

I spawned 36 dummies, the performance is abysmal

celest thorn
#

and i think ced did something

upper vapor
celest thorn
#

here cedmod does something

#

and then clears it

#

oh wait

#

its not even caching

#

lol

upper vapor
#

Don't follow cedmod

#

It's confusing af

#

Read the messages I sent

celest thorn
upper vapor
#

You forgor

celest thorn
#

yes

#

its like 2 months

#

i had better things to remember lol

#

in case it works

#

im publishing as a separate plugin for everyone

upper vapor
#

.

#

Shouldve done that

celest thorn
#

i had finals

#

and other shit

upper vapor
#

You said you were joking smh

#

Could've been serious

#

Also do you use cedmod

#

Then you're cooked af

celest thorn
#

i know

#

i know

upper vapor
#

Better unpatch it

celest thorn
#

im cooked

#

if you wanna join

upper vapor
#

I'm on the bus currently

#

No earbuds

celest thorn
#

you are always in the bus crazy

upper vapor
#

Gonna kill android

celest thorn
#

lol

upper vapor
restive turret
upper vapor
restive turret
#

Had to disable

upper vapor
#

I wonder if plugin load priority does something at all

celest thorn
#

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

restive turret
#

Patch

celest thorn
#

but this one has already a cache

upper vapor
#

Then patch it

celest thorn
#

or am i crazy?

upper vapor
#

The position is still recalculated multiple times

celest thorn
#

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

restive turret
#

Patch cedmod

#

To dont patch it

celest thorn
#

cedmod doesn't patch it

#

thats the best

slate flume
#

Ohhh are you doing the

#

Fuckin

celest thorn
#

and idk i think this could be correct?

slate flume
#

Position distributor patch?

#

To cache the relative positions

celest thorn