#plugins-dev-chat

1 messages ยท Page 61 of 1

celest thorn
#

but yea strange the one i downloaded has more

restive turret
#

me when i \u1F0CF

celest thorn
#

๐Ÿƒ

hollow pewter
#

how can a Room be null? im getting a nullreference exception when trying to convert local position in alpha warhead to world position

#

doing this but sometimes the enumerable is empty

Room warhead = Room.Get(RoomName.HczWarhead).First();

random scaffold
#

due nw moment

hollow pewter
#

great

spare zodiac
#

if you can use type

upper vapor
#

They know about the stale references bug

harsh thorn
#

now bake elevators too and use a navmesh link to connect them together

lusty fox
#

Hello,
Is there any way other than patching to cancel the blinking effect of SCP-173 at the moment?

grand flower
#

No

lusty fox
#

Sad moment

celest thorn
#

you mean?

#

Scp173BlinkTimer.ServerBlink because if you mean this one then yea you can

celest thorn
#

ok yea you can

lusty fox
#

What's the event then ?

celest thorn
#

you need to manually patch

#

and do it

lusty fox
#

Oh yes, I know, but I was just asking if it was possible to do something other than a patch.

#

But thanks for your advice!

celest thorn
#

just do

#

a prefix and return false

#

thats pretty much it

lusty fox
#

I know, it's just to add a condition to prevent the move if a certain number of players are watching it. But if I can avoid the patch, I'd rather use LabAPI whenever possible.

celest thorn
#

labapi is so new

#

so you could suggest it

lusty fox
lusty fox
celest thorn
#

I prefer it even to exiled

#

i switched from exiled to labapi

#

it was the best thing ever

lusty fox
#

When we find equivalence on certain Events, I don't see any reason to use Exiled any more.

hard flume
#

why this is not working

#

localadmin ignores ALL commands

upper vapor
hearty shard
#

iirc

hard flume
#

well seems will be same

upper vapor
#

Bruh

hard flume
#

ah

unique crane
#

Yipee

upper vapor
#

What was the issue?

hard flume
#

idk

upper vapor
#

Did you need to enter it another time? toomuchtrolling

hard flume
#

idk

#

i spammed enter

#

and it worked

upper vapor
#

Checks out lmao

hard flume
#

The system has successfully checked your server, a verification response will be printed to your console shortly, please allow up to 5 minutes.

#

tmux is slow asf

restive turret
#

ye somehow reading the console input is just

#

nyeh

hard flume
#

i have question

#

if rules in work, and my server is full RP

#

i have to make it norules?

unique crane
#

What

hard flume
#

b. If your server has no rules, clearly state this in your Server Name or Server Info.

unique crane
hard flume
#

no access)

upper vapor
#

No acess

hearty shard
#

if you do have rules, you must include those rules

hard flume
#

what the hell

hearty shard
#

you likely forgot to close a tag

hard flume
#

ye

#

it closes tag 2 times

true cedar
#

slabbers design question

#

i dont know how many of you are aware of init only properties

#

but basically

upper vapor
#

You mean
Peak properties

#

:3

true cedar
#

if you declare

public int X { get; init; }

in a class Example, you can't actually set example.X, you have to do something like

new Example() {
  X = 5,
}
icy knoll
#

yes

#

i like init in some places

#

but if it's not needed ill go with set

true cedar
#

my problem is that i want to let you set an init-only property that's a list and preserve immutability. since you can change the behavior of init only properties, i could do it like

public IReadOnlyList<ContentParameter> Parameters { get => this.parameters; init => this.parameters = new ReadOnlyList(value.ToList()); }

or i just add it as a constructor. this would mean however that i need to double the number of constructors

#

if i do it as an init only that might be surprising

upper vapor
#

Field keyword Smart

#

Make it required

#

Boom

true cedar
#

well the problem isnt that its required

#

its optional to provide the parameters

#

thats the issue

icy knoll
upper vapor
#

13

icy knoll
#

thought so

#

im on 12 ๐Ÿ˜ญ

true cedar
#

i dont wanna use too modern of a version

#

im on c# 11

upper vapor
#

Just upgrade

upper vapor
#

What are you on about

true cedar
#

this is a library

#

so

upper vapor
#

12 is LTS

#

(Per .NET SDK)

true cedar
#

i mean c# 11 is only like a year old so

upper vapor
#

What's wrong with a new version of C#

true cedar
upper vapor
#

No collection expressions? BOOM

true cedar
#

i dont like collection expressions in c# hot take

upper vapor
#

Ewww

true cedar
#

actually for arrays its fine

upper vapor
true cedar
#

i just don't like the idea of [1, 2, 3] becoming any type u want under the sun

upper vapor
#

Do you actually type out Array.Empty<T>() every time?

true cedar
true cedar
upper vapor
#

Constructor with IEnumerable might be more straightforward for consumers

true cedar
#

thats what i was thinking but its like

#

i would need to double the number of constructors i have since theres classes that inherit from this

#

and ia lready have a signature with 3 parameters

upper vapor
#

True

true cedar
#
/// <summary>
/// Initializes a new instance of the <see cref="CachedElement"/> class.
/// </summary>
/// <param name="cacheTime">A <see cref="TimeSpan"/> indicating how long to store cached text before regenerating.</param>
/// <param name="position"><inheritdoc cref="DynamicElement(float, Func{string})" path="/param[@name='position']"/></param>
/// <param name="contentGetter"><inheritdoc cref="DynamicElement(float, Func{string})" path="/param[@name='contentGetter']"/></param>
public CachedElement(float position, TimeSpan cacheTime, Func<string> contentGetter)
    : base(position, contentGetter)
{
    this.CacheTime = cacheTime;
}
true cedar
#

