#plugins-dev-chat

1 messages ยท Page 110 of 1

celest thorn
#

but nope

#

always 0

unique crane
#

or run it outside

#

and attach analyzer xd

celest thorn
#

which is 100% required

unique crane
#

Well then

#

unless the analyzer supports remote access

#

make your own

#

or connect to the db from outside

#

temporary

celest thorn
unique crane
#

Well then

#

wait

celest thorn
#

if i call GC

#

it doesn't work at ALL

#

so how would i debug something like that

unique crane
#

If you call GC and it doesnt go down

#

that means it either ignored you

#

or there is nothing to collect

#

yknow

#
  • how tf you have problem with dedicated server memory usage
#

that thing goes around 500MB

celest thorn
#

and im still trying to figure it out why

tepid sluice
#

doesnt it 1GB for each 1

#

huh

unique crane
#

4GB

#

๐Ÿ’€

#

Maybe its the 1 billion colliders you have on all of the towers

celest thorn
#

thats actually not stupid

#

lol

#

25k colliders?

#
  • 40 ig
#

ig that makes sense

unique crane
#

Unload few of them

#

and see

#

Perhaps load them on demand

#

If someone goes into a tower

celest thorn
unique crane
#

Recycle the colliders

celest thorn
#

destroying and loading them

unique crane
#

Dont create new ones

#

Its just a collider, you can set the position, rotation and scale

upper vapor
#

merge boxcolliders into meshcolliders

celest thorn
#

they already are required to be meshcolliders

unique crane
#

Yeah no shit they take up 4GB

celest thorn
#

because i need to take in account

#

colliders can move

celest thorn
#

Because its easier to do for shapes

upper vapor
#

why do you need every single collider to be a meshcollider

celest thorn
#

because thats how i made it in the past

upper vapor
#

you don't need a meshcollider for a cube

unique crane
#

Im sure that the tower walls doesnt need to be mesh colliders

#

and the rectangle platforms doesnt either

celest thorn
#

ok so how it works is i get a Mesh that is predone before

#

when the server boots

#

and then create a new gameobject under it

#

called GameObjectName-SyncCollision

#

from there i scale it

#

and then apply a mesh collider

#

with the mesh

upper vapor
#

did you know that you can use GameObject.CreatePrimitive

celest thorn
#

and?

upper vapor
#

oh wait that doesn't handle collisions exactly as SL primitives

celest thorn
#

yea

#

no shit sherlock

upper vapor
#

you should do this

celest thorn
#

unity?

upper vapor
#

primitiveobjectoy

celest thorn
#

fr?

#

crazy

#

yea i could do that

unique crane
#

Crazy

#

Our code is more optimized than yours

#

:3

celest thorn
#

and sl base can run 5k

upper vapor
celest thorn
#

:3

upper vapor
celest thorn
#

this is evolving

#

crazy

upper vapor
#

xddd

celest thorn
#

last time i checked 1 year ago 5k crashed my entire server

#

in 30s

unique crane
#

Skill issue

celest thorn
#

not mine

#

because same schematics run fine on Meow

#

meow

unique crane
#

"why does my server crash when I spawn 1 million networked game objects"

celest thorn
#

i don't still know how tf we came up with that name

unique crane
#

I wonder

celest thorn
#

but now half of our projects have meow

#

MeowDeubugger
MeowSSSS
MeowEditor

#

like all of our utilities share meow

#

lol

#

ngl need to find a new prefix

#

Because saying meow

#

makes me more near a furry

#

or a catgirl

unique crane
#

Cuz you are

celest thorn
unique crane
#

Sure..

celest thorn
#

i could accept catgirl (even tho im allergic to cats)

#

but furry no

unique crane
#

Friendly fire

celest thorn
#

now

unique crane
#

I do like myself

#

:3

celest thorn
#

i cannot say the other one

#

but tho i must say the coolest nw staff here in this channel is david

#

without david half of my stupid idea

#

wouldn't be possible

#

and axwabo

#

too

#

crazy enough

upper vapor
celest thorn
#

btw both of you forgot that sphere colliders exist

upper vapor
#

i know that they exist

celest thorn
#

forgot another one Capsule

celest thorn
#

or else death

#

i cannot stay even near chalk boards, every teacher hated me because i made them use the board with markers

hearty shard
#

oh em gee

#

ax!!

celest thorn
upper vapor
celest thorn
#

in sl

#

technically i can

hearty shard
#

okay in the head

celest thorn
hearty shard
#

i can tell

celest thorn
#

@unique crane @upper vapor Nothing changed

soft turtle
#

How to hide a primitive from a specific player?

hearty shard
celest thorn
celest thorn
soft turtle
celest thorn
soft turtle
celest thorn
soft turtle
soft turtle
tepid sluice
celest thorn
tepid sluice
#

lmao

celest thorn
#

I even reverted because they were causing more

celest thorn
unique crane
#

XDDDDDD

#

Yeah well

#

I would wait for maro to open up testing port to the db

#

and run it locally with memory analyzer

celest thorn
#

And i have a game theory

unique crane
#

Okay matpat

#

whats your theory

celest thorn
#

Because i use meow on other project this never happened only on atoh

#

Ig that some components might be heavy

ashen hound
celest thorn
ashen hound
#

bf6

celest thorn
#

And not peak old gaming

ashen hound
#

