#plugins-dev-chat

1 messages · Page 121 of 1

grand flower
#

Doesn't matter

celest thorn
grand flower
#

Your reliability layer handles ordering

#

Oh

#

I'm tipsy ignore me sorry lmao

celest thorn
#

hope you have a great night

grand flower
#

Going great

celest thorn
#

just don't drink too much

grand flower
#

Oh I'm already home

#

I don't drink much anyway

slate flume
#

I also think it's weird that mirror is having such a problem handling destroy messages for like 10 objects

celest thorn
slate flume
#

Why would Mirror struggle so much to handle a small amount of packets

grand flower
#

If I worked at NW I'd be blackout drunk right now

slate flume
celest thorn
grand flower
celest thorn
#

but i've seen its a problem

grand flower
#

You have the entire game on top

celest thorn
grand flower
#

And SL abuses network messages like crazy

celest thorn
#

its handling the guns

grand flower
#

For everything

celest thorn
#

autosync

grand flower
#

Which is insane

celest thorn
#

objects

#

your feets moving

#

networked objects

grand flower
#

Everything is a network message

celest thorn
#

rats that don't work

upper vapor
grand flower
#

SyncVars are barely used it makes me cry

celest thorn
#

audio messages

upper vapor
#

😭

slate flume
celest thorn
grand flower
upper vapor
#

CurrentSample sync var

celest thorn
#

because who tf wants to listen to that audio

grand flower
#

Or yeah clientside would work

#

If we had clientside mods

upper vapor
grand flower
#

You're not supposed to do stateful stuff with them in most cases

grand flower
#

SyncVars are networked properties, Mirror handles sending them when they change to clients that should have them

#

With proper filtering the networking side would be a lot lighter

#

Idk if Mirror does the same thing Unreal does with networked properties where they're unreliable and only updated for clients at an interval

#

Meaning if the server changes the value of a networked property multiple times, it doesn't send it multiple times

unique crane
#

Mirror is reliable

#

By default

celest thorn
#

the desk

grand flower
#

Just the latest value when it networks the property

celest thorn
#

etc...

slate flume
#

The main thing is the syncvar sends delta messages and network messages don't, right? So it requires resending all the data rather than just what's changed

upper vapor
slate flume
#

It also doesn't resend a message if the info is the same?

grand flower
# unique crane Mirror is reliable

For networked properties, Unreal operates under "eventual consistency" where the client will eventually match the server. You won't get every value the server had if it updates them too fast, making it cheaper for bandwidth

upper vapor
grand flower
#

Unreal sends the property again if the client doesn't ack receiving it

upper vapor
#

If the value hasn't changed on the server

celest thorn
#

honestly guys

#

lets make sl 2.0

slate flume
#

God damn I hate this game sometimes

upper vapor
#

Hence dirty bits

unique crane
#

Mirror client can request the message again if it's reliable and the message number mismatch or something

slate flume
#

I just wanna be able to destroy an object and have it fucking destroy

celest thorn
#

Btw what could be done? to fix this issue

#

i really do wonder

slate flume
grand flower
#

I'm more talking about SL's abuse of networked messages

#

To send stateful data

hearty shard
#

Basically

grand flower
#

Like weapon attachments, states, jailbird charges etc

#

Wearable sync

hearty shard
#

Early server builds don't get told w pings in game announcements
Its said in server host announcements

grand flower
#

A lot more I don't have off the top of my head

#

Oh role info

upper vapor
slate flume
celest thorn
#

remember

#

that you even saw it

#

happen

slate flume
#

.

upper vapor
#

Too many destroy messages = nothing?

celest thorn
#

mirror doesn't do anything

upper vapor
#

I love discord sm

celest thorn
#

nor register it

grand flower
#

Fun

upper vapor
#

Guys just parent your objects

celest thorn
#

in my case

slate flume
#

The thing is I'm only sending like 10 messages and it makes me sad that it can't even handle that

upper vapor
#

It's not that difficult

celest thorn
#

mirror says "its already destroyed"

slate flume
celest thorn
#

but i do see it

slate flume
#

All my waypoint toys are moving in separate ways attached to separate players

upper vapor
slate flume
#

😭

upper vapor
slate flume
#

Then fuck me I guess

#

I have no other way to smoothly move a player

#

Well besides changing their gravity but then I'd have to put them in the air and that sounds really stupid

#

I made a LabAPI request about it

upper vapor
#

I guess what you could do is

  1. Fake sync the priority, player's own waypoint would be like 479399
  2. Patch the DistanceTo method and return some very small number if it's to the owner
#

(Random number for dramatic effect)

slate flume
#