its just reusing docs

upper vapor
true cedar
#

well the problem is that

#

i feel like if you do

#

new X() {
Y = y
}

upper vapor
true cedar
#

you expect Y = y

#

so you might do y.Add(...) and expect it to propagate

upper vapor
#

Ehhh

true cedar
#

i could add a warning but idk it feels very hcaky

upper vapor
#

How about you make a
IEnumerable<Whatever> ParametersCopy { init => } toomuchtrolling

true cedar
#

thats even UGLIER

#

if i did do this i'd just put it in the remarks or comments

#

thats it a copy

upper vapor
#

Then
Shit

#

Yeah do that

#

And keep the original prop you showed

#

You can also do .ToList().AsReadOnly()

#

No visible constructor call

true cedar
#

raahhh

#

i wish c# had better support for builders

#

cause here i could do like

icy knoll
#

wdym

true cedar
#

i mean ig i can do this but i dont wanna

#
BasicElement element = new BasicElement.Builder(500f, "hello")
  .AddParameters(param)
  .SetVerticalAlign(...)
  .Build();
upper vapor
#

It's not that painful to do
You make a few templates, let AI fill in the rest

#

AI is often good for boilerplate

#

Not much else though

true cedar
#

its not necessarily making the builders themselves

icy knoll
upper vapor
#

-# next.js my ahh

upper vapor
icy knoll
true cedar
icy knoll
# true cedar wdym

i have a TranslationBuilder thing to replace params in with my discord bot plugin and .Build() is quite annoying but eh

upper vapor
true cedar
#

hell no

#

sorry that was mean

icy knoll
#

i just wish c# could like detect if the parameter im putting it in is a string, and if it is, run build for me

true cedar
#

i feel like a builder pattern is the "correct" thing to do here but like

icy knoll
hearty shard
#

and it just implicitly becomes string

#

prob

true cedar
icy knoll
#

Logger.Info(new StringBuilder()) instead of Logger.Info(new StringBuilder().ToString())... like if you just put inside of your class that if a param is type of string, then run .ToString() automatically

#

would be pretty neat

#

but i get the issues too

hearty shard
#

me when implicit

#

like ax said

icy knoll
#

idek how to do that...

hearty shard
#

add an operator to your class

upper vapor
upper vapor
#

Not that difficult thougu

true cedar
#

i dont like implicit operators

upper vapor
true cedar
#

with some exceptions

hearty shard
#

i hate when no spawn protection

icy knoll
#

how does it even work? legit how I just put it or?

true cedar
#

iirc according to c# guidelines ur only supposed to make an implicit cast if doing so would lose no information

upper vapor
icy knoll
#

hmm

upper vapor
#

You're not losing information if you build the thing...

#

You just create a new type with that information

#

They give us language features and "erm actually..."

#

Imo it's better to also include a method that does the same thing as the operator

true cedar
#

welcome to c#

#

the most bloated language on god's green earth

upper vapor
#

Kek

true cedar
#

i am of the opinion

upper vapor
#

SL# with x3rt when Hmm

true cedar
#

that u shouldn't be allow to define ur own conversion operators

upper vapor
true cedar
#

conversion operators

#

cast

#

s

upper vapor
#

Yeah fair

#

But

#

I disagree

#

Explicit conversion operators exist, too shrug
I don't see that much use for them though

true cedar
#

explicit conversion operators have even less of a reason to exist ngl

upper vapor
#

I did use them one time so the compiler would yell at me when refactoring
public static explicit operator float(DriverSpeed speed) => speed.IsReverse ? -speed.Value : speed.Value;
For some cases I needed the absolute, others needed the exact value

true cedar
#

i guess it might be kinda useful for like

#

simd

upper vapor
true cedar
#

custom explicit/implicit cast operators

#

since u have like

upper vapor
#

Don't say it, slejm...

true cedar
#

that reminds me i wish we could use simd

upper vapor
true cedar
#

now that i think about it

upper vapor
true cedar
#

it prob wouldnt be

upper vapor
#

Yeah it's still a method call, just syntax sugar basically

true cedar
#

i mean ik

#

honestly the fact that you can't override the is operator

upper vapor
#

How would you override it

#

For equality or comparison checks per member?

true cedar
#

i was thinking for types

#

although i could see it for values too maybe

#

main thing is just for unions

#

because c# still doesn't have discriminated unions jesus christ

icy knoll
#

okie

#

tried implicit operators...

#

just removed 100 .Build() method calls from my code

#

so peak

true cedar
#

i'll throw hands

upper vapor
#

yeah sure

upper vapor
#

REJECTED????????

true cedar
#

link?

upper vapor
true cedar
#

oh

upper vapor
#

uh

#

i might be dumb

upper vapor
#

the one i sent felt off ๐Ÿ˜ญ๐Ÿ˜ญ๐Ÿ˜ญ

true cedar
#

i can see why the one u sent got rejected

#

its dumb LOL

#

i do prefer using the enum keyword instead of a specialized union keyword

upper vapor
#

rust enums, eh?

true cedar
#

well

#

i mean i prefer the enum keyword because i dont like unnecessary keywords

#

plus i think its slightly more understandable to people

true cedar
#

extension is slightly more understandable since idk what u would replace it with

#

maybe a like

#

public static class Extensions(this IEnumerable<T> enumerable)

upper vapor
#

yeah that's how i imagined it

#

but the syntax they added is more uh

#

resilient?

true cedar
#

ig

#

it still raises questions like

upper vapor
#

more extensible toomuchtrolling

celest thorn
#

hii chat

upper vapor
#

hello 02

