#plugins-dev-chat

1 messages Β· Page 54 of 1

restive turret
#

I gonna learn how statemachine work

#

Technically i know how would i do it

#

But

slate flume
#

I'm too lazy to try to figure it out

restive turret
#

My script dowsnt wanna a knowge what i want

slate flume
#

I make code that barely works as is

#

If I try adding pathfinding to my bodyguard code I'll probably inadvertently cause like 50 billion server crashes and break like 3 other classes

#

Lmao

restive turret
#

πŸ”₯

slate flume
#

I hear A* is pretty cool though

#

I watched a rad video on it

restive turret
#

I basically know what I want but it doesn't seems to get it

upper vapor
restive turret
#

What is A*?

upper vapor
#

pathfinding algorithm

slate flume
#

There is

#

An amazing Polylog video

#

I never find this video when I look up "A* pathfinding" so it takes some digging cause I always forget the details

#

Istg polylog is like shadow-banned or something cause I never find his content even though it's absolutely πŸ”₯

unique crane
#

You can do dijakstra from room to target room

#

that one is easy to do

slate flume
#

A* is dijkstra but cooler

unique crane
slate flume
#

A* is pretty rad

unique crane
#

But I do know how it works xd

slate flume
#

But but but

#

A*!

unique crane
#

A* is just diakstra with heuristic function

slate flume
#

Yeah

#

That's pretty cooool

unique crane
#

a* is just faster (usually)

#

and less accurate

#

(depending on heuristic)

slate flume
#

A* is really good when you have a large data pool

#

It's why almost all GPS services use some variant of A*

unique crane
#

Which SL doesnt

slate flume
#

Yeah lol

#

If I add pathfinding to SL I'm adding Dijkstra and not A*

#

It's a lot more work for little payoff

unique crane
#

I was thinking about pathfinding system which Barotrauma uses

#

Like each room will have nodes for paths where you can go from-to

#

and interact with stuff

slate flume
#

Dijsktra is like the breadth-first search of algorithms

restive turret
#

I hate YouTube

#

5 ads in a single video

#

I can't

upper vapor
restive turret
#

😭 😭

slate flume
#

I want

#

Obstacle detection

slate flume
restive turret
#

Work pc

icy knoll
#

unless your IT dept is absolutely off their fucking rocker

restive turret
#

I'm just there

#

Not even real worker

icy knoll
#

you guys know how exceptions can disconnect players due to a plugin sometimes, what method is called in the case of that? i wanna patch it so i can log it to discord

restive turret
#

It will be only on player side

icy knoll
#

so there has to be some sort of method called that logs that specifically, rather than just watching the log method all the time

restive turret
#

Oh then, well search for that string in dnspy

icy knoll
#

ive never used it, looked it up and it seems like the project is archived? does it still work or is there a new ver?

terse bone
#

It's a method that returns a delegate

icy knoll
#

thank you so much

#

yeah it's in a catch block so I can add a method in there

#

using transpiler

#

hmm, it's internal only, im publicizing it with BepInEx but I still can't use it in nameof 😭

restive turret
#

Then you didn't do it right

icy knoll
#

probably idk

#

do you have a dummy csproj you use with that stuff?

icy knoll
#

ok now it works? wtf 😭

restive turret
#

Magic

#

10 eur

icy knoll
#

sending the invoice back

icy knoll
#

does anyone know why my harmony patch might return NotSupportedException 😭

upper vapor
#

what

restive turret
#

Send code

#

Otherwise

upper vapor
#

you can't patch generic methods

#

maybe that's why?

icy knoll
#

oh...

restive turret
#

Do you want me to use my magic ball to tell why

icy knoll
icy knoll
#

i dont need the generics tho

#

so that doesn't really affect me...

#

im just using a transpiler to add a method here

#

patch should work fine but ofc i get the error

#

because of the generics

#

😭

restive turret
#

Yeah

#

Sadge

#

Oh of

icy knoll
#

guess i gotta patch this then instead then?

restive turret
#

Get the disconnect

upper vapor
#

no

#

NOO

icy knoll
#

okie

#

i wont

#

😭

upper vapor
#

unity has a uh

restive turret
#

Nvm you can't trace back what was wrong

upper vapor
#

ReceivedLogMessageThreaded or something like this event

#

or do you specifically need the exceptionM

slate flume
#

Dumb and evil

upper vapor
icy knoll
slate flume
#

At what point can I patch the entire game

slate flume
#

I want people to join an SCP:SL server and end up playing an entirely different genre

icy knoll
#

okie

slate flume
#

I wanna join Chaos Theory and end up playing a 2D Mario knock-off

upper vapor
#

you can use the non-threaded version too but i assume you have a buffer that you send every x seconds

slate flume
#

Lmao

upper vapor
#

you just ddos the webhook? 😭

#

you're gonna get rate limited

restive turret
#