What if I just fake sync the existence of the waypoint toy

#

Wait no the server still validates

slate flume
#

Also you know

#

I have never seen SL use a sync var

#

That's odd, right?

upper vapor
#

Impossible

#

Admin toys

#

Almost everything is a sync var there

#

MainBoolsSync

slate flume
#

Oh fire

#

I've never really rooted the admin toys code

upper vapor
slate flume
#

But wouldn't it be validated by the server

#

Like if the actual priority is smaller the server would say the player is somewhere else than the client says

#

SL really needs to have validation for things like fucking destroying objects

#

Seems pretty important to me but idk

#

Have the client send a response to the server acknowledging that it received the message and resend it if it didn't or some shit

#

Or maybe don't clog the bandwidth

worthy rune
#

destroy should be on the reliable ordered channel

celest thorn
#

but sometimes stuff doesn't get deleted

#

even tho i do scream to delete it

worthy rune
#

i haven't experienced that myself

slate flume
upper vapor
slate flume
upper vapor
#

Yes
You replicate what the client does based on the priority sync var

#

SqrDistanceTo

worthy rune
#

until very recently almost all mirror network traffic was going through the reliable ordered channel(this includes stuff like movement/VC, which is bad btw) the only exception was the timestamp(cound have a different name i forgot?) message that mirror sends constantly

slate flume
#

And instead of thinking to delay it and send it later it just... doesn't send it?

upper vapor
#

Dirty bits are used to determine which values changed and only those values are sent to clients

#

Then it clears the dirty bits

#

So if you don't change the value on the server, it won't be sent to the client

slate flume
#

Yeah but my point stands

#

You're saying that I can emulate what the client does
If that is possible then that means somewhere along the way, Mirror is choosing not to send my message

#

Rather than the actual packet being lost or dropped

#

Because otherwise you wouldn't be able to figure out what packets are lost

upper vapor
#

You don't set the value on the server

slate flume
#

I'm so confused as to what you're on about

#

I'm saying if destroy messages are being lost, one option is they should have a handshake with the server to validate receive and resend the message if not

#

You're saying I can do that

#

I'm trying to explain the questions I have about it and you're giving complete non-answers

#

I don't really know how much clearer I need to state my comments and queries

#

I apologize if I'm coming across as rude but I keep having the issue where I ask a question and someone answers it in an authoritative manner, but completely doesn't answer my question

#

It's happened multiple times in the past days

#

If I'm wrong about the relevancy of what you're saying then elaborate past some surface-level comment

worthy rune
slate flume
#

So it's either the WaypointToys for an item I have aren't destroyed properly or there's another different issue causing players to glitch around

worthy rune
#

i see

#

do you spawn any doors dynamically(i.e. spawn/destroy them after map generation)

#

ahh i just watched the video

#

its not anything todo with what anyone here is saying

#

its a base game issue thats known about

#

and its probably todo with roles not disabling on the client properly(which i think there was a fix for 14.1.4?, would have to double check that)

slate flume
#

I appreciate it a lot Riptide thank you so much for helping me out

worthy rune
#

no worries

restive turret
upper vapor
upper vapor
restive turret
#

🍇

upper vapor
#

Hopefully it's fixed in this update (probably not)

slate flume
upper vapor
#

So waypoints don't shit themselves when deleting

slate flume
#

They already implemented one of my suggestions

#

I'm excited to see if they do more

restive turret
slate flume
upper vapor
restive turret
#

ah

upper vapor
#

If only I knew a week ago that it'd be implemented

slate flume
#

I had to learn Opus Encoding just to decode, increase the gain, and then re-encode

#

I mean gain and volume aren't exactly the same

worthy rune
slate flume
grand flower
#

tbh you could always spawn multiple speakertoys with the same controller id to increase the volume mmLul

slate flume
#

Thanks for the idea for SqrDistanceTo @upper vapor I'm writing myself a note to check it later

worthy rune
#

yeah xD

upper vapor
slate flume
worthy rune
#

base game issue is todo with disabling roles

worthy rune
#

which is client sided

#

role fails to disable, causing it to be linked to a waypoint when it shouldnt be

#

it has nothing todo with destroying waypoints, that works fine afaik

upper vapor
#

I spent hours implementing an apparently realistic volume control

slate flume
#

It's pre-amp vs post-amp essentially

restive turret
slate flume
#

The only difference is clipping

upper vapor
#

Ik it's not supposed to be linear but like... 😭
It sounds the same

worthy rune
upper vapor
#

It probably forgor

upper vapor
#

What the helly

#

What formula is the conversion

#

Cuz I've only seen logarithmic operations which seem... not.. correct