celest thorn
#

how are you doing?

upper vapor
#

weird

#

idk tbh ๐Ÿ˜ญ๐Ÿ˜ญ

celest thorn
#

lol

true cedar
#

shit

#

i just realized i have a new proble

#

m

#

if im using builders do i make them a struct or class

#

wait i'd have to make it a class

#

but then do i return a copy screams

upper vapor
#

what

true cedar
#

1 sec

icy knoll
upper vapor
#

gotta love my false | undefined

#

but fr though discriminated unions are amazing

viral rivet
#

How can I make a hitmark on a player?

grand flower
#

Player.SendHitmarker

true cedar
#

1000 empty arrays

hearty shard
#

Woo

true cedar
hearty shard
#

how much does sl even use

true cedar
#

use what

hearty shard
#

network reader

#

like

#

its pooled for a reason probably....

#

1k seems excessive, but idk how much itd use at a time roughly

grand flower
#

Technically only one

hearty shard
grand flower
#

Per player at a time

#

No?

true cedar
#

i mean

#

nah

hearty shard
#

uhhh

#

idk!

true cedar
#

but maybe like

hearty shard
#

100?

true cedar
#

5

#

idk

hearty shard
#

well it depends

#

wtf is network reader used for on server side

grand flower
#

You're not gonna be reading multiple messages at once

#

Reading messages from clients

true cedar
#

nah

#

but what if they're nested

hearty shard
grand flower
#

When is a message nested

#

Incoming message

grand flower
#

And you're not reading multiple messages at once (unlikely)

hearty shard
#

blehh!

true cedar
#

i mean

grand flower
#

Unless Mirror is doing something weird idk

true cedar
#

i think its bad to assume that only one networkreader is in use at any given time

hearty shard
#

wait is that mirror pool or nw

#

whos pooling this

grand flower
true cedar
#

i mean, you might use a networkreader to read part of a message

#

like

grand flower
#

You pass in the same reader

#

Because it's reading that one payload

#

Unless I'm not aware of something

true cedar
#

a ReadX() method might get a new networkreader

hearty shard
#

Yall suck!!

true cedar
#

theres often multiple networkwriters at once so

grand flower
#

Don't read methods pass in the network reader

#

That would make more sense than what you're describing

true cedar
#

multiple readers

#

it makes sense since reader just keeps track of the position

true cedar
#

and creatign a new byte array for every single one

#

despite the fact that you could just use array.empty or better yet just pass in null

#

or even better yet reduce thta to like 5 readers and pass in null

hearty shard
#

U do it

true cedar
#

i would if i wasnt working on ruei

hearty shard
#

Hmm

grand flower
#

Odd

#

Oh well glad I don't work with that godforsaken engine

restive turret
restive turret
true cedar
#

mirror

grand flower
#

They probs know what they're doing then

#

Even though I'm confused at why

restive turret
#

Check their readme ig

grand flower
#

I'm good DogKek

#

SL's likely to be the only time I'll use Mirror

restive turret
#

// initial capacity to avoid allocations in the first few frames
1000

#

Aha

#

Ye

grand flower
#

Thats fair enough

#

If you're receiving all the initial state

#

Still weird

restive turret
#

1k still wierd

#

Would be like

#

255

grand flower
#

ยฏ_(ใƒ„)_/ยฏ

true cedar
#

so why tf do they not use array.empty

#

or pass in null

#

now im even more confused

#

god this shit has too many comments

grand flower
#

It's likely just when you connect to a server

#

You're gonna be bombarded with initial states

#

So they have a possibly excessive amount of pooled readers for that initial spam

true cedar
#

yea but then

#

why not pass in null

grand flower
#

No clue

teal junco
true cedar
#

it would be so neat if we had a translationparameter or something so i could incorporate base game hints :3

grand flower
#

clientside mods when

teal junco
true cedar
#

i just need base game hints to not hide all of my hints

teal junco
grand flower
#

oh well

true cedar
#

the urge to correct ur spelling of materiel

plain gazelle
#

Is it possible to limit reloading of a magazine based weapon to a single bullet total?
So if there is a bullet in the chamber; dont reload?

teal junco
grand flower
#

eh

#

doubt it

#

not with the way things are

teal junco
#

equipment

#

right

true cedar
#

i think so

grand flower
#

oops

true cedar
#

i just remember it being antimateriel and being confused why it was an e

teal junco
#

they also obfuscated the client code for some reason

grand flower
#

mfw anticheat is useless

#

Still wonder why even bother wasting money on it when there's solutions made by bigger companies available

teal junco
#

i genuinely dont get whats the point of that, there might be some reason but i dont know

grand flower
#

IL2CPP for performance probs

true cedar
teal junco
true cedar
#

i think obfuscating it is like literally a checkmark

teal junco
#

i dont know how compilation tends to work

grand flower
#

They use IL2CPP

#

Which has benefits

#

Obfuscation as a side effect I guess

true cedar
grand flower
#

Clearly useless anyway on that part DogKek

true cedar
teal junco
teal junco
teal junco
true cedar
#

normally

#

c# code is turned into CIL

#

which is higher level

#

when you run cil the net runtime turns that into assembly or raw machine code

#

il2cpp basically turns it into assembly or raw machine code ahead of time

plain gazelle
#

how can i check per code if a bullet is already in the chamber of an automatic weapon?

plain gazelle
#

how can i change the max ammo for a gun .w.

slate flume
#

Depends on the gun

#

The way to do it for just about every gun is to patch the magazine module AmmoMax getter

#

Revolvers are a side case that suck major dick and balls

#

To get mine to work I patched ServerWithholdAmmo and InsertAmmoFromClip in the RevolverClipReloaderModule