@icy knoll you can maybe do is in disconnect you get why is disconnected (check stack trace has WrapHandler.)
But you still wont be able to get the exception for it

slate flume
icy knoll
#

no ill check what the content is smh

icy knoll
upper vapor
#

lumi..
what if you replaced the wrap handler with a different method

restive turret
#

What if

#

You see where used and patch that

icy knoll
restive turret
#

Nvm that still might use generic

upper vapor
#

me neither

icy knoll
#

exactly!

restive turret
#

Just edit the assembly to run an action

#

You sub to it

#

Easy

#

If not well you fucked the whole mirror but well

slate flume
#

What if you check if a player disconnecting corresponds with an error happening around that timeframe

#

Instead of trying to trace back the player disconnect, just check for any error within like .1 seconds

icy knoll
#

I'd rather not do any file scanning thanks

slate flume
#

Is file scanning the local admin log really going to be harder than tracing back the error from the player disconnecting?

upper vapor
#

also, the wraphandler is the only global exception handler, no?

upper vapor
#

check if it starts with Disconnecting connId=

icy knoll
#

so i thought id patch it

#

because ye

#

generics

slate flume
#

🀷

#

I know nothing about how unity works lmao I just make plugins

slate flume
#

I have never opened Unity Hub a day in my life

icy knoll
#

i need to do some unity stuff in future tbh... it's fun making plugins that interact with unity...

upper vapor
grand flower
#

sec

#

there's a few places to patch

slate flume
#

I know C#

grand flower
#

but in the end you should just make sure your code doesn't throw

slate flume
#

And I know how to read it

upper vapor
grand flower
#

Why bother

slate flume
#

Other than my knowledge of C# and fucking with assemblies I have no clue how to do unity shit

grand flower
#

@icy knoll

[HarmonyPatch(typeof(NetworkServer), nameof(NetworkServer.UnpackAndInvoke))]
public static class HostDisconnectPatch
{
    public static void Postfix(ref bool __result, NetworkConnectionToClient connection, NetworkReader reader, int channelId)
    {
        if (connection.connectionId == 0)
        {
            __result = true;
        }
    }
}
icy knoll
grand flower
#

If you want it to work for all players remove the if statement

grand flower
#

Prevents it from disconnecting the host for exceptions

slate flume
#

@grand flower you're my hero

grand flower
#

remove the if statement and it'll prevent disconnecting anyone

icy knoll
#

lol

#

it's players

grand flower
#

You asked what that code does

#

I also told you how to make it work for everyone

icy knoll
#

true

#

hmm

#

ill just leave as is so people can ping me if they crash and ill see the logs

slate flume
#

If people don't report the problem then it doesn't exist

grand flower
#

I just did a few patches for the host player because it being kicked is stupid

#

and causes a shit ton of issues

tulip kiln
upper vapor
tulip kiln
#

You shouldn't turn that off

grand flower
#

That's why my code only does the host player

slate flume
icy knoll
grand flower
#

Unity objects can always be null

icy knoll
#

not unity

upper vapor
#

player events toomuchtrolling

#

@moyai can tell you about that

grand flower
#

I've had a few NRE yeah

slate flume
grand flower
#

especially after 14.1.1

#

for some reason

#

that's just

#

the same as == null

slate flume
#

Just sanity check fucking everything

grand flower
#

just silence your compiler

slate flume
tulip kiln
#

ignore the compiler πŸ—Ώ

slate flume
#

LMAO

#

Based

upper vapor
grand flower
#

The only time I do end up suppressing exceptions for players is when it's a NW moment

slate flume
#

I just like getting that success with no warnings

grand flower
#

that does more harm than good

upper vapor
severe cave
slate flume
slate flume
restive turret
#

Everything can be null

upper vapor
restive turret
#

Duh

#

Especially unity stuff

upper vapor
#

not that difficult

slate flume
grand flower
#

Because nullable isn't a promise

tulip kiln
# upper vapor why 😭😭😭

I can't be bothered to suppress warnings I know will never cause an issue. (Like a nullable field not having a value when leaving its constructor. Its intentional, since objects of this type are created via a wrapper that initializes said field)

#

Unless my mindset is wrong

#

which it may be

upper vapor
restive turret
slate flume
grand flower
#

And Northwood likes breaking nullables so why bother using it in the first place

upper vapor
#

IEnumerable<Item?> Items

restive turret
#

Ot just remove the nullable??

#

<Nullable>disable</Nullable>

#

Or what

upper vapor
slate flume
#

I have parts in my code where I add in a "?? throw new NRE" just to appease the compiler gods

grand flower
#

Nullables are great when used properly

slate flume
restive turret
#

Unity cant use it properly

#

Since yknow

slate flume
#

I use nullables selectively in my plugin

restive turret
#

ITW ON OLD DOTNET

#

So doesn't matter for you anyway

upper vapor
#

but i hate adding =null! to every unity ojbect field so ii just don't use it in a unity project

grand flower
#