its still sl lol

celest thorn
#

Bo1 peak

#

We need the numbers in sl

celest thorn
unique crane
#

idk

#

Google it

celest thorn
#

All of them are for the editor ;(

#

What if i use the debugging?

#

I think i will use dotmemory

restive turret
celest thorn
#

That is true

restive turret
#

Would Use the unity 6 dll not the 2021 one

#

Idk how much stuff changed so

celest thorn
restive turret
#

Run bepin on server ClassDTroll1

celest thorn
#

That doesnโ€™t debug memory or just straight up help

restive turret
#

Object viewer or smth

#

That would help a little bit

celest thorn
#

But its on the server not on the client so i donโ€™t have ui

restive turret
#

Oh forgot

#

Ain't rider has some debug tool

#

Or is that dotmemory

celest thorn
#

Because debugger attacher for unity

#

Is only that

#

Dotmemory allows me to attach to the process

restive turret
#

Well why not run the server on your local pc?

restive turret
#

Y'know you can connect to it by "localhost"

celest thorn
#

But im waiting the princess to wake up

restive turret
#

And debug right away

celest thorn
#

And just down the firewall

#

Because i want to check with the data we have

#

Let me try and see

#

If everything works

upper vapor
#

i'm not sure if you can attach any .NET debugger to a running SL server process

celest thorn
#

but nothing

upper vapor
#

you can attach with LLDB
but that's c++

#

well

#

assembly

celest thorn
#

From there how tf do i know what it is

upper vapor
#

you don't

celest thorn
#

so how tf do i figure it out the memory problem

#

if i cannot know

upper vapor
celest thorn
#

this is crazy

upper vapor
#

yeah, client do be like that

celest thorn
upper vapor
celest thorn
#

what if i use this?

upper vapor
#

try it and see

celest thorn
#

nothing

upper vapor
#

no memory profiling for you then

celest thorn
#

because i tried standalone meow

#

and the maps load fine

#

without problems on memory

#

I think its the components

ashen hound
#

~~did someone mange to change font in tmp richtext?

upper vapor
#

nope

ashen hound
#

cant remember if font needs to be registered somewhere

restive turret
#

i think it had to be

upper vapor
#

the fonts should be added to the font atlas but they aren't

restive turret
#

i remember ax complained about it

celest thorn
restive turret
celest thorn
#

btw guys some cool story game i could play while waiting for the server to explode

celest thorn
#

he could sneak it

ashen hound
#

sneaking

restive turret
#

3259265 file changed

  • added fonts to avlb font list
celest thorn
restive turret
#

can be merged in middle of something ig

celest thorn
ashen hound
#

soo font tag is not working at all?

worthy rune
#

pretty sure its been that way since unity 6

ashen hound
#

left one is with tag, right default broadcast font

upper vapor
#

oh it's roboto

#

well

restive turret
#

roboting the mono

ashen hound
#

ahh yes

#

the only possible font xd

celest thorn
#

kill mono

ashen hound
#

because its in this folder

celest thorn
#

So why not move EVERY font there?

ashen hound
#

did someone make suggestion?

celest thorn
#

its called Fonts & Materials

celest thorn
celest thorn
#

ok now you can do it

#

you guys ask for it

#

and we give you the suggestion

#

but you guys made it so burrocratical bullshit

restive turret
#

create a suggestion for TextureToy

celest thorn
#

that would be useful

#

to texture primitives (using existing texture)

restive turret
#

or just enable changing to desired mesh in primit

celest thorn
#

real chairs

restive turret
#

??

celest thorn
#

game has a mesh for a chair

#

if they add that

#

we can use realistic chairs

#

wait

#

aren't rooms meshes?

restive turret
#

oh i meant material

celest thorn
#

thats why i started saying that

restive turret
#

ye i was like wtf this guy and how since it is just a material :D

south socket
#

i dont want a chair i want a table

celest thorn
#

i was waiting for this day

stuck peak
#

I remember seeing some bug report in Unity about it

ashen hound
#

Font needs to be registered while RobotoMono is in specific folder soo its using that one

stuck peak
#

yes I know that

#

but there was some font issue in general

frank flicker
#

dont suppose theres a way to give a human the 079 hud Hmm
(I havent even looked yet because I'm assuming the answer is no)

frank flicker
#

would be really cool to have when flying around as an invisible tutorial CatDerp

plain gazelle
#

From NetworkClient.prefabs
Chamber is probably the HCZ->LCZ/173 Chamber
Gates is probably the Gate A and B chamber
Nuke is probably the carriage for warhead silo

But what is the "Cargo" elevator?

#

When spawning the prefabs in they are only visible for a single frame before, presumably, teleporting to their group location or sth

restive turret
#

server room

plain gazelle
#

OHHHHHHHHH

#

Thank you

icy knoll
#

is there any way to make it possible for the client to solve a cryptography query before joining the server?

#

like during pre-auth

teal junco
#

How do I make a rigidbody follow waypoints it's encased in?

#

I have tried just using pickup parents before but it doesnt work for what I want specifically. though for most cases just having a pickup as a parent is good enough.

teal junco
slate flume
#

At least afaik

teal junco
#

also you mean if i add a pickup and make it a child of the object of the rigidbody?

slate flume
#

Generally, for large waypoint toys, there's no need to worry about updating player position inside of it because the waypoint toy automatically moves things encapsulated by it

#

But if you teleport the waypoint toy far enough away it won't take things with it

#

If you have something not properly moving with a waypoint toy, make it move with the waypoint toy
Either by adjusting its position or making it a child object of the waypoint toy

teal junco
#

so i should handle it myself

#

do you have an idea on how i can detect elevators and waypoint toys?

#

or at least what class it might use.

#

i will also check myself

slate flume
#

Same thing with elevators in the LabAPI wrapper

icy knoll
#

dw

teal junco
restive turret
#

๐Ÿ”ฅ

teal junco
#

i couldnt figure out how to reconcile joules to HP points since i havent taken physics yet so i just applied the joules as damage directly

#

if anyone knows a good formula for that it would be nice

icy knoll
teal junco
#

yeah i figured

icy knoll
#

as humans don't go by health points

#

lol

teal junco
#

its not as simple as

royal mica
#

technically you can use fall damage as a metric

teal junco
teal junco
#

well

#

idk

royal mica
#

you die if you fall enough

teal junco
#

but ive fallen from decent heights without taking damage

royal mica
#

and only get damaged is small enough

#

so I assume there is a curve for it

teal junco
#

oh okay

#

thats a good point

royal mica
#

I mean, SCPs get a % damage as well now

#

wait now you made me question if you get half damage

teal junco
royal mica
#

Yeah, you get a small damage

teal junco
#

but because of that i thought for a decent amount of time that fall damage was hard-coded using triggers

royal mica
#

I just used the chaos spawn stair to test

unique crane
#

No bruh

#

fall damage is based of Y velocity

restive turret
#

Ye system is complex af

glad pagoda
#

isn't the fall damage code 100% serverside so anyone can just check

restive turret
#

I would say a little bit complicated

unique crane
#

yea its server side

teal junco
slate flume
#

I took college calc and some intro physics classes, and taught myself vector calculus with a focus on engineering from some of my dad's old college textbooks so I might be able to help

#

I also made a physics engine in minecraft out of command blocks lol it was dope

#

But my point is generally in a video game outside of making a physics engine I don't really hear the need for people to be calculating joules, let alone to account for player damage

#

Rarely do I see joules calculated in a physics engine regardless

teal junco
#

okay thats fair

#

i just dont really know how else to calculate how much i should hurt a player using physics objects

slate flume
#

Ohhh interesting

teal junco
#

i take physics next year so i have zero experience with it right now

slate flume
#

So you're launching rigidbodies at players and you want to calculate damage

teal junco
#

after a quick google i found joules

slate flume
#

Generally the goal is to look for a calculation that allows you to get the amount of energy the object will impart on the player, and then make a damage curve for it and adjust it until it "feels right" essentially

unique crane
#

Just make curve based on speed * mass

#

easy

slate flume
#

Pretty much

#

I'm gonna assume you don't have the contact normal of the collision, so I recommend using the basic kinetic energy formula
mv^2/2
But also make sure you adjust for relative velocity
So it really should be
m*(ฮ”v)^2/2

#

After that it's really kind of a matter of tweaking until it feels right but you could get more into the weeds if you like

teal junco
#

i do have the contacts of the collision actually, i just dont know how to use it. they include the normals of the collision.

slate flume
#

Oh dope

unique crane
#

I dont think it matters if 500kg concrete barries hits your leg or arm XDDD

teal junco
#

i assume the contact normals can be used to more precisely calculate how much energy is imparted onto the player

#

but idk

unique crane
#

Average player will not notice that

teal junco
#

true

unique crane
#

you get hit => damage

#

thats the thinking

slate flume
#

My bad I got a call from my dad he's grilling me about some shit

teal junco
#

its fine i dont expect much from discord convos. as long as people respond eventually im happy xd

slate flume
#

Then multiply that by negative one

#

And you'll want to clamp it so it isn't less than 0

#

Then use that as the velocity in mv^2/2

#

You also might want to use the reduced mass

teal junco
#

reduced mass ?

slate flume
#

Idk if the game has a good estimate for player mass or how you get object mass, but the formula for reduced mass is the harmonic mean of the masses

#

Well sorta

#

It's 1/(1/(m1) + 1/(m2))

#

Or (m1)(m2)/(m1 + m2)

#

So it's really half the harmonic mean

#

So in this case it'd be player and object masses you're using

teal junco
#

okay, well if i assume a player is 70 kg, then it should be (70 * rb.mass) / (70 + rb.mass) and then i plug that in as mass when calculating joules

slate flume
#

Yep

#

Well that's if the RB mass is in KG

teal junco
#

and then i plug in this as velocity

teal junco
slate flume
teal junco
#

regardless of how it actually is treated

slate flume
#

I'd say for testing purposes give it a few tests to make sure everything comes out okay
I'm a little shaky on my physics but that looks correct

#

OH WAIT

#

When clamping velocity don't forget to multiply by -1

#

Don't multiply the velocity after the clamp, multiply it in the clamp

#

Iirc the normal and velocity dot product needs to be negated to be accurate

teal junco
#

okay i think i have it

#

i will go ahead and test these

#

thank you!

slate flume
#

Of course!

slate flume
#

player.Weight + rb.mass needs ()

restive turret
#

Fat player having more mass

slate flume
#

.Clamp(val, 0, float.maxValue) can be simplified to .Max(0, val)

slate flume
slate flume
slate flume
# teal junco

Because currently this will just give reduced mass as 2*rb.mass

teal junco
#

holy shit how did i miss that

#

i was literally thinking about the order of operations while writing it

slate flume
#

Happens to the best of us haha

#

Also there's some interesting studies on how many joules of force it takes to break a bone

#

Straight on the bone, it states about 375 joules of force

#

So you might be able to use that as a reference point

true cedar
#

that might be a bit excessive

restive turret
slate flume
icy knoll
#

i imagine the discord summary ai is working in the background like "what the fuck are these guys doing, calculating how much force for blunt force trauma?"

slate flume
restive turret
#

Rock and stone

slate flume
#

The problem is joules is a defined concept and HP damage is an abstract concept

#

Generally what you'd want to do is a find a few reference scenarios (things like a 1m/1m/1m at a velocity of 10m/s) and estimate damage values from those scenarios

#

You'd probably also make it so there's a minimum amount of energy required to do damage

#

So like (Joules - Joulesmin) and then curve it

slate flume
teal junco
#

thanks for all of this extra info

slate flume
#

Of course!

restive turret
#

Thanks clippy

teal junco
#

i probably wont make a curve because i dont know how to make one at runtime, but if i find something for that i may

#

i mustve fucked something up tho, i dropped a 500kg object on a dummy's head and typically do less than 1 joule. i should make sure im calcing right though

slate flume
#

Generally like Math.pow(x, constant0) * constant1 + constant2 gets you a good variety of curves for these things

slate flume
#

I love desmos

teal junco
#

i used desmos to help me calculate a distance-based damage once

#

im taking precalc so i will probably become a lot more familiar with curves now.

restive turret
slate flume
teal junco
#

kickass

slate flume
#

The v_rigid should be v_n

#

So I made a mistake there

#

This should be it

#

I'd say if there are some issues happening, log the player mass, object mass, contact normal, and object velocity (given the player is standing still)

#

Might help pinpoint if the issues is an error in implementing the calculations or an error with the calculations themselves

teal junco
#

yeah

slate flume
#

Because it could be the contact normal is boinked or smthn

teal junco
#

i was gonna log as much as i could

restive turret
#

a player.one with a 500kg mass in your head def should do like 280 dmg

teal junco
#

i think there is a unit mismatch involved actually

#

well idk

#

besides the fact that players perfectly resist huge objects instead of being crushed down (since theyre just capsule colliders as far as physics is concerned)

#

but the velocity is maybe too low?

#

idk

restive turret
#

Show log

slate flume
#

I want to check some stuff

teal junco
#
[2025-08-30 18:51:13.801 -04:00] [INFO] [MerPickupPlugin] Player velocity: (0.00, 0.00, 0.00), RB velocity: (0.43, 0.56, 0.04), relative velocity: (0.43, 0.56, 0.04)```
#
[2025-08-30 18:51:28.403 -04:00] [INFO] [MerPickupPlugin] Player velocity: (0.00, 0.00, 0.00), RB velocity: (-0.02, 0.00, 0.07), relative velocity: (-0.02, 0.00, 0.07)```
slate flume
#

Could it be it's getting the rigidbody velocity post-collision instead of at the point of collision?

teal junco
#

i just delivered ~30 joules to this dummy's head using a 500 kg barricade

[2025-08-30 18:56:28.054 -04:00] [INFO] [MerPickupPlugin] Player velocity: (0.00, 0.00, 0.00), RB velocity: (-1.52, -1.36, -0.75), relative velocity: (-1.52, -1.36, -0.75)```
teal junco
#

idk how to solve that since the method i use is afaik the only one i can

#

for detecting collisisons

#

unless i want to constantly check collisions myself, which i suppose isnt the worst thing ever. or it might be depending on the specific performance issues

slate flume
#

The rigid body dropped straight down, right?

#

Which would mean it should only have velocity on the y-axis

teal junco
#

i think the drop test is flawed

#

i shouldnt hvae posted it lol

#

ill make a better one real quick

celest thorn
#

what formula are you using?

slate flume
#

-1.52, -1.36, -0.75 means the y-axis had less momentum than the other axes

slate flume
celest thorn
slate flume
celest thorn
#

that is not a formula

#

doing -

slate flume
#

Dawg

celest thorn
#

lol

#

im stupid sorry

slate flume
restive turret
slate flume
#

The calculations appear to be correct

#

Which means the problem is either the

  1. Contact normal
  2. The velocity
  3. The mass
#

And it shouldn't be 3 because rb.mass returns weight in kg

#

The reduced mass show in your logs also look correct

teal junco
slate flume
#

The problem is that the dot product between the velocity and the normal is low, meaning the impact was either

  1. Not straight on
    or
  2. The velocity/normal on the collision isn't correct
teal junco
#

ignore the uppermost log there that is a different collision

slate flume
#

The rigid body velocities are incredibly suspicious to me

teal junco
#

the units for velocity might be incorrect.

restive turret
#

Ye velocity of low

slate flume
#

Velocity should be accurate

#

At least for units

#

Wait

#

@teal junco use collision.relativeVelocity

#

Rigidbody mass won't change before and after collision, but velocity will

#

I believe the problem is the rigidbody velocity is changed after collision and that's the value you're getting

restive turret
#

Do
Timing.CallDelayed(-1 ClassDTroll

#

It should run on previous frame

slate flume
#

I'm eager to see how relativeVelocity does

#

I think it should solve the problem

#

collision.relativeVelocty is pre-collision
rb.Velocity is post-collision

teal junco
#

im just eating rn

slate flume
#

๐Ÿ”ฅ

teal junco
#

im trying relativeVelocity.magnitude

#

there is still some things i have to work on, but i think its probably more an issue with the system i use to move objects being unrealistic than the system to deliver energy to players

#

when i rotate a barricade it usually produces more than enough energy to instantly kill any player it touches

#

im adjusting the math i realized i did something wrong

slate flume
#

It'll prevent things like a 500kg object grazing a person from killing them

teal junco
#

yeah thats what i m trying rn

slate flume
#

The contact normals looked okay in the logs so it should be good

#

Just make sure to take the result and Math.Max(dot product thing, zero) to avoid passing negative values into a formula relying on non-negative values

teal junco
#

i have to negate the normals right

#

because that's what unity uses to push objects away from each other

slate flume
upper vapor
slate flume
#

Because normals face away from the surface

#

For example, the normal of a level floor would be (0, 1, 0)

#

This is like 8-9 pounds of pure meat

#

I just made a whole mound of pork

main zenith
#

is there a way to make SCP-106 Unable to pass objects like windows and doors or how to make appearance of player be SCP-106 (I dont need any of the functions of SCP-106 just to be displayed as Player appearance)?

slate flume
#

That can be done either in a plugin or in the RA panel in the effects

#

If you want a player to look like 106 instead but still be a human then you can fake role sync

teal junco
slate flume
main zenith
slate flume
#

It does

#

Idk who you heard that from

#

The game just now has a culling system

upper vapor
#

IScp106Passable

slate flume
#

So you need to resync

upper vapor
#

Look into that

#

(Well, the implementations)

slate flume
slate flume
#

Check Scp106MovementModule

main zenith
# upper vapor IScp106Passable

well its for DoorUtils and i think it can work (excpet with windows) and for normal 106 too but i want to make custom SCP that looks like SCP-106 so in this case it wont help me

slate flume
#

Override the ProcessColliders

slate flume
#

Or just override the GetSlowdownFromCollider

main zenith
slate flume
#

And return 0

slate flume
slate flume
#

It has an out bool isPassable

#

Make that false

#

Bingo bango bongo

#

Also make sure to return zero if it's not passable just in case cause that's what the ProcessColliders code checks for

#

Or if it's better for your purposes you can fake role sync

#

Fake role sync doesn't require patching

#

But depending on how you use it it's not as good and is more resource intensive

main zenith
slate flume
#

Look at the code

#

if (collider is not a passable door)
return 0;

main zenith
slate flume
#

Ergo, return zero if you don't want him to pass

#

And set isPassable to false to

#

Don't forget that

upper vapor
#

Does that sync like that though?

main zenith
slate flume
#

They work in like the same way

#

But maybe I'm wrong

main zenith
main zenith
slate flume
#

I see

#

So will they be able to use items and shit like a human

#

Or is it fully-SCP based

main zenith
#

mostly completing this plugin bcs last time i was using the bug that was making SCP-106 cant pass doors if u changed player role 2 times to SCP-106 but its kinda patch(?)

main zenith
#

and open doors

slate flume
#

If you have everything set up around 106 and all you need to do is remove his ability to walk through doors, fake role sync isn't it

restive turret
#

So i just wait for new update

main zenith
slate flume
restive turret
#

With older sync, size of the role is fucked

main zenith
restive turret
#

When the patch provided by trouble and did some poc system when it failed

restive turret
#

Worked for like 2 seconds

slate flume
restive turret
#

So i just said "fuck this, waiting for proper thing

restive turret
slate flume
#

14.1.3 added player culling

restive turret
#

Iirc worked once then never again

slate flume
#

So anytime a player comes back into view you need to re-fake sync

restive turret
#

I completely rewriting that part too

main zenith
#

so finally fake role sync have some issues right?

restive turret
#

It's sad

restive turret
#

you had no idea how many times i fucked by it

main zenith
restive turret
#

Don't sent message to the server btw

main zenith
slate flume
main zenith
#

damn, idk probably im gonna just try to patch it using harmony or find some other more stupid way to do that...

restive turret
#

Check if player is 106, don't spawn it again

slate flume
#

Turns out @upper vapor was right as usual

#

It doesn't sync

restive turret
#

What doesn't sync

slate flume
#

I did

[HarmonyPatch]
public class Test : CustomEventsHandler
{
  [HarmonyPatch(typeof(Scp106MovementModule), nameof(Scp106MovementModule.SpawnObject))]
  public static void Postfix(Scp106MovementModule __instance)
  {
    FpcCollisionProcessor.RemoveModifier(__instance);
  }
}
#

I also tried patching the other methods in Scp106MovementModule but none of it synced

slate flume
#

Fucking NW

#

Fake role sync it is

restive turret
#

Ye cus its not networked

#

I trying to make my thing networked

main zenith
restive turret
#

I'm at the point that stuff can be networked and i see nw using that "sendrpc" or "sendcmd" i set the object to be networkbeh

hollow remnant
#

guuysss

#

why while is stopping and disconnecting server from server?

#

in Exiled all works stable

slate flume
#

The server runs on a single thread

#

You're locked it up by running a never ending while loop

hollow remnant
#

i have problems like this on Exiled, but i fixed this. how i fix? idk, i just forgot it

#

I started transะฐfer a plugin from Exiled to LabApi (this is an order) and encountered this problem

slate flume
# hollow remnant in Exiled all works stable

It's possible that in Exiled you're either

  1. Not running the while loop
  2. Running it asynchronously

All you've given is the fact that you're running a while loop and the server isn't working anymore because of it
Without details on the surrounding code, the exact nature of the issue, etc., there's not a lot else I can give you other than that the problem is likely that you're locking up the thread somehow

hollow remnant
slate flume
#

Somewhere here you're likely encountering an error

#

Check LocalAdminLogs

hollow remnant
#

That's the problem, the server doesn't give a log

#

if there was a log, I would have already fixed the problem

slate flume
#

Well I see no other issues with this code

hollow remnant
slate flume
#

Are you sure the problem isn't elsewhere

hollow remnant
#

yeah

#

I already want to cry and leave C#

slate flume
# main zenith the plot twist is ||its wont work too ~~jk(pls)~~||
public class FakeRoleSync : CustomEventsHandler
{
  private static Dictionary<uint, RoleTypeId> FakeSyncedPlayers = [];
  public override void OnPlayerShotWeapon(PlayerShotWeaponEventArgs ev) => AddFakeSyncedPlayer(ev.Player, RoleTypeId.Scp106);
  
  private void AddFakeSyncedPlayer(Player player, RoleTypeId role)
  {
    FakeSyncedPlayers[player.NetworkId] = role;
    foreach (var receiver in Player.ReadyList)
    {
      if (receiver == Player.Host || receiver == player) continue;
      receiver.Connection.Send(new RoleSyncInfo(player.ReferenceHub, RoleTypeId.Scp106, receiver.ReferenceHub));
    }
  }

  public override void OnServerWaitingForPlayers()
  {
    FpcServerPositionDistributor.RoleSyncEvent += RoleSyncEvent;
  }

  public override void OnServerRoundRestarted()
  {
    FpcServerPositionDistributor.RoleSyncEvent -= RoleSyncEvent;
  }

  private static RoleTypeId RoleSyncEvent(ReferenceHub target, ReferenceHub receiver, RoleTypeId role) => FakeSyncedPlayers.GetValueOrDefault(target.characterClassManager.netId, role);
}

This is a working fake role sync

hollow remnant
slate flume
slate flume
hollow remnant
# slate flume

I certainly don't really want to completely rework someone else's code, but it looks like I'll have to

main zenith
slate flume
slate flume
#

So what is NewEvent

#

Why are you doing any of this

hollow remnant
#
public class NewEvent
    {
        public static bool IsStarted;
        public static bool IsWaiting;
        public static string WaitingTime;
        public static string StartedTime;
        public static CoroutineHandle Timer;
        public static string Name;
        public static Player Organizer;
        public static string RpLevel;
        public static IMessage Message;
        public static readonly SocketGuild Guild = DiscordLab.Bot.Client.GetGuild(1370518998332080218);
        public static readonly SocketTextChannel Channel = Guild.GetTextChannel(1385082196615761932);
    }
#

this

slate flume
slate flume
#

Meaning the problem isn't with the while loop itself but with the bot interfacing

hollow remnant
#

Discord has nothing to do with it

slate flume
#

At least not natively

#

They run asynchronously

#

I'm trying to explain that it's crazy that the problem would be the fact that you have a while loop, and that the problem is likely the code running inside of / interfacing with that loop

hollow remnant
#

I rewrote the code a bit, leaving the while, I'll check it now

#

give me a second

slate flume
#

And see if you still have issues

#

That'll confirm whether or not the issue is the while loop or the code inside of it

hollow remnant
#

second please

#

problem in while....

upper vapor
#

That's just an illusion

hollow remnant
slate flume
slate flume
upper vapor
#

At least, it's not running on a separate thread

slate flume
hollow remnant
upper vapor
slate flume
slate flume
upper vapor
#

Yeah

#

Not really async in a "usual" .NET way

slate flume
#

True

upper vapor
#

Async in terms of independent of other coroutines

hollow remnant
slate flume
#

What is wrong with your server that you can't run while loops

hollow remnant
slate flume
hollow remnant
#
yield return Timing.WaitForSeconds(1f);
Timing.RunCoroutine(TimerEnum());
yield break;

let's goooooooooooooo

upper vapor
#

If not

#

You're cooked

hollow remnant
#

I already want a custom role "madman" on this discord server

hollow remnant
#

Problem with Timing?

slate flume
hollow remnant
slate flume
hollow remnant
#

hmmm

#

idk

#

give me a sec

#

i dumb

#

updated now

#

testing in process...

#

isn't dependency problem...

hollow remnant
hollow remnant
#

i start try with TimeSpan

teal junco
slate flume
hollow remnant
#

stooop

#

check

#

this

#

fck

#

bug

#

@slate flume

hollow remnant
#

not in while

#

but discord message sended

#

and hint displayed

slate flume
hollow remnant
#

Modifying

slate flume
#

And does the original plugin work on your server?

hollow remnant
#

This method previously called Timer in place of TimeSpan

hollow remnant
slate flume
#

What is the plugin called?

hollow remnant
#

DiscordLab.EventSystem

#

I'LL FIX IT

#

okay

#

let's go to problem

#
foreach (Player p in Player.List)
                                {
                                    Hints.RemoveHints(p);
                                    PlayerDisplay pd = PlayerDisplay.Get(p);
                                    pd.AddHint(Hints.GetHint(p));
                                }
#

plugin has got null or server player

#

it's crash my sexy server

#

and this without any errors

slate flume
slate flume
hollow remnant
#

50/50

hollow remnant
slate flume
#

Which iirc will cause errors if you spawn dummies

#

Because in HSM dummies don't get PlayerDisplays

slate flume
#

@hollow remnant why are you doing all this work when a DiscordLab port already exists

#

It exists for LabAPI

hollow remnant
#

it's just plugin port to LabApi problem

slate flume
hollow remnant
slate flume
hollow remnant
hollow remnant
#

Events server in SCP:SL

slate flume
#

What does it do

hollow remnant
slate flume
#

That DiscordLab doesn't do already

hollow remnant
slate flume
#

So it logs events in the discord?

hollow remnant
slate flume
#

Hate to break it to you but that's also in DiscordLab, just not under the same name

hollow remnant
slate flume
hollow remnant
hollow remnant
slate flume
#

OH

#

That makes much much more sense

#

I gotcha

hollow remnant
#

yeaaaa

slate flume
#

My bad homie

hollow remnant
#

yup

hollow remnant
slate flume
#

I was hoping you were wrong so you could avoid the pain of rewriting everything without using MEC.Timing

#

Cause it's so insane to me that that's breaking everything

hollow remnant
#

oh well, I managed to try a bunch of methods, from while in for, to CallDelayed and TimeSpan

#

I still need to rewrite 2-3 plugins in LabAPI, maybe I'll write more here))

slate flume
hollow remnant
#

It seems to have already been done, I also tried to update it to the new DiscordLab on LabAPI

slate flume
hollow remnant
#

the error was not in Timing, so don't worry about me so much broSteamHappyDance green

hollow remnant
#

@slate flume are you here?

#
if (e.Player.Role == RoleTypeId.Scp173)
        {
            e.SpawnLocation = Room.Get(RoomName.Lcz173).WorldPosition(new Vector3(17.126f, 13.0f, 7.661f));
        }
#

how to do this?

#

I can't find anything like this

slate flume
hollow remnant
#

i can modify this?

slate flume
#

You can't modify the room's location

#

But

hollow remnant
slate flume
#

I see the goal is to move 173 to light

#

What you want to do is

Room room = Room.Get(RoomName.Lcz173);
e.SpawnLocation = room.Rotation * new Vector3(...) + room.Position
#

Where Vector3 is the unadjusted room coordinates

hollow remnant
slate flume
#

Oh yeah that's because Room.Get returns an IEnumerable

hollow remnant
slate flume
#

Use Room.Get(RoomName.Lcz173).First(x => x.Base));

#

In case you're unsure the offset is what you set it to, here's a code snippet you can drop in to figure out the coordinates:

public override void OnPlayerShotWeapon(PlayerShotWeaponEventArgs ev)
{
  if (ev.Player.Room == null) return;
  Room room = ev.Player.Room;
  Vector3 position = ev.Player.Position;
  position = Quaternion.Inverse(room.Rotation) * (position - room.Position);
  Logger.Info($"{position.x}, {position.y}, {position.z}");
}
hollow remnant
#

and what should I replace ev.IsAllowed = false; with in LabAPI?

#

and what to do with Player.Explode()?

#

how difficult is it to switch so abruptly from LabAPI...pleaseee

slate flume
#

LabApi uses ev.IsAllowed = false;

hollow remnant
slate flume
hollow remnant
#

in public void Used(PlayerUsedItemEventArgs ev)

slate flume
#

Change that to public void Using(PlayerUsingItemEventArgs ev)

#

You can't cancel an event after it's already happened

slate flume
# hollow remnant and what to do with Player.Explode()?

public static void Explode(this Player player) => ExplosionUtils.ServerExplode(player.ReferenceHub, ExplosionType.Custom);
That's an extension method you can add to a static class in your plugin to get an Explodefor players

hollow remnant
#

okaaay

#

where is effects?

slate flume
#

Depends

hollow remnant
#

i can't find movement boost effects

hollow remnant
slate flume
hollow remnant
slate flume
#

Every status effect is its own class/type

hollow remnant
#

thx

slate flume
tepid sluice
#

Generics

slate flume
#

That shit is wild

#

I still don't fully understand how it all works but it does

tepid sluice
#

anyway

#

it works

slate flume
#

You can do like public abstract class CustomItemBase<T> : CustomItemBase where T : CustomItemBase<T>
And then declare something like a public static Dictionary<ushort, LightSourceToy?> CustomItemData = new();
And then each item class you make from it inherits a separate static dictionary

#

So I could pull a public class CoinHID : CustomItemBase<CoinHID>
And then automatically reference the items in a Harmony patch like

public class CoinHIDPatch
{
  public static bool Prefix(CycleController __instance) => !CoinHID.CustomItemData.ContainsKey(__instance.Serial);
}
#

It's really dope actually

#

Really that's like the only reason I refactored all my custom items a few days ago

#

It's a small change but it does a lot to clean up the code and make things more consistent

#

Because before in order to do things like Harmony patches, I had to override the Give and Spawn commands to add the serial to a new separate list

#

It's also dope cause it means I don't need a centralized Registry to give or spawn custom items anymore, because I can have inherited static methods

#

So I could just CoinHID.Give(player); instead of something like CustomItemBase.Registry.First(x => x is CoinHID).Give(player);

#

But I still keep a centralized registry for doing shit with randomness

#

And that's made possible through the non-generic custom item base public abstract class CustomItemBase : CustomEventsHandler

#

I mean I have a pretty good idea on how it all works but this was one of those ideas I kinda just get in the shower and then test it out later to see if it actually works and how to actually do it

#

But it worked out fucking fantastic cause I removed like a ton of lines of code from my items

upper vapor
slate flume
#

I also believe it uses the internal transform matrix

slate flume
#

Though the difference is negligible so it doesn't really matter tbh

#

I just never really knew about TransformPoint so I used that method throughout my codebase when I first started making my plugin and now it's my new norm

upper vapor
teal junco
#

Do rigidbodies in SL work slightly differently?

#

i have a car script that works on basis of rigidbodies and it works fine in unity but when i port it to SL it just doesnt drive

#

or even suspend

slate flume
#

It does unnecessary calculations

#

At least in this case because rooms aren't scaled

upper vapor
#

Make an extension method

#

Instead of copy-pasting the formula

#

(If you haven't yet)

slate flume
upper vapor
#

Okay fair for the example's sake

slate flume
#

I have a Resources class with a bunch of extension methods for shit like this dw

#

I'm not an animal

slate flume
upper vapor
#

Extensions namepsace with each file containing extensions for a specific class

upper vapor
#

"firzt plugwn uwu"
I wasn't even a furry back then ๐Ÿ˜ญ

slate flume
slate flume
upper vapor
#

Yes indeed

#

You never know when you need a new extension for the class you're extending

#

Seriously

slate flume
#

But what if it gets lonely ๐Ÿฅบ

upper vapor
#

Well

#

Give it a friend

slate flume
teal junco
#

make an extension that procedurally generates a string of swear words and then broadcasts it to the player

upper vapor
royal mica
#

I'm correct in the assumption, that if multiple plugin modify ServerSpecificSettingsSync.DefinedSettings it overrides it

#

oh god this is worse

#

oh no

unique crane
royal mica
#

Great, just wanted to double check

#

not some reflection unity creates shadow static classes bullshit

unique crane
#

If you use multiple plugins with it, you can DefinedSettings = DefinedSettings.Append(...)

celest thorn
#

best websocket

#

my brain is fried, cloudflare is hard...

lucid canyon
#

i have simple solution.
I didn't fix the actual cause of this bug, but i removed symptoms.

this dupe only work inventory item(i checked held item is dupe, but i think inventory item upgrade is also dupe)

this item(pickup) have same serial, when others held item(item)
so remove item(pickup) use item(item)'s serial.

lucid canyon
tepid sluice
#

wow that map

#

how

royal mica
#

Yes I already fixed it

#

You need patch [HarmonyPatch(typeof(StandardItemProcessor), "ProcessPickup")]
And replace the ServerCreatePickup to have a spawn: flase parameter

#

And also [HarmonyPatch(typeof(FirearmItemProcessor), "UpgradePickup", [ typeof(ItemType), typeof(ItemPickupBase)])] for guna

#

I assume the spawn param got changed from default false to true and caused thos recession bug

grave eagle
royal mica
#

The bug itself is that 914 duplicates the held item as pickup, but the pickup is already in the OUTPUT, so it teleport it again the same distance as if it were in the input

#

I can share the patch, but im not at home rn

worn gull
lucid canyon
#

um.. i use hint

worn gull
upper vapor
#

Lots of TMP magic

hearty shard
worn gull
#

ohh

restive turret
#

Bunch of fancy characters

unique crane
#

Yeah this is the fix for the duplicated held items btw

#

If anyone wants to patch it

royal mica
#

Oh that is much easier ICANT

#

I winder why this was not pushed as a bugfix

restive turret
#

Jesus already approved PR's in labapi that means those probably already merged in the game, so soonโ„ข we see a 14.1.4

unique crane
#

No that means they are just ready to merge

restive turret
#

:(

#

So probably the push will happen at idk, middle of September

unique crane
#

idk

restive turret
#

Surface zone rework probably not be pushed i guess

#

Bc thats a POC

upper vapor
#

It'll happen in Random.Range(0, 10000) days

restive turret
upper vapor
#

It's a channel to chat generally

restive turret
#

General Cat

unique crane
restive turret
#

Current status is: ||[REDACTED]||

unique crane
#

mhm

restive turret
#

David

#

The gravity we have (-19.8) is inside unity too? Like in the Player config? Or the grav is only for the player and not all objects

unique crane
#

well thats for players

#

Added to the y velocity

restive turret
#

Velo kitty

#

So you guys didn't changed the Physics inside the whole thing just only the players

unique crane
#

yea

restive turret
#

Nice

unique crane
#

Pickups use normal gravity I believe

worn gull
#

From a FirearmPickup how can I get the ammo module?

restive turret
#

Template

worn gull
slender lynx
#

250-350

restive turret
#

Man I only have like 35 fps