covert flame
#

When I spawn a gameobject it spawns but isn't visible to the player and is all desynced and everything, how do I sync it all back up

grand flower
#

How are you spawning it

covert flame
#

NetworkServer.Spawn()

grand flower
#

What are you spawning

covert flame
#

a gameobject

grand flower
#

Send code

covert flame
#
GameObject instance = GameObject.Instantiate(prefab, position, Quaternion.identity);
NetworkServer.Spawn(instance);```
grand flower
#

What's the prefab

covert flame
#
GetObjectPrefabs().TryGetValue(objectType, out GameObject prefab);```Which is (give me a second)
#

Which in this case is just this cs GameObject primitive = GameObject.CreatePrimitive(type);But I also have things likecs NetworkClient.prefabs.Values.First(x => x.name.Contains("LCZ"))

#

I mean if you want it all

covert flame
random scaffold
#

IDoorPermissionRequester how i can get it from the player?

covert flame
#

What are yout rying to do with it?

#
if (player.RoleBase is IDoorPermissionProvider doorPermissionProvider)
{
  // Now you can use the doorPermissionProvider from the player
}```
random scaffold
covert flame
#
public static bool HasKeycardPermission(Door door, Player player) =>
    HasPlayerPermission(player, door.Base);

public static bool HasKeycardPermission(LabApi.Features.Wrappers.LockerChamber chamber, Player player) =>
    HasPlayerPermission(player, chamber.Base);

public static bool HasKeycardPermission(Scp079Generator generator, Player player) =>
    HasPlayerPermission(player, generator);

public static bool HasPlayerPermission(Player player, IDoorPermissionRequester requester)
{
    bool hasPermission = false;

    if (player.RoleBase is IDoorPermissionProvider doorPermissionProvider)
        hasPermission = requester.PermissionsPolicy.CheckPermissions(doorPermissionProvider.GetPermissions(requester));

    foreach (Item item in player.Items)
        if (item.Base is KeycardItem keycardItem)
        {
            hasPermission = requester.PermissionsPolicy.CheckPermissions(keycardItem.GetPermissions(requester));
            if (hasPermission) break;
        }

    return hasPermission;
}```
#
private static void OnPlayerInteractingDoor(PlayerInteractingDoorEventArgs ev)
{
    if (!ev.Door.IsLocked && HasKeycardPermission(ev.Door, ev.Player))
      ev.CanOpen = true;
}
private static void OnPlayerInteractingLocker(PlayerInteractingLockerEventArgs ev)
{
    if (HasKeycardPermission(ev.Chamber, ev.Player))
      ev.CanOpen = true;
}
private static void OnPlayerInteractingGenerator(PlayerInteractingGeneratorEventArgs ev)
{
    if (!ev.Generator.IsUnlocked && HasKeycardPermission(ev.Generator.Base, ev.Player))
    {
        ev.Generator.IsUnlocked = true;
        ev.Generator.Base._cooldownStopwatch.Restart();
    }
}```And then just hook up these events
random scaffold
#

why not just requester.CheckPermissions(IDoorPermissionProvider provider)?

covert flame
#

Basically whenever the player tries to open a door or a locker, etc then it will firstly see if the player has the permission in there (player could have bypass), then it checks all items in the innventory to see if any of the cards have the pertmissions for the door

#

Yeah true, you cand o that

#
if (player.RoleBase is IDoorPermissionProvider doorPermissionProvider)
    hasPermission = requester.CheckPermissions(doorPermissionProvider, out PermissionUsed _);

foreach (Item item in player.Items)
    if (item.Base is KeycardItem keycardItem)
    {
        hasPermission = requester.CheckPermissions(keycardItem, out PermissionUsed _);
        if (hasPermission) break;
    }```You can jsut dispose the out, since it's not used in the function, I dont actually know what it is or what it is used for lol
#

And then if you dont want the if statement, I dont actually think you need the if statements then it's jsut ```cs
hasPermission = requester.CheckPermissions(player.RoleBase as IDoorPermissionProvider, out PermissionUsed _);