I do more C# outside of Unity than with Unity, screw that engine

restive turret
#

Real

slate flume
#

I don't have any desire to learn Unity

#

I like C# though

restive turret
#

Same

slate flume
#

C# is a cool language

upper vapor
#

i do more unitying than C#ing in unity toomuchtrolling

grand flower
#

I'm happy with Unreal

slate flume
restive turret
#

I happy just making stuff until I find a good engine

upper vapor
#

i have to do that every freaking time

slate flume
#

Lmao

restive turret
#

Don't child

slate flume
#

No parents, no children, only objects

#

Kind of cold πŸ₯Ά

restive turret
#

Every object equals

slate flume
#

Thus far in my experience with coding C# is like the perfect level

upper vapor
#

i have a hierarch of many prefabs
like holy moly
unpacking prefabs in the editor player actually freezes the game so much

slate flume
#

It's not python high-level but it's not assembly low-level

upper vapor
#

-# probably cuz i had millions of little prefabs in one scene

slate flume
restive turret
upper vapor
restive turret
#

Script like

#

Y'know

#

Lua

#

Py

upper vapor
#

that's not

restive turret
#

Js

upper vapor
#

high-level

restive turret
#

Medium

upper vapor
#

just functional

restive turret
#

Non function

#

In my category

slate flume
upper vapor
#

half of that time was "editor: merge prefabs"

slate flume
#

Oh

#

Lovely!

upper vapor
#

like you're just walking around
30s frame drop

royal mica
#

I don't there is "higher" programming language

#

it just generally called high level

upper vapor
#

C# and python are both high level

royal mica
#

yeah

#

it just different way it is being executed

upper vapor
#

not sure if i wanna call python general-purpose but it kinda is

restive turret
#

Higher leverl is when you think it runs that

upper vapor
#

i think πŸ—Ώ was talking about
how functional (as in paradigm) the languages are

slate flume
#

I mean like

upper vapor
#

C# is both an OOP and functional language

slate flume
#

Python you don't have to define types

upper vapor
#

and let's not talk about POOP

slate flume
#

It's much more prone to errors and shit

upper vapor
#

that's jusno

slate flume
#

But it's easy to write code

restive turret
royal mica
#

That doesn't really define the low/high levelness of it

slate flume
#

In like basic C you don't get as much abstraction

limpid fjord
#

a

slate flume
#

Python abstracts more than C#

#

Which abstracts more than C

upper vapor
#

Yes, Python is generally considered a higher-level programming language than C#.

Here's why:

  • Abstraction: Python offers a higher level of abstraction from the underlying hardware. You don't need to worry as much about memory management, pointers, or low-level system details. C#, while also abstracting away much of the hardware, still gives you more direct control over these aspects.
  • Syntax and Readability: Python's syntax is often described as more natural and closer to human language, making it easier to read and write. C# syntax is more verbose and explicitly typed.
  • Memory Management: Python uses automatic garbage collection, meaning you don't manually allocate or deallocate memory. C# also has automatic garbage collection, but it provides more options for direct memory manipulation when needed.
  • Development Speed: Due to its simplicity, extensive libraries, and dynamic typing, Python often allows for faster development and prototyping. C# can also be fast for development, especially with tools like Visual Studio, but Python generally has an edge in rapid development.
  • Type System: Python is dynamically typed, meaning type checking happens at runtime. C# is statically typed, meaning type checking happens at compile time, which can catch errors earlier but also adds more boilerplate code.

While both are powerful and widely used languages, Python typically sits at a higher level of abstraction compared to C#.

#

gemini said so

#

and i ahte it

restive turret
#

Thanks AI

#

But

upper vapor
#

should've asked it t gaslight me toomuchtrolling

royal mica
#

using AI eww

restive turret
#

I do not car

upper vapor
#

please do not the car

slate flume
#

I love it when AI says I'm right

#

I'm so cool 😎

restive turret
#

Gaslighting

slate flume
#

I rarely ever get shit right

upper vapor
#

it's no match for natural stupidity though

slate flume
#

This is so true

royal mica
#

A high-level programming language is a programming language with strong abstraction from the details of the computer. In contrast to low-level programming languages, it may use natural language elements, be easier to use, or may automate (or even hide entirely) significant areas of computing systems (e.g. memory management), making the process o...

slate flume
#

It doesn't say you can't have hierarchies within the levels

restive turret
#

What about medium level

royal mica
#

It defines the distinction between high and low level yes

restive turret
#

Or legendary level

#

Or congratulation level

upper vapor
#

-# several people are typing

upper vapor
restive turret
#

#~ me yapping

slate flume
#

A language can be considered "higher level" than another language based on how much it abstracts

royal mica
#

So wait, where would you put brainfuck then

slate flume
#

Brainfuck is lower level because it abstracts less

royal mica
#

(not a joke, just a random thought as a good example)

slate flume
#

The more abstraction, the higher level

royal mica
#

