#plugins-dev-chat
1 messages ยท Page 110 of 1
or run it outside
and attach analyzer xd
i cannot connect to the db outside
which is 100% required
Well then
unless the analyzer supports remote access
make your own
or connect to the db from outside
temporary
i cannot until maro is not online because she is the only one who manages port and has acess to all of that (ssh)
but i mean
if i call GC
it doesn't work at ALL
so how would i debug something like that
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
for me it goes 4GB
and im still trying to figure it out why
Wait
thats actually not stupid
lol
25k colliders?
- 40 ig
ig that makes sense
Unload few of them
and see
Perhaps load them on demand
If someone goes into a tower
that nukes tps
Recycle the colliders
destroying and loading them
Dont create new ones
Its just a collider, you can set the position, rotation and scale
merge boxcolliders into meshcolliders
they already are required to be meshcolliders
Yeah no shit they take up 4GB
hmm
because i need to take in account
colliders can move
why
Because its easier to do for shapes
why do you need every single collider to be a meshcollider
because thats how i made it in the past
you don't need a meshcollider for a cube
Im sure that the tower walls doesnt need to be mesh colliders
and the rectangle platforms doesnt either
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
did you know that you can use GameObject.CreatePrimitive
and?
oh wait that doesn't handle collisions exactly as SL primitives
you should do this
primitiveobjectoy
But still i can run 35k primitives on a server with 60tps
and sl base can run 5k
lmfao
:3
SL base can run 9K
-# i have not measured the tps of that
9k???
this is evolving
crazy
xddd
Skill issue
ngl that sounds a nw skill issue
not mine
because same schematics run fine on Meow
meow
"why does my server crash when I spawn 1 million networked game objects"
i don't still know how tf we came up with that name
I wonder
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
Cuz you are
Not a furry
Sure..
Friendly fire
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
ah hell nawh
btw both of you forgot that sphere colliders exist
i know that they exist
forgot another one Capsule
yea i know i cannot stay near cats
or else death
i cannot stay even near chalk boards, every teacher hated me because i made them use the board with markers
nameless stop simping
WheelCollider 
I don't think i can use wheels
in sl
technically i can
no
i can tell
How to hide a primitive from a specific player?
ObjectDestroyMessage
Destroy them
^
ev.Player.Client.Send()?
ev.Player.Connection?.Send(ObjectDestroyMessage);
Thx
How to find NetworkIdentity of a primitive?
When I send ObjectDestroyMessage, I also need the object's NetworkIdentity
Follow up removing all colliders didn't change anything
Base.netid
just the netid
Thanks for the answer
Okk