foreach (Item item in player.Items)
{
hasPermission = requester.CheckPermissions(item.Base as KeycardItem, out PermissionUsed _);
if (hasPermission) break;
}```

random scaffold
#

only scp can be provider?

restive turret
grand flower
#

At least you're not wasting money making your less efficient version

restive turret
#

ยฏ_(ใƒ„)_/ยฏ

#

It's an eternal fight between cheaters and devs

grand flower
#

I know

#

Which is why considering the limited funds NW has

#

Making their own is stupid

restive turret
#

Yeah, anyway back to sleep see ya at 12'

covert flame
covert flame
grand flower
#

Don't really have any idea based on that code unfortunately

covert flame
#

Okay, isn't it just a case of updating all players, like how you have to do this when changing a size of a palyer so it updates on all other players and everything cs NetworkIdentity identity = hub.netIdentity; foreach (Player observer in Player.ReadyList) NetworkServer.SendSpawnMessage(identity, observer.Connection);

upper vapor
upper vapor
upper vapor
upper vapor
covert flame
#

I'm aware of the scale stuff, and yeah, using Player.List absolutely totals everything

icy knoll
#

yeah use ReadyList

#

idk why List doesnโ€™t default to readylist tbh

covert flame
#

Yeah, one of the major things that breaks is reloading

covert flame
celest thorn
#

shouldn't be a replacement?

upper vapor
#

so as always, you gotta do Timing.CallDelayed(0.1f

celest thorn
#

always works

#

best friend of sl modders

icy knoll
#

CallDelayed is cool

celest thorn
#

You have an issue with SL

#

calldelayed the solution

icy knoll
#

yup

upper vapor
#

what if you're eve and you have a problem with NW

icy knoll
#

also it doesnโ€™t even have to be 0.1, 0.0 also works the exact same way

upper vapor
icy knoll
#

damn

grand flower
#

One frame is enough for scale message

#

if you're doing it in role changed

upper vapor
#

oh

#

mb

#

never used it

teal junco
#

just use spawned event i think it runs one frame after change role is confirmed smh

#

idk actually

#

but i feel more comfortable using that event

upper vapor
#

spawned event is not called iirc

#

RoleChanged should work, no?

#

that's after the role is initialized

grand flower
#

if you delay one frame yes

upper vapor
grand flower
#

Don't look at me

#

I don't work on SL

teal junco
grand flower
#

ยฏ_(ใƒ„)_/ยฏ

upper vapor
teal junco
#

im primary exiled user, spawned event for exiled is ran after role is changed

#

this includes death btw

upper vapor
#

spawned as spectator

teal junco
#

its just a weird way to name it

#

why not "ChangedRole"

#

they should both be called the same thing. "ChangingRole" and "ChangedRole", or "Spawning" and "Spawned"

carmine prawn
teal junco
#

i think i saw someone once suggest exiled wrappers for labapi events

carmine prawn
#

is TotalDamageDealt can be trusted?

teal junco
#

exiled users/devs be doing anything but using labapi

#

๐Ÿ’”

teal junco
carmine prawn
#

yep

#

and a few other things

teal junco
#

i would suggest using wear state or charges left instead

#

but you can test if it can be trusted by logging the total damage dealt if you need to use it for some reason

grand flower
#

If you're just trying to check how much damage was dealt with the jailbird

#

Yes that's good

teal junco
#

generally it can be trusted if its like, part of the wrapper

#

i dont think people will implement broken properties on a wrapper

carmine prawn
#

๐Ÿ’€

carmine prawn
#

and on hurting, TotalDamageDealt always 0

teal junco
upper vapor
#

yes

teal junco
#

i use lab api and exiled both

upper vapor
#

but it's dying now cuz labapi exists

teal junco
#

that way i get anything i want

teal junco
upper vapor
#

๐Ÿ’”

upper vapor
teal junco
#

i have like 9 months of experience programming c# (minus the month or so in 2022) and most of it is exiled

#

I did do a bit of minecraft modding and Unity gamedev but i dont count that because i learned almost nothing

carmine prawn
#

Exiled has a lot of cool things that LabAPI doesn't

teal junco
grand flower
#

LabAPI just needs to catch up

#

Since it's newer

teal junco
#

it took me a bunch of patching and snooping through code to achieve the same thing

grand flower
#

At least we can patch stuff

teal junco
#

Can we hold an exiled funeral

grand flower
#

Never used it

#

Only been doing modding for SL for like, 2 months now

teal junco
#

because exiled walked so labapi could speed walk

upper vapor
#

oh gosh

teal junco
upper vapor
#

the suffering

icy knoll
#

all my future plugins arenโ€™t going to have an exiled version lol, and i started with text chat

teal junco
icy knoll
#

yeah

#

i legit donโ€™t make exiled versions now

teal junco
#

my plugins have exiled versions because they always start from exiled and the labapi port is always less stable

upper vapor
teal junco
#

for my cassie plugin

upper vapor
covert flame
icy knoll
#

i love no custom configurations for my plugins now

upper vapor
#

PrimitiveObjectToy.Create(..., networkSpawn: false)

#

then set the type
and spawn it

#

-# labapi wrapper

teal junco
#

Exiled custom items and custom roles are gonna be a big loss if exiled becomes that much less popular

#

ill just use slems custom item api

#

but custom roles is a bit up in the air for me

grand flower
#

Just make your own

teal junco
#

and people will always use their own system

upper vapor
icy knoll
#

iโ€™m surprised nobody has made like a really good custom items api yetโ€ฆ

#

or custom roles

grand flower
#

We have one

#

Except you know

#

The whole it's not public part

upper vapor
teal junco
upper vapor
#

peak custom roles

grand flower
#

Bright's

upper vapor
#

just not public

icy knoll
#

all my plugins are public, even the one for my server lol

upper vapor
grand flower
#

Hasn't stopped servers from attempting to reproduce Bright's so

#

ยฏ_(ใƒ„)_/ยฏ

teal junco
icy knoll
covert flame
grand flower
#

In house is better than anything else

upper vapor
teal junco
upper vapor
#

check the labapi wrappers

teal junco
#

so yea

upper vapor
#

camera toy, speaker toy etc

icy knoll
teal junco
#

altho as a solo dev i usually like cutting corners whereever i can because i dont need to make my own implementatjon of everything

covert flame
#

Then how come I do this and it works fine:

if (gameObject.TryGetComponent(out AdminToys.LightSourceToy _))
{
    objectList.Add(Types.ObjectType.LightSource, gameObject);
    continue;
}

if (gameObject.TryGetComponent(out AdminToys.CapybaraToy _))
{
    objectList.Add(Types.ObjectType.Capybara, gameObject);
    continue;
}```But I cant do it for primitives
icy knoll
#

iโ€™m still waiting for axโ€™s scp prox chat :3

teal junco
#

meaning using plugins

teal junco
#

altho...

grand flower
upper vapor
grand flower
#

Outside of like C# libs

#

I would never use someone else's plugin on my own servers

icy knoll
teal junco
# teal junco altho...

i wanted a radio system that played gta radio stuff and i couldnt find anything useful so i had to code it from scratch in one morning ๐Ÿ˜ญ

covert flame
#