it abstracts less?

slate flume
#

Yes

upper vapor
royal mica
#

brainfuck doesn't have memory or stack manipulation

restive turret
#

<<>>[[[]][[

upper vapor
#

what about jsfuck

royal mica
#

but it is a very primitive language, it is a high level one

restive turret
slate flume
#

Yes but it has less abstraction

#

Vs python

upper vapor
restive turret
slate flume
#

It's not that it's low level

#

But it's lower level

#

"High-level languages intend to provide features that standardize common tasks, permit rich debugging, and maintain architectural agnosticism; while low-level languages often produce more efficient code through optimization for a specific system architecture. Abstraction penalty is the cost that high-level programming techniques pay for being unable to optimize performance or use certain hardware because they don't take advantage of certain low-level architectural resources."

#

From the wiki article you gave

restive turret
#

Ok chatgpt

slate flume
#

That's wikipedia

#

In brainfuck you have to make functions to do simple tasks

#

In python you can just do those simple tasks

#

Python has more abstraction

upper vapor
severe cave
royal mica
#

there are no functions in brainfuck

slate flume
upper vapor
#

mfing gta cheat code moves

royal mica
#

let me find a better language than brainfuck for a good example

upper vapor
#

what about malbolge

slate flume
#

It's very interesting

#

Might take me a while to find though

restive turret
slate flume
#

^

severe cave
slate flume
#

Literally never heard of malbolge

upper vapor
#

bugyor of hell

#

like a uh

royal mica
#

malbolge is fuuun

upper vapor
#

part

#

of hell

royal mica
#
(=<`#9]~6ZY327Uv4-QsqpMn&+Ij"'E%e{Ab~w=_:]Kw%o44Uqp0/Q?xNvL:`H%c#DD2^WV>gY;dts76qKJImZkj

This is hello world

slate flume
#

Im a little confused as to why saying python is higher-level than C# sparked such a debate

#

I thought it was general nomenclature to call a language "higher-level" if it abstracts more

severe cave
slate flume
#

Considering the original distinction between high and low level is all about how much it abstracts

royal mica
#

It is the intention of it

#

kinda like an art piece

severe cave
#

Dont understand why people do that

royal mica
#

Novelty, art piecce, fun

slate flume
#

^

#

It's like

#

I made automated systems in No Man's Sky

#

And I optimize builds in Mindustry

#

In a way that's very similar to what people get out of working with these dumb programming languages

rare wolf
#

I can serialize a vector3 right?

slate flume
#

There's not really a productive result from it, it's just cool and fun

rare wolf
#

just checking

restive turret
rare wolf
#

thxs

upper vapor
slate flume
#

If I'm being so honest, I don't actually know what serialization is

#

I don't know what yml is lmao

upper vapor
restive turret
#

πŸ’€

upper vapor
#

like a file

#

binary

#

serialization

restive turret
#

usually data -> blob

upper vapor
#

turns anything sequenced thingy basically
deserialization is the opposite

slate flume
#

Why is it a question if you can serialize a Vector3? At some level you can always write data to a file

upper vapor
#

json, yml, binary, etc etc

restive turret
#

NW made a ser for it

unique crane
severe cave
#

Whats the syntax for printing?

restive turret
#

because apparently Unity missed to add [Serialiuble] or whaetever

slate flume
#

So the game has built-in serialization to write data to files that didn't include Vector3 but now does?

unique crane
#

You have to add your own serializers to yaml builder

upper vapor
slate flume
#

Okay

#

Makes sense

restive turret
upper vapor
#

not in the default config..?

slate flume
#

I learned something new today :)

restive turret
#

not

slate flume
#

I love learning new things!

restive turret
#

that in NW

restive turret
#

learn deez

severe cave
unique crane
#

I cant select correct msg ffs

restive turret
#

i wanna edit the config to use kind of same as in C# name

#

like

#

longClassNameWithThesesTuff

#

rather than ___

slate flume
#

Wait

#

Would it be possible to allow 3114 to strangle other SCPs?

restive turret
#

Β―_(ツ)_/Β―

#

prob has client check

#

and 3114 doesnt have any labapi events yet

grand flower
#

3114 isn't even stable

slate flume
#

I was able to patch in 3114 damaging other SCPs but I forgot if I gave up on making him strangle others because it was impossible or if it was just because I was lazy

obtuse spruce
#

is it possible to destroy clutter in Hcz ?

slate flume
#

Ofc

#

There's a clutter generator

hearty shard
#

like random boxes

slate flume
#

Oh

#

Yeah probably not

hearty shard
#

i dont remember how they work

rare wolf
#

ok am i like crazy i thought roletypeid was in Assembly-CSharp

slate flume
#

Pretty sure those are baked into the rooms

hearty shard
#

ur just bad

slate flume
#

^

hearty shard
#

theyre apart of a clutter system

#

well

rare wolf
#

grrrr

hearty shard
#

some of them

#

u issue

rare wolf
#

meanie

slate flume
upper vapor
#

check your reference paths

rare wolf
#

it is i just checked it twice

upper vapor
#

show

rare wolf
#

<Reference Include="Assembly-CSharp_publicized">
<HintPath>$(EXILED_REFERENCES)\Assembly-CSharp_publicized.dll</HintPath>
</Reference>

upper vapor
#

do you have a publicized one?

slate flume
#

Hm

rare wolf
slate flume
#

I wonder

rare wolf
#

oh my fucking god

upper vapor
#

and is the EXILED_REFERENCES env var set properly?

rare wolf
#

0kb

upper vapor
rare wolf
#

😭

#

can i have someones

slate flume
#

Haha

rare wolf
#

mine didnt work ig

slate flume
#

Just

#

Bepinex

rare wolf
#

thats what i did

slate flume
#

Assembly publicizer

rare wolf
#

oml

upper vapor
#

publicized

upper vapor
rare wolf
#

THATS WHAT I DID

upper vapor
#

msbuild publicizer

rare wolf
#

GRRRR

upper vapor
hearty shard
#

willow

#

im going to beat u up

upper vapor
#

don't hurt my fellow proot

slate flume
#

So

hearty shard
#

proto NERDS

upper vapor
slate flume
#

Lmao real

hearty shard
upper vapor
#

eve: "look at all these nerds"

slate flume
#

I helped my friend build a protogen costume but I still make fun of him because it's funny

upper vapor
#

bagoly mondja verΓ©bnek πŸ™„

slate flume
#

Yes

#

Exactly

upper vapor
#

omgggg

#

did you use a raspberry pi

slate flume
#

Yes

upper vapor
slate flume
#

It was all DIY shit

upper vapor
#

"here, furry shit"
"look at you, stupid furry"

slate flume
#

Scavenged some LED panels and a raspberry pi

slate flume
#

Including myself

upper vapor
upper vapor
#

-# not that much but eh

slate flume
#
#

It was Adafruit 32x64

#

We had two panels that we wired for each side

upper vapor
#

oh adafruit

#

familiar name

#

-# never bought anything ffrom them

slate flume
#

The panels are eh

#

They're a little jittery

#

I'm not sure if that's the panel's fault or the raspberry pi or the program I used

#

But 🀷

#

At least it works

slate flume
upper vapor
slate flume
#

Yeah you're right

#

It's barely noticeable though so it's cool

slate flume
#

I just enjoy helping people with stuff, especially friends

#

As much as I have a deprecating sense of humor, I think people are great

unique crane
#

Hai

slate flume
#

Hi david

#

:)

#

I know you weren't saying hi to me but I wanted to be included

unique crane
#

Hai

#

Stone statue

restive turret
#

πŸ’€

rare wolf
slate flume
#

It's very much appreciated

unique crane
unique crane
#

your like the first one to ever say that

rare wolf
#

am guddd :3 wbu

unique crane
#

got maturita

#

4 months of freedom

#

then Czech Technical University

slate flume
# unique crane Thank you

Ofc! I see you here and on the LabAPI issues and shit and I know it takes a lot of effort outside of your daily life to keep up with it all

hearty shard
rare wolf
restive turret
#

definitly not gonna suffer

unique crane
#

nah

upper vapor
slate flume
#

Love that guy

grand flower
#

Can you control spawn locations of generators

#

or are they tied to map gen

hearty shard
#

theyre network objects

upper vapor
#

you can even spawn new ones

hearty shard
#

so you can just spawn new ones

#

yeah

grand flower
#

sweet

hearty shard
#

also it will adjust the generator count dynamically

#

for announcements

#

1 out of 100 generators activated trolling

grand flower
#

I just wanna prevent certain spots from being used because they're hell to defend for 079/Puppet (on Bright's)

upper vapor
#

i miss "5 out of 5 generators activated. All generators have been successfully engaged. SCP-079 recontainment sequence commencing. Heavy Containment Zone overcharge in T-1 minute." Heartbreaking

slate flume
#

So uh

#

Map gen made easier yet?

grand flower
#

Any with a ton of blind spots/close quarters

#

939, servers etc

hearty shard
#

damn

#

add one to surface

slate flume
#

^

#

Peak

grand flower
#

players will generally tend to have an explosive jailbird/particle disruptor prepped to obliterate Puppet

unique crane
#

what

grand flower
#

Modded server

#

SCP-079 picks a player to become Puppet

#

Pinging teleports the player to the ping location

#

Pinging Puppet heals it

hearty shard
grand flower
#

Puppet has 1000 HP, increases every time 079 tiers up

hearty shard
#

i didnt know this guh

grand flower
#

LMAO

#

yeah no it heals

#

it's the only way it can heal

hearty shard
#

i havent played doctor brights more than 4 times tbf

grand flower
#

tons of changes CatJam

#

I reworked all of the underperfoming SCPs

#

096 especially, poor thing really wasn't built to be the lone SCP in base game

#

So now it's smaller when docile so it can go under players to enrage, and it gets varying speed boosts

#

(thanks @unique crane for the scale stuff)

#

it's actually super fun

#

also made it so "Try Not To Cry" gives it the Invisible effect

#

you can still hear 096 but not see it

upper vapor
#

so goofy

grand flower
#

096 charge still spawns grenades

#

although we had to reduce the count a while back

slate flume
#

It was basic though

#

Nothing crazy

grand flower
#

Mayhem has only one SCP per round so we had to buff them a ton

#

48 player servers give most SCPs over 10k hp

slate flume
#

I got to add 3114 last stand stuff

#

That was fun

#

One of my favorites to play

grand flower
#

Is there a way to get all spawn locations of generators

hearty shard
#

yes..

#

should be i just

#

forgot the method

upper vapor
#

theres a spawnpointsomething class

#

StructureSpawnpoint

grand flower
#

sweet ty

icy knoll
#

I love having to make this because I can still get a NRE from the try somehow 😭

hearty shard
#

u sure .Value isnt null ?

icy knoll
#

if i do == null rider says "can never be null"

#

full on crashes out

hearty shard
#

what is SyncTarget actually

#

its struct right

icy knoll
#

StrangleTarget

#

yeah

#

struct

hearty shard
#

use HasValue

icy knoll
#

still throws NRE :3

hearty shard
icy knoll
#

hmm

#

rider

#

very nice

#

is not not null

hearty shard
#

SyncTarget.HasValue replaces == null check

#

or should

#

oh

#

nvm maybe

icy knoll
#

yeah lol

#

it's super weird

hearty shard
#

me when you moment

icy knoll
#

hey this isn't me!

restive turret
#

eve moment

upper vapor
#

What if Strangle is null

icy knoll
hearty shard
icy knoll
#

Scp3114Role::SubroutineModule

#

just incase it's null then smh

hearty shard
#

unity life check forms dont work on null objects that dont exist

icy knoll
#

rider keeps on telling me to change it

#

lol

hearty shard
#

shrug

#

try

#

well

#

!= null

icy knoll
#

yeah

#

ill just add those

upper vapor
hearty shard
#

that too

icy knoll
#

that's a lot better

hearty shard
upper vapor
#

Yeah

icy knoll
#

okie back to unity life check

upper vapor
hearty shard
#

i thought when an object is straight up just null and not initialized unity wouldnt be able to do that

upper vapor
hearty shard
#

damn

upper vapor
#

With a lifetime check

#

Like

#

The null comparison does the lifetime check

restive turret
#

Cant change MicroHID Energy state on pickup?

upper vapor
#

Energy module?

#

Use the template and sync the thingy

unique crane
#

Yea ^

restive turret
#

template my ass

#

thanks

upper vapor
#

😭

unique crane
#

Weird request

restive turret
#

call fro the templates

#

could have just put a static on SetEnergy since it doesnt even need to do much

#

😭

signal steeple
#

Has anyone had success decoding voice packets and writing them out to a wav file? Every time I try I get heavily distorted, robotic sounding audio.

upper vapor
upper vapor
#

Not sure if you're allowed to do that

signal steeple
#

Not planning to use it on a live server, just doing it for fun

upper vapor
#

As I you're not allowed

signal steeple
#

VSR doesn't allow it, I see no problem if I'm not running the code on a verified server

upper vapor
upper vapor
#

Fair

#

Use the built-in OpusDecoder

#

Then you need to write the wave file

#

You can keep the stream open and write data whenever available

signal steeple
#

I've been trying to, I'm simply decoding the packet that comes in, then using NAudio to write the float samples to a wav file

#

It just comes out sounding terrible

signal steeple
#

Yeah

upper vapor
#

Finally someone who knows about that library 😭

#

How do you decode the packets

signal steeple
#
float[] buffer = new float[24000];
OpusDecoder decoder = new OpusDecoder();
int len = decoder.Decode(ev.Message.Data, ev.Message.DataLength, buffer);```
#

Using 24000 because the game uses it for the buffer size too πŸ€·β€β™‚οΈ

upper vapor
#

Should work
Then write the buffer to the file with len

grand flower
#

Cyanox spotted

signal steeple
#

Yeah, it writes out some semblance of the voice, you can clearly make out what's being said, but it's half speed and robotic

upper vapor
#

What's the format you're writing

#

Should be 48 kHz mono

signal steeple
#

Yup

#

new WaveFormat(48000, 1)

upper vapor
#

Uh no

#

Use WaveFormat.CreateIeeeFormat

signal steeple
#

Tried that too, that just produced static noise

upper vapor
#

Bruh

#

Nvm then

#

Wait...

viral rivet
#

when i try to set the event OnPlayerPickingUpItem IsAllowed=false for a specific user the others can't take the item, why?

upper vapor
viral rivet
#

thanks

upper vapor
upper vapor
unique crane
#

So we add it to the wrapper

restive turret
#

ye i might

unique crane
#

No not

#

"might"

#

do it

#

Im gonna forget about it

#

otherwise

restive turret
#

#196 done

#

have fun david

#

I would be very happy and thankful for it

signal steeple
upper vapor
#

what if you write a sine wave

#

how do you write data exactly

signal steeple
#

Here's my full code atm, ignore the structure and buffer inefficiency, it's just for testing

public static OpusDecoder Decoder = new OpusDecoder();
private static FileStream fw = new FileStream("test.wav", FileMode.Create);
static WaveFileWriter writer = new WaveFileWriter(fw, new WaveFormat(48000, 1));

public override void OnPlayerReceivingVoiceMessage(PlayerReceivingVoiceMessageEventArgs ev)
{
    float[] buffer = new float[24000];
    int len = Decoder.Decode(ev.Message.Data, ev.Message.DataLength, buffer);
    writer.WriteSamples(buffer, 0, len);
}

// just saving the file when round start is triggered because im too lazy to write a command
public override void OnServerRoundStarted()
{
    writer.Dispose();
    fw.Dispose();
}```
upper vapor
#

buffer reallocation 😭

signal steeple
#

shhh

upper vapor
#

WaveFileWriter.CreateFile

signal steeple
#

I threw this together in 1 minute for testing this

upper vapor
#

how about that

signal steeple
#

Not seeing that as a function

upper vapor
#

new wavefilewriter with path arg?

signal steeple
#

Oh it's static

upper vapor
#

yeah

signal steeple
#

Again, I don't know that changing the function I'm using for writing the file would fix it, I doubt it's the library's fault. Am I decoding the audio from the game incorrectly?

grand flower
#

uh sec

#

wait nvm

#

the player wouldn't receive their own voice message

#

thought the event might be firing multiple times

upper vapor
#

bru

#

you should do that in the sending event

grand flower
#

^ yeah

signal steeple
#

wait.

#

why am i doing this in the receiving event

grand flower
#

on an empty server though it shouldn't matter

#

unless the event is called for like

signal steeple
#

But why is the player receiving their own voice packets?

grand flower
#

the player sending the voice message as well

#

the host player probs

#

unless it really is you

#

in this case it might be called twice per voice packet

#

which might cause the issue you have

signal steeple
#

For some reason I was thinking this was the server's POV, like when the server receives a voice message from the client lol

grand flower
#

oh yeah it does call for yourself

#

we had that bug after a fix where Puppet would hear its own voice

#

I think at least

upper vapor
#

😭

warped prairie
#

sorry to interrupt and idk if this is the right place to ask. but quick question. has NW auth servers been having issues recently or just me?

upper vapor
#

try restarting steam

signal steeple
upper vapor
#

uh

warped prairie
#

no im talkin serverside

grand flower
#

yes

upper vapor
#

nvm

grand flower
#

that's serverside

signal steeple
#

Yeah server rejected my auth

#

But my game crashed too kek

grand flower
#

central servers run on a potato

warped prairie
#

like whole server of 25 just got kicked on round restart bc auth didnt work killing it

grand flower
#

welcome to SL

signal steeple
#

Happens PeepoShrug

grand flower
#

hope you like your stay

warped prairie
#

oof. that sucks

#

killed our server in one swift stroke Sadge

signal steeple
#

I can't even test now ClassDSadge

signal steeple
upper vapor
#

offline mode

grand flower
#

Still got no idea why they're even a thing

#

sure discord auth (but that's gone) and patreon (why route auth through it for that though, just link your account and have the servers communicate for badges idk)

signal steeple
#

Switching the event worked...

#

Sounds perfect now

signal steeple
#

Well thank you for the help anyways @upper vapor!

upper vapor
#

np

#

thank Cyn for spotting the event lol

#

i didn't pay attention to that

signal steeple
#

Me neither lmao

upper vapor
#

πŸ‘€

limber silo
#

oh help why is that public

icy knoll
#

when new version on nuget?

icy knoll
limber silo
#

isnt the newest version in nuget?

icy knoll
#

also i got an email about my pr

icy knoll
#

still 1.0.2

#

we've been spam pinging you and beryl for ages 😭

upper vapor
limber silo
#

I just got the role and the project was completely paused, dont expect an update soon soon

#

too much to do

#

but we will get there

limber silo
icy knoll
#

yup

#

1.1.0

limber silo
#

okay welp ill get that done

icy knoll
#

tysm jesus!

upper vapor
limber silo
#

no worries, trying to get the project back on track

restive turret
#

Jesus

upper vapor
#

yes

icy knoll
#

cooked

restive turret
#

Yup

restive turret
unique crane
#

We are so APIback

restive turret
#

Anyway i believe in you all!

upper vapor
#

david can get anything merged

icy knoll
#

eve will still blame david for the delay tho

restive turret
hearty shard
unique crane
#

well I didnt expect that one

icy knoll
#

first time for everything

#

it's the QA testers fault

#

well

#

actually

#

it could be

unique crane
#

what

icy knoll
#

me not doing QA tests

#

could delay

#

Β―_(ツ)_/Β―

unique crane
#

Thats not the delay at all

upper vapor
hearty shard
#

David its okay

unique crane
#

they were all QA tested quite some time ago

hearty shard
#

For once its not ur fault

#

It was Lumis

unique crane
#

Can we all agree its eve's fault?

hearty shard
#

Heart breaking

#

No

unique crane
#

Yes

hearty shard
#

Thats homophobic

icy knoll
upper vapor
unique crane
icy knoll
true cedar
limber silo
#

okay well there we go, that was kinda annoying to do since I merged stuff but master should have 1.1.0

#

I need to wait to get the nuget package signed

icy knoll
#

tysm jesus!

limber silo
#

and ill update it

#

no worries

#

let me know if this ever happens again

#

feel free to ping me

grand flower
#

sweet

#

ty

#

I replied to your comment on my PR

#

But the gist of it is that we have to use delays a bunch in SL

limber silo
#

need to do smt real quick

restive turret
#

Or a 100 of

grand flower
#

I only have one open PR

#

issues, that's something else

restive turret
#

Oh pr

#

Ye

#

πŸ”₯ glasses off and instantly can't read shit

lethal cradle
plain gazelle
#

@teal junco @upper vapor
Thanks for the info, but yeah sadly i was looking for a way to have (almost) no delay of the primitive moving with the body :/
And yeah, atm we just update the position of the primitive each frame ,_,

grand flower
#

Clients will receive the update for the primitive on the same frame as the player's position

#

As long as you update it every frame

hexed girder
#

Hii, how can I access for example the serialLabel of a Custom Keycard that I have in my inventory?

grand flower
#

So we've disabled collisions between items to help with server lag

#

However, this has had the unfortunate side effect of causing immense lag when armor is inside other armor

#

If you respawn the entire server at your position and everyone dies instantly, it's 48 armor sets overlapping with each other

#

Which seems to cause issues in BodyArmorPickup.OnTriggerStay

#

165 FPS at the start. 30 now

#

the method checks if the item is armor, but at the very end

#

Would it be possible to have the check be placed at the start considering it's cheaper than most of the other checks?

#
    if (other.gameObject.layer != 9 || (double) Vector3.Dot(Vector3.up, this.transform.right) > -0.800000011920929 || !other.transform.root.TryGetComponent<ItemPickupBase>(out component) || (double) component.Info.WeightKg > 2.0999999046325684 || !this._alreadyMovedPickups.Add(component.Info.Serial) || !InventoryItemLoader.AvailableItems.TryGetValue(component.Info.ItemId, out itemBase) || itemBase.Category == ItemCategory.Armor)
      return;
#

!InventoryItemLoader.AvailableItems.TryGetValue(component.Info.ItemId, out itemBase) || itemBase.Category == ItemCategory.Armor

#

Not that I think this would fix the performance that much anyway

#

The fact overlaps trigger already tanks it so we're probably going to have to re-enable item collision

true cedar
grand flower
#

no clue

#

probably to push items that don't collide with it or something

true cedar
#

where do you disable collisions

grand flower
#
    public override void OnServerRoundStarted()
    {
        if (Plugin.Instance.PluginConfig.DisableItemCollision)
        {
            Physics.IgnoreLayerCollision(9, 9, true);
            Physics.IgnoreLayerCollision(20, 9, true);
        }
    }
true cedar
#

is it not possible to just enable collisions for armor only

grand flower
#

need to check their layer again

#

nah

#

it's the same as the other items

#

so can't selectively make them collide with armor

true cedar
#

can u disable collisions for a specific item

grand flower
#

maaaaaaaybe

#

maybe if I modify the item prefab

#

but i can't be arsed to deal with this right now so re-enabling item collision will suffice

true cedar
#

well

carmine prawn
restive turret
#

Cabinet

carmine prawn
#

Is Pickup.Creat() work normal?

#

even only Pickup.Create(ItemType.Lantern, player!. Position); nor does it show any items

icy knoll
#

you probably aren’t doing Pickup::Spawn()

carmine prawn
#

I think so

#

yep

#

it's kind of...

#

not intuitive?

royal mica
#

Think of .Create as a prepare method

#

sometimes you only want to create an instance you want to spawn on-demand, instead of instant spawning

#

setting properties before spawning for example also

restive turret
#

Create a PR adding
bool Spawn = true in the create

royal mica
#

i love breaking changes

restive turret
#

LabApi is full of it

unique crane
#

There are changes in progress to make this more clear

restive turret
#

Yippe

#

Thanks David

#

The labAPI-est of them all

upper vapor
upper vapor
#

i forgot that i renamed the file 😭