Did a bit of testing and instead ram got up
lmao
impossible
Nah i did i can show you
I even reverted because they were causing more
This is the code btw
XDDDDDD
Yeah well
I would wait for maro to open up testing port to the db
and run it locally with memory analyzer
I mean what memory analyzer should i use?
And i have a game theory
Because i use meow on other project this never happened only on atoh
Ig that some components might be heavy
Bo2 or modern warfare old one?
bf6
its still sl lol
Btw which memory analyzer should i use?
All of them are for the editor ;(
What if i use the debugging?
I think i will use dotmemory
Tbh I would ude tge unity 6's dll/exe
Ngl i think i will stick with dotmemory and try figure it out
Run bepin on server 
And then?
That doesnโt debug memory or just straight up help
But its on the server not on the client so i donโt have ui
Dotmemory
Because debugger attacher for unity
Is only that
Dotmemory allows me to attach to the process
Well why not run the server on your local pc?
Yea
Y'know you can connect to it by "localhost"
But im waiting the princess to wake up
And debug right away
And just down the firewall
Because i want to check with the data we have
Let me try and see
If everything works
i'm not sure if you can attach any .NET debugger to a running SL server process
im trying
but nothing
From there how tf do i know what it is
you don't

yeah, client do be like that
No this is server

try it and see
nothing
no memory profiling for you then
btw i don't know where it is
because i tried standalone meow
and the maps load fine
without problems on memory
I think its the components
~~did someone mange to change font in tmp richtext?
nope
cant remember if font needs to be registered somewhere
i think it had to be
the fonts should be added to the font atlas but they aren't
i remember ax complained about it
for an hour
i mean you can add all fonts to it
btw guys some cool story game i could play while waiting for the server to explode
sneaking
3259265 file changed
- added fonts to avlb font list
ngl nothing wrong
idk where or how much but prob need small change
not really high prio so
can be merged in middle of something ig
sneak
soo font tag is not working at all?
pretty sure its been that way since unity 6
left one is with tag, right default broadcast font
there's no way
oh it's roboto
well
roboting the mono
kill mono
because its in this folder
did someone make suggestion?
its called Fonts & Materials
give me 2 seconds
Goal Description Moving them allows us to use all of the fonts for broadcast and Hints which would be cool Notes No response
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
create a suggestion for TextureToy
FR
that would be useful
to texture primitives (using existing texture)
or just enable changing to desired mesh in primit
we can make chairs now
real chairs
??
game has a mesh for a chair
if they add that
we can use realistic chairs
wait
aren't rooms meshes?
oh i meant material
.
thats why i started saying that
ye i was like wtf this guy and how since it is just a material :D
i dont want a chair i want a table
wasn't that a Unity 6 issue?
I remember seeing some bug report in Unity about it
Font needs to be registered while RobotoMono is in specific folder soo its using that one
dont suppose theres a way to give a human the 079 hud 
(I havent even looked yet because I'm assuming the answer is no)
uh nope
would be really cool to have when flying around as an invisible tutorial 
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
server room
is there any way to make it possible for the client to solve a cryptography query before joining the server?
like during pre-auth
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.
I dont really care that much about if it looks nice on the client, i just want to know how to make them want to latch onto waypoints.
If you add the pickup as a child it should just work
Though waypoint toys should be automatically moving rigid bodies when using small steps
At least afaik
not just waypoint toys, but also stuff like elevators.
also you mean if i add a pickup and make it a child of the object of the rigidbody?
What I know is I have players and I want to use a waypoint toy to move them so if they're in the waypoint toy, I teleport the waypoint toy continuously and teleport the player to the waypoint to, and the player receives the movement smoothing of the waypoint toy
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
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
Iirc all admin toys have lists of all the ones that are spawned
Same thing with elevators in the LabAPI wrapper
what?
dw
๐ฅ
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
i think that would need to be a foruma you discover yourself
yeah i figured
its not as simple as
technically you can use fall damage as a metric
well a generally nice/balanced formula from joules to HP would be nice, similar to how humans dont use HP but they found a good conversion from bullets to players HP
i dont even know if SCP SL has proper fall damage
well
idk
you die if you fall enough
but ive fallen from decent heights without taking damage
I assume that is a bug? Atleast without context it sounds like it
I mean, SCPs get a % damage as well now
wait now you made me question if you get half damage
it might be actually
Yeah, you get a small damage
but because of that i thought for a decent amount of time that fall damage was hard-coded using triggers
I just used the chaos spawn stair to test
Ye system is complex af
isn't the fall damage code 100% serverside so anyone can just check
I think it is, it's "public"
I would say a little bit complicated
yea its server side
What
what is confusing about what i said
The confusing part is why you need to do that conversion in the first place
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
okay thats fair
i just dont really know how else to calculate how much i should hurt a player using physics objects
Ohhh interesting
i take physics next year so i have zero experience with it right now
So you're launching rigidbodies at players and you want to calculate damage
after a quick google i found joules
p much
Yeah no joules makes sense here
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
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
i do have the contacts of the collision actually, i just dont know how to use it. they include the normals of the collision.
Oh dope
I dont think it matters if 500kg concrete barries hits your leg or arm XDDD
i assume the contact normals can be used to more precisely calculate how much energy is imparted onto the player
but idk
Average player will not notice that
true
My bad I got a call from my dad he's grilling me about some shit
its fine i dont expect much from discord convos. as long as people respond eventually im happy xd
So if I remember correctly that'll mean you want to take the dot product of the relative velocity and the normal
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
reduced mass ?
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
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
and then i plug in this as velocity
well i assume they are, and if i just treat it as kg in my own system it should be "close enough"
If you're clamping it like that just do Min with 0, velocity
regardless of how it actually is treated
But yeah that looks about right
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
Of course!
Fat player having more mass
.Clamp(val, 0, float.maxValue) can be simplified to .Max(0, val)
This one doesn't change the actual function of the code, it's more of an optimization
This one is important
Because currently this will just give reduced mass as 2*rb.mass
holy shit how did i miss that
i was literally thinking about the order of operations while writing it
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
that might be a bit excessive
You can always split those math operations
Well tbf he did ask if there's a way to convert joules to damage
.
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?"
Bone breakage is a pretty good reference point I'd say
Rock and stone
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
But if you get good reference points, you can interpolate a curve from that and then approximate the curve to optimize
thanks for all of this extra info
Of course!
Thanks clippy
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
Well a curve could be as simple as like sqrt(joules) * 1.5 or something like that
Generally like Math.pow(x, constant0) * constant1 + constant2 gets you a good variety of curves for these things
oh yeah.
I love desmos
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.
alr
Maths are everywhere
kickass
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
yeah
Because it could be the contact normal is boinked or smthn
a player.one with a 500kg mass in your head def should do like 280 dmg
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
Show log
Do you have some example logs from the event?
I want to check some stuff
[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)```
Could it be it's getting the rigidbody velocity post-collision instead of at the point of collision?
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)```
maybe
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
The rigid body dropped straight down, right?
Which would mean it should only have velocity on the y-axis
i think the drop test is flawed
i shouldnt hvae posted it lol
ill make a better one real quick
what formula are you using?
-1.52, -1.36, -0.75 means the y-axis had less momentum than the other axes
Scroll up
?
We just talked about the formula he's using
Dawg
.
The calculations appear to be correct
Which means the problem is either the
- Contact normal
- The velocity
- 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
500 KG coke bottle dropped from the same spot onto a dummy same position, should have about perfect Y velocity
The problem is that the dot product between the velocity and the normal is low, meaning the impact was either
- Not straight on
or - The velocity/normal on the collision isn't correct
ignore the uppermost log there that is a different collision
The rigid body velocities are incredibly suspicious to me
the units for velocity might be incorrect.
Ye velocity of low
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
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
gonna check rq
im just eating rn
๐ฅ
im trying relativeVelocity.magnitude
500 kg bottle dropped on dummy @slate flume it worked
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
If you want to keep it as realistic as possible you can still do the dot product of the relative velocity and the normal negated to get your final velocity value
It'll prevent things like a 500kg object grazing a person from killing them
yeah thats what i m trying rn
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
i have to negate the normals right
because that's what unity uses to push objects away from each other
Yeah
Small brain damage
The normal and velocity are going opposite directions
Negating allows you to, essentially, determine how close the velocity is to hitting the surface head-on
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
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)?
just make a plugin
Remove the ghostly status effect
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
nah that doesnt do anything for 106 i just tried
Maybe apply it and remove it again
i have heard from a friend that fake role sync dont work properly right now
It will
It does
Idk who you heard that from
The game just now has a culling system
IScp106Passable
So you need to resync
Damn you're right even applying and removing didn't work
I believe this is an attribute given to map elements and not 106 himself
Check Scp106MovementModule
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
Override the ProcessColliders
In the aforementioned
Or just override the GetSlowdownFromCollider
wdym by override?
And return 0
Harmony patch
Actually this is better
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
wait but if i does this i do set then Player Speed 0 so hes gonna be stuck in doors?
No
Look at the code
if (collider is not a passable door)
return 0;
oh i miss that my bad
Ergo, return zero if you don't want him to pass
And set isPassable to false to
Don't forget that
Does that sync like that though?
probably fake role sync would be better but i dont have any idea how to make fake role sync
What is your goal
Iirc ghostly effect is synced, I don't see why this wouldn't be
They work in like the same way
But maybe I'm wrong
just to make a player appearance as SCP-106 nothing more
For why
im making custom SCP plugin for SCP-457
I see
So will they be able to use items and shit like a human
Or is it fully-SCP based
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(?)
nothing just walk
and open doors
Oh if you already have most of it then fake role sync is probably worse for your purposes
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
Trued it but its fucked for me rn
So i just wait for new update
i mean its not like a huge lost like maybe event to make SCP-106 unable to attack and to set vigor to 0 and thats all
Really? How is it messed up
With older sync, size of the role is fucked
like this is what i have right now (u can see what i mean by saying "patch(?)" of the bug of changing role 2 times to SCP-106 for a player)
damn mkv...
When the patch provided by trouble and did some poc system when it failed
ok there is mp4
Worked for like 2 seconds
Did you make sure to reapply the fake role sync after a player is culled?
So i just said "fuck this, waiting for proper thing
I used the patch + mirror message provided by trouble
Idk if that has it or not
14.1.3 added player culling
Iirc worked once then never again
So anytime a player comes back into view you need to re-fake sync
I completely rewriting that part too
so finally fake role sync have some issues right?
Discord doesn't know mkv
It's sad
I LOVE 106 SPAWN BUG ISSIE
you had no idea how many times i fucked by it
it was working fine(the bug) and then this fucking teleporting shit
Don't sent message to the server btw
wdym?
If you send messages to the host player it can sometimes cause issues
damn, idk probably im gonna just try to patch it using harmony or find some other more stupid way to do that...
Check if player is 106, don't spawn it again
What doesn't sync
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
so harmony patch wont work
the plot twist is ||its wont work too jk(pls)||
Idk how the stat on network traffic will be
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
guuysss
why while is stopping and disconnecting server from server?
in Exiled all works stable
The while loop never completes
The server runs on a single thread
You're locked it up by running a never ending while loop
.
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
It's possible that in Exiled you're either
- Not running the while loop
- 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
check code in #plugins-discussion please
while in exiled started and work correctly, in sync
Well that illuminates a lot more
The problem isn't the while loop
Somewhere here you're likely encountering an error
Check LocalAdminLogs
That's the problem, the server doesn't give a log
if there was a log, I would have already fixed the problem
Well I see no other issues with this code
++
Are you sure the problem isn't elsewhere
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

@restive turret try this out
Now of course @main zenith you'll want to modify this to initialize the role sync events in your plugin entry instead of as events and you'll want to make the conditions for adding a fake synced player different, but the fundamentals are the same
I certainly don't really want to completely rework someone else's code, but it looks like I'll have to
Still thank u so much for this
So when you remove the while loop, everything works?
yeah
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
Of course! I mean it's not too complicated of a concept, it's just a matter of knowing where to find it and work with it
So is it possible that the issue is that in the while loop, modifying those variables is triggering an update to the discord client and that update is what's causing issues?
Meaning the problem isn't with the while loop itself but with the bot interfacing
No, I had a similar problem on Exiled with infinite loops in the code, but I don't remember how I fixed it.
Discord has nothing to do with it
Infinite loops in a coroutine aren't a problem though
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
Try removing all the code in the while loop except for the yield return Timing bit
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
now I'll try to make one while-loop to understand whether the problem is in two loops or in general in the fact that there is a loop
So just running the coroutine with a while loop in it breaks your server?
That's so crazy because I've never experienced that problem
Huh?
Yup! That's right!
Yeah I know that but they run "in the background" even though they use main thread respurces
So, as I found out, the problem is that there is an infinite loop, what is the best way to remove it?
"running independently of other coroutines but still based on the update loop" isn't really async, is it
Figure out why infinite loops are bricking your server to start
This is a problem no one else has
Depends on your definition of asynchronous
True
Async in terms of independent of other coroutines
give me a second, i just testing with for
This is insane
What is wrong with your server that you can't run while loops
for (; NewEvent.IsWaiting; )
idkkk
You've gone mad
Yeah :)
yield return Timing.WaitForSeconds(1f);
Timing.RunCoroutine(TimerEnum());
yield break;
let's goooooooooooooo
Does the condition get modified in the loop
If not
You're cooked
I already want a custom role "madman" on this discord server
@slate flume IT'S NOT WORK TOOOO
Problem with Timing?
Check your dependencies
using MEC
I mean is it up to date, do you get your dependencies from the game managed folder?
hmmm
idk
give me a sec
i dumb
updated now
testing in process...
isn't dependency problem...
@slate flume
i start try with TimeSpan
So the server locks up anytime you using the Timing class?
problem in this code
not in while
but discord message sended
and hint displayed
So did you make all of this or are you modifying an existing plugin?
Modifying
And does the original plugin work on your server?
This method previously called Timer in place of TimeSpan
on Exiled - yes. on LabApi - no
What is the plugin called?
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
Wait you're fucking with DiscordLab?
Use Player.GetAll(PlayerSearchFlags.AuthenticatedPlayers)
50/50
simple Player.ReadyList fix it
Yes but then it sends to dummies
Which iirc will cause errors if you spawn dummies
Because in HSM dummies don't get PlayerDisplays
So do this ^
@hollow remnant why are you doing all this work when a DiscordLab port already exists
It exists for LabAPI
it's just plugin port to LabApi problem
Someone already did the work to port it to LabAPI
not this plugin
plugin.name == discordlab.eventsystem
!discordlab.modules.Contains(plugin.name);
What is the eventsystem for?
Events server in SCP:SL
That DiscordLab doesn't do already
So it logs events in the discord?
for ex,
Hate to break it to you but that's also in DiscordLab, just not under the same name
that's not what i'm talking about
Then explain further cause I'm lost
yeaaaa
My bad homie
yup
why?
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
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))
Wait maybe you can avoid the pain?
The new DiscordLab has
It seems to have already been done, I also tried to update it to the new DiscordLab on LabAPI
I just don't want you to have to port every plugin without being able to use Timing
@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
Just use .Position
i can modify this?
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
Oh yeah that's because Room.Get returns an IEnumerable
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}");
}
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...
Nothing
LabApi uses ev.IsAllowed = false;
Where is this code found
in public void Used(PlayerUsedItemEventArgs ev)
Change that to public void Using(PlayerUsingItemEventArgs ev)
You can't cancel an event after it's already happened
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
Depends
i can't find movement boost effects
thx
player.GetEffect<MovementBoost>();
no, like this
ev.Player.EnableEffect<MovementBoost>();
Every status effect is its own class/type
thx