They really needa make a plugins-dev-chat-2

teal junco
#

gta radio rips from youtube are deadass 120 minutes

upper vapor
#

or give us threads here ๐Ÿ˜ญ

covert flame
#

My point still stands lol

upper vapor
#

oh

#

this

icy knoll
upper vapor
teal junco
upper vapor
#

just discord not discording

teal junco
teal junco
#

so if i load it in APA itll be like

#

1 gb ram per vid

grand flower
#

F

#

Run through ffmpeg

upper vapor
grand flower
#

turn into audio

upper vapor
#

how do you solve it

teal junco
covert flame
# covert flame

@upper vapor This is what I have to get all prefabs that I need, so how do I add all types of primitivbe to the object list, y'know

upper vapor
#

you download it? ๐Ÿ˜ญ

teal junco
#

as an ogg file

#

but i read it from the file as it goes

#

instead of well, loading the entire thing..

upper vapor
teal junco
#

If you want i can get the dll.

i cant get the source because i havent uploaded it to github and im halfway across the country from my laptop

#

anyways

upper vapor
#

no need, i get how you do that

teal junco
upper vapor
teal junco
#

once i had someone ask me to build a server blacklist into the plugin i made for them

#

like it checks the server and then disables if its a certain server ๐Ÿ˜ญ

upper vapor
#

wha

covert flame
upper vapor
#

oh

covert flame
#

Hence why Im not using a whole other dependency for it

upper vapor
#

well you need the primitiveobject prefab for all primitives
why not just
use the LabAPI wrappers

teal junco
#

relying on dependency is for pussies :trolley:

covert flame
#

Exactly, nah, I dont want a whole dependency to only use like 3 functions from it

icy knoll
#

i only use a dependency if iโ€™m using multiple things from it or itโ€™s too complicated to make myself

#

hence why secretapi ssss stuff lol

covert flame
#

Exactly, or im too lazy

teal junco
#

these pansy ass kids using "Player" and "FirearmItem"

celest thorn
#

I will wait for this for a lovely nw developer to answer but can we use SimpleWearable? because this seems to work and in someways with cosmetics system or primitives?

covert flame
upper vapor
#

use it

#

using LabApi.Features.Wrappers

#

PrimitiveObjectToy.Create

#

for structures, you still need the prefab method

random scaffold
#

for dblite need do Task.Run?

#

or it will be without any lags in main thread

covert flame
upper vapor
#

you don't add it to a prefab list when spawning primitivies

#

have an if like if (type is ObjectType.Cube or ObjectType.Sphere...) and in that case, spawn a primitiveobjecttoy with the labapi method

covert flame
#

Well I add it to the list when spawning something like the capybara

upper vapor
#

else, use the prefab list

#
public static GameObject Spawn(ObjectType type /* ... */)
{
    if (type is ObjectType.Cube or ObjectType.Sphere /* ... */)
    {
         var toy = PrimitiveObjectToy.Create(position, rotation, networkSpawn: false);
         toy.Color = color;
         toy.Type = type switch
         {
             ObjectType.Cube => PrimitiveType.Cube,
             // ...
         };
         toy.Spawn();
         return toy.GameObject;
    }
    // dictionary thing
}
covert flame
#

I thought you couldnt do the