worthy rune
#

what are you trying todo exactly

upper vapor
#

Amplifying speaker toys

slate flume
upper vapor
#

Yeah

#

But we ain't decibeling
So what else is there

#

* sqrt(2)?

slate flume
worthy rune
#

just multiply each sample

upper vapor
#

(Supposedly)

worthy rune
#

you can use decibles if you want, all its doing is finding the factor you multiply by

slate flume
worthy rune
#

your mixing decibels(which is concept for determining how human's preceive sounds) and amplification which just an algorithm. these are seperate concepts and dont have anything todo with eachother

slate flume
#

The way the human ear perceives audio in terms of multiplicative loudness is generally very broad

#

Volume and gain do the same thing, just one applies pre-amp, and the other applies post-amp

upper vapor
#

My volume control isn't in decibels though
It's a stupid 0-100% range cuz that's what people are used to

worthy rune
#

yeah just multiply that range on each sample

#

you dont have todo anything relating to log or what ever

slate flume
#

Volume and gain apply the same way afaik

upper vapor
slate flume
upper vapor
#

Maybe I'm talking about a non-issue

slate flume
upper vapor
#

I just understood

#

Slow brain

#

Me

slate flume
#

The only difference is one causes clipping and the other doesn't essentially

#

And dw it happens to the best of us

unique crane
#

Me when decibel scale is logaritmic

upper vapor
#

Me when we don't want decibels

unique crane
#

Then use volume markiplier

upper vapor
#

Xd

upper vapor
#

Was that 7????

#

😱

celest thorn
restive turret
#

zero, are u avlbl?

upper vapor
#

Övéjlöböl

restive turret
#

oh yes, I got the same fucking issue as the other guys who made multiple command handle on the command

#

😭

#

14.1.4 issue too

celest thorn
restive turret
#

to test

celest thorn
#

to test what?

restive turret
#

if my fake role sync even works

celest thorn
#

i have no problem

#

but 20k for qa testing

#

(im joking)

slate flume
restive turret
slate flume
#

But like for fake role sync testing I just had it activate when a player shot a weapon rather than having them run a command

#

Allows me to test faster and easier

#

Especially when using dummies

#

I think setting up a command for it is doing too much

restive turret
#

david

unique crane
#

slejmur

restive turret
#

even labapi has this bug 😭

hearty shard
#

skull

unique crane
#

I dont remember any of you submitting an issue about it

hearty shard
#

i do my commands manually so im safe Trol

restive turret
unique crane
#

?

restive turret
#

I recently got into this and other people had this issue but i dont know if they reported it

#

i guess not

slate flume
restive turret
#

#273

#

Multiple CommandHandler only register first

slate flume
#

Lemme read the issue

#

Oh it's not open yet

#

I have no idea what your problem is lol

upper vapor
#

Use my command system toomuchtrolling

hearty shard
slate flume
#

Oh gotcha

#

We need to have some developers go back to English class so they can actually articulate their points outside of like 4 word sentences lmao

#

Yeah interesting I've never noticed that

restive turret
slate flume
#

I'm not going to apologize for doing my due diligence

#

If more people fact checked themselves we would have less misinformation in the world

#

As a newer plugin dev I wanted to make sure I was right in my assumption that a LabAPI update means a new game release because I expected that if they were correlated there would be some kind of announcement to the non-developers that there will be an update soon

#

In short, L bozo at least I know how to articulate my points and double check information before spouting it as fact

upper vapor
slate flume
#

On the original topic, I'd be interested to test it myself because the in-game commands use multiple CommandHandler attributes and afaik they work just fine

hearty shard
slate flume
#

Why not recycle the already working shit

hearty shard
#

99% sure basegame auto creates the method calls needed

#

to register

#

which doesnt work unless every plugin also creates that

unique crane
#

Would be pretty epic ngl

#

Like auto parsing the arguments

upper vapor
#

I'm not sure how it's...

#

Nope xd

#

Not yet

#

OMG I'M DARK

hearty shard
#

@slate flume

upper vapor
#

Like my soul

unique crane
slate flume
#

Still leaves the question

restive turret
hearty shard
worthy rune
#

base game also doesnt support using the attribute to register to other parent commands, only the base handlers work

hearty shard
#

it uses source generator afaik

unique crane
slate flume
#

Why not just Instance.RegisterCommand(command)

unique crane
#

weaved

slate flume
#

So it uses reflection

unique crane
#

No

#

Its auto generated

#

after compilation

#

Just like mirror generates its own stuff

#

command system does this

restive turret
#

time to fuck up my game trying to fix the command system stuff

hearty shard
#

oh...

#

i love gameobject being nullable...

#

yum

restive turret
#

add ?

hearty shard
#

possible null return

upper vapor
hearty shard
#

its horrifying

restive turret
upper vapor
#

HI RIPTIDE
I double commented because this wonderful github mobile app decided to show me "discard changes?" So I pressed cancel, pressed save and saw my comment being added for the second time

upper vapor
upper vapor
#

That doesn't work

hearty shard
worthy rune
#

also your a certified sir-yapalot now

upper vapor
hearty shard
#

ermmm

upper vapor
hearty shard
#

oh i gotta rewrite my scale patch

restive turret
#

scale deez

hearty shard
#

#ihatenw

unique crane
upper vapor
#

FLIRT

#

Stadler FLIRT

#

-# Fast Light Innovative Regional Train

unique crane
upper vapor
#

Xd

hearty shard
#

is it time to just throw null ref exception

upper vapor
hearty shard
#

i dont know

unique crane
#

I think we did

#

hopefully

hearty shard
unique crane
#

yipee

hearty shard
#

its all fineee

slate flume
upper vapor
#

Yay

unique crane
#

idk

#

Never seen the code

upper vapor
hearty shard
unique crane
#

Black magic

unique crane
hearty shard
#

damn

upper vapor
upper vapor
slate flume
#

Oh I see

#

So it just makes a text file that is the commands

#

Why

upper vapor
slate flume
#

That seems really fucking stupid

unique crane
#

I did already

hearty shard
#

well apparently thats not what it is

hearty shard
#

but it is what labapi does

#

kind of

upper vapor
slate flume
upper vapor
#

Source generators generate C# files (ik, crazy)
Base game uses assembly weaving which is some black magic I can't s much about

unique crane
#

Want source code?

#

here

slate flume
unique crane
upper vapor
#

Mirror does that too

upper vapor
unique crane
#

Its like your favourite

slate flume
#

Why does it do this

upper vapor
unique crane
#

Generates that register commands method

unique crane
#

il codes

upper vapor
#

OHH

#

Right

#

Yeah

hearty shard
slate flume
hearty shard
#

instead of writing all the new Class() you just create the Class

upper vapor
unique crane
#

Now it does

#

but like

slate flume
unique crane
#

Its not like its gonna be rewritten or anything

unique crane
slate flume
#

The LabAPI stuff makes sense because it's an easy way to register events and things

slate flume
upper vapor
#

I'll rewrite it

unique crane
#

??

#

Find classes which implement ICommand, get their handler, in the parent command handler write the RegisterCommand() method body with all the commands

upper vapor
#

It's literally that shrimple

unique crane
#

Yea

slate flume
unique crane
#

Because how else you want to do it?

slate flume
#

I've written reflection that's as simple as you're describing it and it's nowhere near that long

unique crane
#

Yeah but you have it at runtime

hearty shard
#

ya

upper vapor
unique crane
#

We are weaving it

slate flume
upper vapor
#

Yeah

#

Uh

#

Yeah

slate flume
#

Why did the command handlers need runtime reflection

hearty shard
upper vapor
hearty shard
#

immediately saw it as u said that

slate flume
#

Surely there's easier ways than relying on runtime reflection

hearty shard
#

im saying what YOU do is runtime reflection

upper vapor
slate flume
#

I'm gonna crash out

worthy rune
hearty shard
#

runtime reflection

worthy rune
#

its alittle hard to explain but its the "Weaver" stuff thats taking all the space

slate flume
#

I'm just

restive turret
#

I LOVE WEAVER

worthy rune
#

its essentially inserting IL into the DLL

restive turret
#

yes

slate flume
#

I know I had it all wrong

upper vapor
restive turret
#

thats what Mirror do too

slate flume
#

But surely even for the time there was an easier way

restive turret
#

ye not doing commands

worthy rune
#

maybe, although i doubt it cause unity sucks

upper vapor
hearty shard
#

do runtime reflection

upper vapor
#

Or don't have commands

slate flume
hearty shard
#

or that

#

delete RA

slate flume
#

How does one get started with learning compile-time reflection

upper vapor
restive turret
#

Weaver

#

I think Fody has a great stuff, its latest net support

upper vapor
restive turret
#

like .net8+

restive turret
#

and those stuff

upper vapor
upper vapor
restive turret
#

what is your types?? you never talked about it

upper vapor
#

Sometimes it's useful but like
Bruh

restive turret
#

ye? it same what sl use

#

*mirro

#

i think but they using Cecil

slate flume
#

So what's the advantage of compile-time reflection vs run-time reflection and why not do it like LabAPI did it with their source generators

restive turret
#

or whatever but in latest you can write weaving with fody

slate flume
#

This is all kinda new to me

upper vapor
hearty shard
#

Also compile time means run time doesnt need to do all the reflection

upper vapor
#

For runtime performance at least

hearty shard
#

we love performance

upper vapor
#

If we had NativeAOT support it would also solve trimming

worthy rune
#

as i understand it, using reflection in unity is really bad for the GC

#

as reflection types never get garbage collected

#

so if this code is run on the client(which it is as some commands are client sided) it would be terrible

restive turret
slate flume
upper vapor
# restive turret my weaver

Why don't you return an array instead of yield return yield return yield return yield return yield return (crazy)

hearty shard
celest thorn
hearty shard
#

also riptide said it

hearty shard
#

it doesnt get garbage collected properly

upper vapor
celest thorn
slate flume
restive turret
#

it just a learning project

hearty shard
hearty shard
restive turret
#

it will not have 2000% power in all aplces

slate flume
upper vapor
#

That supports base game and labapu

#

Apu

#

-# karigeri

slate flume
upper vapor
#

(I'd make it for sho)

slate flume
#

LabAPI does that with its stuff right?

upper vapor
#

Still reflecting 😔

hearty shard
upper vapor
upper vapor
slate flume
#

So for my own plugin registering custom items and things, would it be better for me to change from using run-time reflection

celest thorn
hearty shard
#

but you also dont have the Unity GC issue with reflection afaik

#

you also have less types than SL

upper vapor
#

To do that for startup time

#

Source generators would probably make more sense ngl

unique crane
#

Startup time of the server is like the last thing I would take into consideration when developing plugins xd

upper vapor
unique crane
#

If its by seconds

upper vapor
#

There are issues

unique crane
#

its skill issue

celest thorn
#

or even less

upper vapor
celest thorn
#

never counted it

unique crane
#

If its by 0.3 seconds

#

I dont care

#

no one is gonna notice

upper vapor
#

Me when my disk shits itself and delays startup by half a minute (unity moment)
"Type hbctrl to abort"
> hbctrl
"Heartbeat is not active!"

#

And it gets to waiting for players 0.1s before LA receives the heartbeat so it restarts still

celest thorn
#

wait what happened to beryl?

restive turret
#

beryl is no longer the head of labapi

celest thorn
restive turret
#

lel

celest thorn
#

lol

icy knoll
#

cedric was

#

but then jesus became it

celest thorn
#

who is what

#

im confused

icy knoll
celest thorn
#

ngl labapi exist

#

thats it

glad pagoda
unique crane
#

oh

#

oki

glad pagoda
#

Not earlier cause it's gonna break plugins

#

Also that code is pretty messy

glad pagoda
# unique crane

And it should have at least been split up into like 10 methods

upper vapor
unique crane
#

Anyways if its planned then good

celest thorn
#

helo

#

chat

thin tusk
#

🙏 hope that future SCP: SL updates bring QoL features for plugin devs (such as multi-layered hint capabilities or custom UI elements)

restive turret
#

just remove hints alltogether

thin tusk
#

Hints are okay, but I feel they deserve a rework

celest thorn
#

as much as rust is a dogshit game they really cooked up with modding

celest thorn
#

for sure

#

a system like that is cool

restive turret
celest thorn
#

what if you do exiled

restive turret
#

i dont have exiled

celest thorn
#

will it run Trolley and install itself

restive turret
tulip kiln
slate flume
#

@celest thorn I went to Italy and I'm in a taxi leaving the airport
It was so comical we hit the highway and passed a car on the side of the road that was literally on fire

celest thorn
#

Ngl its so common

#

I don’t even think its that rare

#

I’ve seen alot

slate flume
#

Lmao what the fuck

#

Why are your cars burning up

celest thorn
slate flume
#

Nah there's no way it's just heat

#

It's not even that hot today

#

It's like 26°C

celest thorn
#

Ok then the guy was stupid

#

Thats it i thought you meant peak hours in a city

#

Then yea thats going to be hot

#

Its not common at all but i’ve seen 4 times happen in my lifetime

slate flume
#

I'm gonna buy a raccoon and place it in front of your door

celest thorn
#

They look so cute :3

slate flume
#

No offense @celest thorn but Italy looks like it's in terrible condition

celest thorn
#

I do not take it as an offense instead it makes you think

slate flume
#

I'm seeing lots of police, graffiti, run-down buildings

celest thorn
#

Most of it

#

Just one part is for tourist to see

slate flume
#

What happened man

celest thorn
#

And people made graffiti on them

#

But none cares really

#

Only the nazi and fascist one are cared of

#

But yea if you wonder 99% is because the government doesn’t really care much about roads and anything else

slate flume
#

I've hit the tourist side of things and I'm seeing a lot less graffiti and many more people walking around with backpacks and caps looking like tourists

#

There's also like flowers and plants and shit over here

celest thorn
#

some funny story a politician transfered in one road in our small city and the road got fixed 1 second after he complained

#

that same road killed 2 people

#

but who cares

slate flume
#

This feels kinda dystopian ngl

#

I'm in a taxi, the driver is playing Manchild, and I go from seeing a ton of graffiti, run-down buildings, and other shit, straight to these posh buildings and gardens, tourists in fancy clothes, and lively cafés

celest thorn
#

and which places of the city you are in

#

for example old catania looks amazing but full of graffiti

slate flume
#

Anyways @celest thorn have you ever done compile-time reflection

celest thorn
#

like searching up stuff

hearty shard
upper vapor
#

yeah just make a source generator

#

better than weaving imo

#

you can inspect the exact C# code generated

#

though if you really wanna mess with IL then go for weaving

slate flume
upper vapor
#

it's also far easier to test

#

e.g. snapshot testing the source generated output

slate flume
#

The reason it wasn't used in SL is because it's .NET 5+ right?

upper vapor
#

yeah back in the day yeah

slate flume
#

Dope

#

And now we get access to it cause we're cool and awesome

upper vapor
#

because unity spared us

slate flume
#

Should I ask an AI to write an assembly weaver for me

#

I think it'll do a great job

restive turret
#

just choose first to use unity to weave or normal c# project

celest thorn
restive turret
#

😭

slate flume
#

I don't even have it installed on my computer

#

Never opened it in my life

celest thorn
#

small part of unity

#

but still

slate flume
restive turret
slate flume
#

And like the mscorlib for c#

#

Which is unity

restive turret
#

I can give you some direction tbh

slate flume
#

I think?

slate flume
#

Should I do assembly weaving or source generators

#

Tbh I'm kinda tempted to learn both just for versatility

restive turret
#

think what you need

#

Weaving can enable change stuff and inject, src gen only able to edit what you already have

#

for exampl
Use src gen to create Invoke places for events
use weaving if you wanna fuck with IL

slate flume
#

Hm

#

Well all I want really is to parse the types in my assembly, instantiate certain ones, register events handlers for others, and then add them to a list

#

Cause I want to replace my plugin entry run-time reflection with compile-time reflection

#

Optimization and such

#

Maybe not a huge difference but I think it'd be cool

restive turret
#

for example weaver

#

again weaving

slate flume
upper vapor
# restive turret Weaving can enable change stuff and inject, src gen only able to edit what you a...

Check out my courses: https://dometrain.com
Become a Patreon and get source code access: https://www.patreon.com/nickchapsas

Hello everybody, I'm Nick, and in this video, I will introduce you to a new C# feature coming in C# 12 and .NET 8 called "Interceptors". It is a very interesting feature that might look very weird on the surface level but...

▶ Play video
#

another drawback of weaving is that the IDE doesn't know about it

restive turret
upper vapor
#

it does

restive turret
#

ye

#

no

upper vapor
#

??????

#

the IDE knows about the source-generated files

restive turret
#

in LabAPI i search for the InitWrapper usage

#

didnt show shit

celest thorn
upper vapor
restive turret
#

ye

#

it didnt show for me

upper vapor
#

visual studio issue

restive turret
#

NO

#

as usage like

#

ye it shows the same nvm

upper vapor
#

soo... it does show?

restive turret
#

ye i throught about actually calling smth with it

#

aint really care tbh

#

as an individual think what u need and what each of them can support

#

if you wanna swap or fuck with il do weaver if not scr gen

upper vapor
upper vapor
#

pro unity tip: don't use GetComponentsInChildren on a parent that has 30K+ children in total

restive turret
#

lmao

upper vapor
#

imagine doing that with 3M objeccts

celest thorn
blissful pike
#

hey guys, it's me again, your favourite. got a new question <3

#

I'm trying to select a random item from a player's inventory. how?

icy knoll
#

that should work, what’s the error?

blissful pike
#

Argument type 'int' is not assignable to parameter type 'ushort'

hearty shard
#

oh its trying to get item based on serial

icy knoll
#

use .At() then maybe

hearty shard
#

try Items.Values[index]

icy knoll
#

or that he

#

ye*

blissful pike
hearty shard
#

you went to the Values ?

#

oh

blissful pike
#

yeah

icy knoll
#

maybe .At() or .ElementAt()

blissful pike
#

hm .ElementAt seems to work

hearty shard
#

extension moment

restive turret
#

Dummy.CurrentItem = Dummy.Items.ToList().RandomItem();

hearty shard
#

true

hearty shard
#

@unique crane when is scale reset on a player guh

thin shuttle
thin shuttle
upper vapor
hearty shard
#

about that

#
    public FpcScaleController(FpcMotor fpcMotor)
    {
      this.Motor = fpcMotor;
      Vector3 vector3;
      if (!FpcScaleController.SyncedValues.TryGetValue(this.Hub, out vector3))
        return;
      this.Scale = vector3;
    }
#

it just sets it to what it was set to

thin shuttle
#

Yeah

#

The value is reset

celest thorn
thin shuttle
#

Because new instance

hearty shard
#

and then sets it to that old value

celest thorn
thin shuttle
#

That change then

hearty shard
#

yea its a change

upper vapor
celest thorn
hearty shard
#

which is why i pinged david

thin shuttle
celest thorn
#

or the component itself

hearty shard
#
public static readonly Dictionary<ReferenceHub, Vector3> SyncedValues = new Dictionary<ReferenceHub, Vector3>();

    public Vector3 Scale
    {
      get
      {
        Vector3 vector3;
        return FpcScaleController.SyncedValues.TryGetValue(this.Hub, out vector3) ? vector3 : Vector3.one;
      }
      set
      {
        this.Hub.transform.localScale = FpcScaleController.SyncedValues[this.Hub] = value;
        if (!NetworkServer.active || this.Motor.Hub == (ReferenceHub) null)
          return;
        new SyncedScaleMessages.ScaleMessage(value, this.Hub).SendToHubsConditionally<SyncedScaleMessages.ScaleMessage>((Func<ReferenceHub, bool>) (n => n.authManager.InstanceMode == ClientInstanceMode.ReadyClient));
      }
    }

    public FpcMotor Motor { get; set; }

    public ReferenceHub Hub => this.Motor.Hub;

    public FpcScaleController(FpcMotor fpcMotor)
    {
      this.Motor = fpcMotor;
      Vector3 vector3;
      if (!FpcScaleController.SyncedValues.TryGetValue(this.Hub, out vector3))
        return;
      this.Scale = vector3;
    }
#

actually why is Motor a set?

#

its never set in basegame other than in the constructor

upper vapor
celest thorn
#

Oh wait

#

i remembered i did push something on meow

#

for doing that

#

but i never actually do it

upper vapor
celest thorn
#

Spawnables = Object.GetComponentsInChildren<SpawnableInfo>();

#

this is what i do in meow

#

lol

upper vapor
#

soooo the exact thing i wanna avoid

#

is what you do

#

😭

hearty shard
#

hi axe

#

pick another color!!

upper vapor
#

nah

hearty shard
#

ur name is unreadable

#

u suck

hearty shard
#

i just realized w my scale patch i can just return ev.IsAllowed now

celest thorn
hearty shard
#

since no bug fix needed

upper vapor
#

not very new but like

#

omg

#

makes me go xd

hearty shard
#

i need to check if scale is actually broken but i see 0 resets on it

#

and thats so weird

#

since it wasn't required to reset it this entire time

celest thorn
restive turret
#

eve, what u want

hearty shard
#

although it seems to work fine

#

wait

celest thorn
hearty shard
#

where is it resetting then

#

there is no reset here

restive turret
#

loll

hearty shard
#

oh

#

its cuz i have this on role change

#

ahaha

restive turret
#

lel

hearty shard
#

@limber silo this is the sort of change u want to announce and put as required for devs to handle now

#

😭

#

rn its just "fixed sync issue with scale/gravity"

restive turret
hearty shard
#

but if its ever changed its never reset

#

this is a change from before

#

before new role = reset

restive turret
#

well ye

hearty shard
#

this is new in the update

#

so itd be cool for them to achknowledge it in the changelog that plugins will need to adjust

#

(i never changed mine from the exiled days so im fine but yk)

restive turret
#

ye i set scale 0 zero back too

unique crane
#

Oversight

#

rip

#

@limber silo

hearty shard
#

david...

#

did u do this....

unique crane
#

Yes

#

because the new role sync required me to rewrite both systems ofc

#

To work properly

hearty shard
#

oh em gee

#

both of them have the same change

thin shuttle
hearty shard
thin shuttle
#

that would be really good

unique crane
#

mhm

thin shuttle
#

COOOL

unique crane
#

gg

thin shuttle
#

it's fucking annoying me

#

honnestly

unique crane
#

Some people like it

#

some dont

#

Honestly

#

Lets just keep it this way and never touchy it

limber silo
#

that's good

#

people can easily reset the scale on roleset

hearty shard
#

ya

#

its just ppl need to know that its required

thin shuttle
# unique crane some dont

my opinion it's FpcRole should be kept on the Role

and Player should affect without being affect by role changed and it's wasn't possible for me On Exiled to make it because LabAPI was reseting everytime role was changed

#

and anyway if people want it reset at every role changed it's VERY easy to make

#

the opposite is very hard

unique crane
#

True

hearty shard
#

omg jesus sending announcements?!!?!

celest thorn
#

Crazy nameless complaint got listen

#

By the gods

hearty shard
#

whether it be disclosed in the changelog or the github release, idk maybe both

restive turret
#

14.1.4

hearty shard
#

ya

restive turret
#

Soon 14.1.4.1

hearty shard
#

guh

tulip kiln
tulip kiln
#

Must have been real hungry

#

you ate all of it

unique crane
#

idk

hearty shard
#

i was!

unique crane
#

Yeah its eve's fault

hearty shard
restive turret
thin shuttle
#

@unique crane i have an question could you fix the Generator State None not being 0 ?

#

for the Enum

unique crane
#

How is that an issue

thin shuttle
#

but always at 0 if nothing have happenned

unique crane
#

wdym

hearty shard
icy knoll
#

i guess they are saying that somehow the enum value goes to 0, even tho there is no 0 flag

thin shuttle
#

None = 0 should be the good way

#

because it's never set to value 1

#

and even setting to 1 would be kinda weird

#

(also do not modify other value)

#

i don't want breaking change

restive turret
#

it will be breaking

thin shuttle
#

nope

restive turret
#

since Unlocked would be 1 then

thin shuttle
#

bro

icy knoll
#

yeah changing an enum value will be breaking 💀

hearty shard
thin shuttle
#

^^^^^^

hearty shard
#

only change None which is NEVER used

unique crane
#

There is no reference for the None state honestly

#

so

hearty shard
#

ya

unique crane
#

priority none issue xd

hearty shard
#

plugins

icy knoll
restive turret
#

p-1

thin shuttle
#

so generator.GeneratorFlags is GeneratorFlags.None don't work

#

because it's never to None

icy knoll
#

hm?

thin shuttle
#

that no breaking change

hearty shard
#

i mean itd mean that anything that wasnt working already would continue not working

#

it wouldnt break anything that did work and would fix a bug

#

2nd solution

icy knoll
#

changing an enum value is a breaking change technically, no matter if the value isnt used at all

hearty shard
#

is to set flags to 1 on creation

thin shuttle
icy knoll
#

it is a breaking change?

thin shuttle
#

no

#

because None can't be used

#

and people that used it only enable a flag that is never used

icy knoll
#

I don't really think you understand what a breaking change is then but ok

hearty shard
thin shuttle
#

i do perfectly get what is breaking change

unique crane
#

Fill issue about it on github

hearty shard
#

this breaks nothing

#

if something doesnt work
making it work
doesnt break it

thin shuttle
hearty shard
#

while yes plugins that do check for 1 will need recompile
but for those plugins to work they need to check 0 regardless

#

hence (GeneratorFlags)0 is required, yamato is asking for this requirement to be removed

thin shuttle
#

because default is 0

#

and modifying default to 1 would break it for real

hearty shard
#

either default it to 1
or change enum to 0

hearty shard
thin shuttle
#

yeah because plugin manually do this (GeneratorFlags)0

#

now

hearty shard
#

true

#

however i dont really care what nw does of the 2

#

i dont use it

#

but itd still be a single digit change

slate flume
#

I've gotta back bro up on this

#

Is it a known issue that LightSourceToys can be seen in reflections through walls?

restive turret
#

yes

slate flume
restive turret
#

i think thats unity issue

#

but you can report it i guess

slate flume
ashen hound
ashen hound
restive turret
restive turret
grand flower
#

Has anyone tried the new feature that hides players from the spectator list?

#

does it work?

mild walrus
#

p.EnableEffect<MovementBoost>(50);

                Timing.CallDelayed(10f, () =>
                {
                    p.DisableEffect<MovementBoost>();
                });                   

It doesnt work like this the effects right?

#

Like for making the effect longer

hearty shard
#

EnableEffect has a duration part

mild walrus
hearty shard
mild walrus
#

Nevermind i found it lol

#

ty

grand flower
#

@limber silo @unique crane Player.IsSpectatable does the opposite of what it's supposed to do

#

i.e. I set it to false, it calls SpectatableVisibilityManager.SetHidden(this.ReferenceHub, false);

#

Meaning not hidden

hearty shard
#

Lel