I made a generic abstract class
That shit is wild
I still don't fully understand how it all works but it does
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
Why not transform.(Inverse)TransformPoint
Doesn't TransformPoint calculate things like scale and other junk?
I also believe it uses the internal transform matrix
Which, if I'm not mistaken, makes this a little bit more optimized
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
Are room scaled though
No
Even if they were, their scale would be consistent
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
Yeah my point is that it's overhead
It does unnecessary calculations
At least in this case because rooms aren't scaled
It was like 5 lines of code I didn't think giving the poor guy an extension method with it would help clear things up ๐ญ
Okay fair for the example's sake
I have a Resources class with a bunch of extension methods for shit like this dw
I'm not an animal
Though some people here kind of are ๐
Gotta love my old Utils.cs and Helpers.cs and SCPSLHelper.cs
"firzt plugwn uwu"
I wasn't even a furry back then ๐ญ
There's sort of a double meaning behind what I said lmao
I'm gonna create a file for my Player extensions and all it is is one class with this
public static void Explode(this Player player) => ExplosionUtils.ServerExplode(player.ReferenceHub, ExplosionType.Custom);
Yes indeed
You never know when you need a new extension for the class you're extending
Seriously
But what if it gets lonely ๐ฅบ
But I have no friends to give it :(
make an extension that procedurally generates a string of swear words and then broadcasts it to the player
I'm not sure, I haven't worked with custom rigidbodies in SL
Check if the mass is the exact same
I'm correct in the assumption, that if multiple plugin modify ServerSpecificSettingsSync.DefinedSettings it overrides it
oh god this is worse
oh no
Ofc... its just a reference..
Great, just wanted to double check
not some reflection unity creates shadow static classes bullshit
If you use multiple plugins with it, you can DefinedSettings = DefinedSettings.Append(...)
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.
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

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
How did you made the map?
um.. i use hint
But how did you made it look like that, hint can only display text, no?
Lots of TMP magic
Convert the image to text
ohh
Bunch of fancy characters
There is so many stuff in the backlog to be a "bugfix" push
Jesus already approved PR's in labapi that means those probably already merged in the game, so soonโข we see a 14.1.4
No that means they are just ready to merge
idk
It'll happen in Random.Range(0, 10000) days
General Cat
Buy patreon and find out its status
Current status is: ||[REDACTED]||
mhm
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
Velo kitty
So you guys didn't changed the Physics inside the whole thing just only the players
yea
Nice
Pickups use normal gravity I believe
From a FirearmPickup how can I get the ammo module?
Template
Thanks
@celest thorn avg fps is solid rn
https://maro.tiananmensquare.asia/๐ธ/6vsk7z3t.png
250-350
Man I only have like 35 fps