toy.Type = objectType switch
{
    Types.ObjectType.CubePrimitive => PrimitiveType.Cube,
};``` because of the .NET version no?
upper vapor
#

it's not dependent on the .NET version

#

most C# features are syntactic sugar

#

just add <LangVersion>13</LangVersion> in a property group in the csproj

covert flame
#

You serious, I could've had that switch thing?

grand flower
#

Yup

upper vapor
#

it gaslights you into not being able to swith C# versions

covert flame
#

I'm gonna go cry in a corner for a bit, is that okay

upper vapor
#

yep, completely valid ๐Ÿ‘

covert flame
#

Okay, so, now that that's done, where does it go?

covert flame
#

Is it okay if my .csproj file looks like a nightmare?

upper vapor
#

yeah

#

it's uh

#

old framework style project

#

you can convert it to SDK-style pretty easily

covert flame
#

How do I do that please

#

That pisses me off so much that I couldve used that type of switch statement

upper vapor
#

you can copy my csproj
basically
<Project Sdk="Microsoft.NET.Sdk"> on the first line
and <TargetFramework>net48</TargetFramework> in one of the property groups
you can remove most bullshit from the property groups

covert flame
#

define most

icy knoll
#

99%

covert flame
#

Lemme guess type is ObjectType.Cube or ObjectType.Sphere /* ... */) was also another thing that I couldnt do before

upper vapor
#

correct

covert flame
#

Im gonna go cry again

#

All done

restive turret
icy knoll
#

so

#

i just relayed that info

#

idk what's bad about it

#

lol

restive turret
#

I never said it's bad

#

It just different than exiled ones

icy knoll
#

must have misunderstood then

#

mb

#

๐Ÿ˜ญ

covert flame
# upper vapor ```csharp public static GameObject Spawn(ObjectType type /* ... */) { if (ty...

Thoughts?```cs
private static readonly Dictionary<Types.ObjectType, PrimitiveType> ObjectToPrimitiveMap = new()
{
{ Types.ObjectType.SpherePrimitive, PrimitiveType.Sphere },
{ Types.ObjectType.CapsulePrimitive, PrimitiveType.Capsule },
{ Types.ObjectType.CylinderPrimitive, PrimitiveType.Cylinder },
{ Types.ObjectType.CubePrimitive, PrimitiveType.Cube },
{ Types.ObjectType.PlanePrimitive, PrimitiveType.Plane },
{ Types.ObjectType.QuadPrimitive, PrimitiveType.Quad },
};

public static GameObject SpawnObject(Types.ObjectType objectType, Vector3 position, Quaternion rotation, Vector3 size, Color colour)
{
if (ObjectToPrimitiveMap.ContainsKey(objectType))
{
var toy = PrimitiveObjectToy.Create(position, rotation, networkSpawn: false);
toy.Color = colour;
toy.Scale = size;
toy.Type = ObjectToPrimitiveMap.TryGetValue(objectType, out var result) ? result : PrimitiveType.Cube;
toy.Spawn();

    ItemCache.SpawnedToolGunObjects.Add(toy.GameObject);
    return toy.GameObject;
}

GetObjectPrefabs().TryGetValue(objectType, out GameObject prefab);
GameObject instance = GameObject.Instantiate(prefab, position, rotation);
instance.transform.localScale = size;

NetworkServer.Spawn(instance);
ItemCache.SpawnedToolGunObjects.Add(instance);
return instance;

}```

upper vapor
#

why not use trygetvalue in the first if

covert flame
#

I dunno, because Im not thinking

#

@upper vapor Am I allolwed to just change ALL == to is, ALL && to and, ALL || to or?

upper vapor
#

no need

covert flame
#

But what if, I wanna, because it looks better?

upper vapor
#

if you have a variable that can have multiple values, yes do that

covert flame
#
foreach (Door door in Door.List)
{
   if (door.DoorName == DoorName.SurfaceGate ||
            door.DoorName == DoorName.SurfaceNuke ||
            door.DoorName == DoorName.SurfaceEscapePrimary ||
            door.DoorName == DoorName.SurfaceEscapeSecondary ||
            door.DoorName == DoorName.SurfaceEscapeFinal)
        door.Lock(DoorLockReason.AdminCommand, false);
}

foreach (Door door in Door.List)
{
    if (door.DoorName == DoorName.None && !ElevatorDoor.AllElevatorDoors.Values.SelectMany(list => list).Contains(door.Base))
        door.Lock(DoorLockReason.AdminCommand, false);

    if (door.DoorName == DoorName.EzGateA ||
            door.DoorName == DoorName.EzGateB ||
            door.DoorName == DoorName.EzIntercom)
        door.IsOpened = true;
}

foreach (Door door in Door.List)
{
    if ((door.DoorName == DoorName.None && !ElevatorDoor.AllElevatorDoors.Values.SelectMany(list => list).Contains(door.Base)) ||
            door.DoorName == DoorName.HczHidLower ||
            door.DoorName == DoorName.HczHidUpper)
        door.Lock(DoorLockReason.AdminCommand, false);

    if (door.DoorName == DoorName.HczHidChamber ||
            door.DoorName == DoorName.HczArmory ||
            door.DoorName == DoorName.Hcz049Armory ||
            door.DoorName == DoorName.Hcz079FirstGate ||
            door.DoorName == DoorName.Hcz096 ||
            door.DoorName == DoorName.Hcz049Armory)
        door.IsOpened = true;
}```Does this look nice
upper vapor
#

oh these cases

#

yes change them

#

but for "one to one" equality checks no need to replace to is

covert flame
#

Yeah, IM GONNA CRYY

royal mica
#

why 3 foreach? or is this from separate files?

upper vapor
#

vs can probably do that for you

#

quick fix

#

convert to pattern matching

#

something

covert flame
#

Lord have mercy on my soul

royal mica
#

lmao, just do not get overwhelmed, you'll slowly learn ๐Ÿ˜„

covert flame
#

I've been coding for 6 years O.o

#

I have my moments

royal mica
#

OH ICANT

#

sorry for assuming

#

just lol

covert flame
#

Yup, no it's okay though

#

That's why humans can cry

upper vapor
#

also next you create a new project
choose the latest .NET SDK (8 or 9)
then add <TargetFramework>net48 in the property group and you're good to go

#

maybe don't forget unsafe code

royal mica
#

what do you need unsafe anyway

covert flame
upper vapor
#

okay

upper vapor
restive turret
#

Only for harmony

royal mica
#

me when publicize mmLol

upper vapor
#

not

restive turret
#

Oh nvm I dont really know.
All my plugin has unsafe code true

royal mica
#

No

upper vapor
#

existing in minecraft

royal mica
#

I like my dependencies private, no need for public showoff troll_smile

upper vapor
#

๐Ÿ˜ญ๐Ÿ˜ญ

covert flame
#

Okay well I cant wait to have a day dedicated to going through all my code, (there's so much ๐Ÿ˜ญ), and updating it to use the new things

royal mica
#

I yearn for the day when I sit down and unspaghetti the code

unique crane
#

Ax

#

You moved to Italy?

upper vapor
#

no

#

(un)fortunately not

#

tbh idk which would be better

unique crane
#

Italy is so chill

#

You just don't do shit after lunch

#

Until like 4pm

upper vapor
unique crane
#

I guess depends where

limber silo
#

are you italian david

unique crane
#

No

#

Czech

limber silo
#

oh cool

unique crane
#

But I spent a week in there several times

upper vapor
#

vacation != living

covert flame
#

I dream of that day

upper vapor
#

that's what retirement should look like
-# -ThePrimeagen

unique crane
#

XD

upper vapor
#

try living in hungary

unique crane
#

No thanks

upper vapor
#

not recommended

unique crane
#

It's not good here either

upper vapor
#

like omg it's so ice when you visit

#

but not for long term

#

i won't get into details lol

restive turret
#

ice ice baby

upper vapor
#

yep

#

๐Ÿฅถ

celest thorn
#

Pizza, pasta, mandolino place

covert flame
unique crane
#

Ok I'm clueless how to use mer

#

Time to make my own

upper vapor
unique crane
#

All I want is

#

Save in unity

#

Load in game

celest thorn
#

Assetsbundle

upper vapor
unique crane
#

Unknown

upper vapor
#

click them

unique crane
#

Maybe it's cause I'm on phone

upper vapor
#

bruh

unique crane
#

And I still have old discord

celest thorn
#

This exist

#

wait wtf is the issue?

#

its a random issue

unique crane
#

Issue

celest thorn
#

i fixed it 1 month ago

#

tho

unique crane
#

Pretty sure there are unclosed issues which has been resolved in labapi too

#

I'll go through them next update xd

celest thorn
#

lol

restive turret
unique crane
#

Ax still maintains sloc?

upper vapor
#

yes

#

update is in the works

#

just not pushed xd

unique crane
#

Damm

#

Make it for unity 6 pls

upper vapor
#

i am upgrading yes

unique crane
#

Yipee

celest thorn
#

wanna know what it took me to update to unity6

#

just placing it

#

thats it

#

not a single line

upper vapor
#

yup

#

and also no more lightshape

#

some deprecated methods

silver otter
#

.

celest thorn
#

i wanna ask a stupid question because i was looking at the guns etc... and i saw that there's no check for guns

#

like client can say whatever they want

#

and still be accepted

restive turret
#

What

celest thorn
#

there's nothing here to validate

#

like

#

there's shouldn't be a bit of validation?

#

if the player is really telling the truth?

hearty shard
#

it processes using backtrack

celest thorn
#

And im in the backtrack class rn

hearty shard
#

it sets your position temporarily and stuff idk

celest thorn
#

the backtracker seems only for desync

#

and thats it

#

not really a check

#

yep this i think its only called to the client so most likely the client does the validation and hands it over to the server

#

but its not unsecure to do something like this?

#

honestly im curious on how it works

restive turret
#

What validation you assume

celest thorn
#

like

#

Hey im shooting X but in reality im not shooting X

#

but Y

#

or even at nothing

#

and seems obv to have some kind of validation in the server

#

to verify what the client says?

hearty shard
#

it validates if you could shoot what ur claiming

celest thorn
hearty shard
#

its what backtracker does

#

no ?

celest thorn
#

no?

#

the backtrack only checks past

#

and thats it

#

if you are dead

hearty shard
#

it should backtrack you to claimed position if possible

#

and if not possible deny idk

celest thorn
#

thats it

true cedar
#

:3

hearty shard
#

anyway

#

u suck

true cedar
#

ur gay

upper vapor
hearty shard
icy knoll
#

do you guys know if there is any way to make ur own abstract plugin class for labapi? im making one for my plugin (with loads of plugins inside) that just makes it easier to load a translation... but labapi throws massive errors every time i try start the plugin

upper vapor
hearty shard
#

but you can make them virtual

icy knoll
#

hmm

upper vapor
hearty shard
icy knoll
hearty shard
#

public virtual void Die()
{
}

icy knoll
#

yes i know that

#

but like

hearty shard
#

99% sure you can make virtual regardless of abstract

upper vapor
#

Does labapi not check if the class is abstract

#

?

icy knoll
#

i just wanna override LoadConfigs() and add a translation, without having to do it for each fucking plugin otherwise ill go insane

hearty shard
#

it should but it might not since why would you have it like that

upper vapor
#

๐Ÿ˜ญ

#

Time for another loader PR

#

I wanna fix embedded dependencies anyway

icy knoll
#

literally this is all i do ๐Ÿ˜ญ

#

idk what to do for now other than copy and paste that into every plugin...

covert flame
#

Should I do all of the suggested actions?

upper vapor
#

Source generator Smart

icy knoll
upper vapor
#

How about aaaaa

hearty shard
#

kill ax

upper vapor
#

Separate class that has the config and translation

upper vapor
icy knoll
covert flame
#

Talking to you @upper vapor

upper vapor
upper vapor
restive turret
covert flame
restive turret
#

Ye sure

covert flame
#

Also there's 550 suggestions

restive turret
#

Why not

upper vapor
icy knoll
#

time to make a pr to labapi to check if the class is abstract...

covert flame
upper vapor
upper vapor
covert flame
#

Also, my IDE is VSC lol

icy knoll
upper vapor
upper vapor
icy knoll
#

okie

upper vapor
#

Did I just answer that twice

#

Crazy Span<Attention> toomuchtrolling

icy knoll
#

technically yes

#

๐Ÿ˜ญ

#

ur addicted to spans

unique crane
#

Goldfish attention span

icy knoll
#

you cant make ur own custom loaders now...

unique crane
#

Wdym

upper vapor
upper vapor
hearty shard
unique crane
#

Uhhhh

#

Make pr

upper vapor
#

I'll PR that if it hasn't been PR'd internally

icy knoll
unique crane
#

Nothing I would know of

icy knoll
#

no check

#

blegh

#

now gotta hope that ax's pr gets merged before the next sl update and the next sl update being soon...

unique crane
icy knoll
#

idk the release timetable

#

smh

unique crane
#

Lettuce then

true cedar
#

hi chat

#

except eve

#

everyone EXCEPT eve.

unique crane
#

Haiii

celest thorn
#

hiiii

celest thorn
# unique crane Haiii

David i have a question there's any way to force the you know outside of bounds skybox with like that sky etc...

#

outside of surface

#

i cannot seem to be able to force it to the client to load that

covert flame
upper vapor
#

no

#

personally i prefer .ToList and .ToArray over [..original]
just pick what looks better for you

covert flame
#

Yeah same, I prefer ToList()