#plugins-dev-chat
1 messages ยท Page 61 of 1
me when i \u1F0CF
๐
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();
due nw moment
some rooms don't have name iirc
if you can use type
You can do .Last() as a workaround for now
They know about the stale references bug
now bake elevators too and use a navmesh link to connect them together
muffles cries
Hello,
Is there any way other than patching to cancel the blinking effect of SCP-173 at the moment?
No
Sad moment
what type of effect
you mean?
Scp173BlinkTimer.ServerBlink because if you mean this one then yea you can
Yeah this one
ok yea you can
What's the event then ?
There's no event for that
you need to manually patch
and do it
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!
honestly its easy
just do
a prefix and return false
thats pretty much it
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.
most of the stuff is patching
labapi is so new
so you could suggest it
Already done 
Yeah, but it's better than NwPluginAPI so far
I prefer it even to exiled
i switched from exiled to labapi
it was the best thing ever
When we find equivalence on certain Events, I don't see any reason to use Exiled any more.
Is this tmux?
Not sure how well that handles it
If you can, try using a different terminal emulator (Linux ppl, please correct me)
yes
LA does it sometimes in ptero too
iirc
well seems will be same
Bruh
Yipee
What was the issue?
idk
Did you need to enter it another time? 
Checks out lmao
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
i have question
if rules in work, and my server is full RP
i have to make it norules?
What
b. If your server has no rules, clearly state this in your Server Name or Server Info.
For server hosting relating things, you might want to go to #serverhost-cat
no access)
No acess
then if you have no rules, you must state it
if you do have rules, you must include those rules
what the hell
you messed up your server name
you likely forgot to close a tag
slabbers design question
i dont know how many of you are aware of init only properties
but basically
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,
}
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
since you would prob expect it to refer to the same list
well the problem isnt that its required
its optional to provide the parameters
thats the issue
what lang version is that in?
13
Just upgrade
i mean c# 11 is only like a year old so
What's wrong with a new version of C#
i just don't think its necessary
No collection expressions? 
i dont like collection expressions in c# hot take
actually for arrays its fine
๐ญ
i just don't like the idea of [1, 2, 3] becoming any type u want under the sun
Do you actually type out Array.Empty<T>() every time?
ANYWAYS I NEED OPINIONS ON THIS
im not using arrays nearly that often
Well
Constructor with IEnumerable might be more straightforward for consumers
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
True
/// <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;
}
That's an insane xml doc
its just reusing docs
I don't think it's an issue if you have the property as you showed it earlier
If it's read-only, it shouldn't change
Yeah but I've never seen inheritdoc in tags
Just kinda threw me off
Ehhh
i could add a warning but idk it feels very hcaky
How about you make a
IEnumerable<Whatever> ParametersCopy { init => } 
thats even UGLIER
if i did do this i'd just put it in the remarks or comments
thats it a copy
Then
Shit
Yeah do that
And keep the original prop you showed
You can also do .ToList().AsReadOnly()
No visible constructor call
wdym
i mean ig i can do this but i dont wanna
BasicElement element = new BasicElement.Builder(500f, "hello")
.AddParameters(param)
.SetVerticalAlign(...)
.Build();
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
its not necessarily making the builders themselves
i just stick with .Build(), it's annoying but eh...
-# next.js my ahh
wdym
Make it make it
next.js slop...
ig here i could just make a shorthand new BasicElement(500f, "hello"); which internally calls a builder
i have a TranslationBuilder thing to replace params in with my discord bot plugin and .Build() is quite annoying but eh
How about an implicit conversion froma builder to the result
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
i feel like a builder pattern is the "correct" thing to do here but like
Implicit operators:
wdym
imagine this
like string str = SomeThing()
.Add();
and it just implicitly becomes string
prob
i just don't trust that people are smart enough to know how to use builders
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
idek how to do that...
add an operator to your class
Aha
Not that difficult thougu
i dont like implicit operators
Womp
with some exceptions
i hate when no spawn protection
how does it even work? legit how I just put it or?
iirc according to c# guidelines ur only supposed to make an implicit cast if doing so would lose no information
hmm
Okay and..?
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
Kek
i am of the opinion
SL# with x3rt when 
that u shouldn't be allow to define ur own conversion operators
Yeah like
vector3.Subtract(otherVector)
Yeah fair
But
I disagree
Explicit conversion operators exist, too 
I don't see that much use for them though
explicit conversion operators have even less of a reason to exist ngl
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
Uh
Why would that be the exact reason
It's also a method, so..
Don't say it, slejm...
that reminds me i wish we could use simd
Why would that be better for SIMD rather than normal methods
now that i think about it
We can
Not much in SL tho 
it prob wouldnt be
Yeah it's still a method call, just syntax sugar basically
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
okie
tried implicit operators...
just removed 100 .Build() method calls from my code
so peak
i swear to god. if they implement discriminated unions using some class bullshit like in f#
i'll throw hands
there is a proposal!!1!1
REJECTED????????
oh
yeah this was what i was looking for
the one i sent felt off ๐ญ๐ญ๐ญ
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
rust enums, eh?
well
i mean i prefer the enum keyword because i dont like unnecessary keywords
plus i think its slightly more understandable to people
extension keyword
extension is slightly more understandable since idk what u would replace it with
maybe a like
public static class Extensions(this IEnumerable<T> enumerable)
more extensible 
hii chat
hello 02
how are you doing?
i guess happy?
lol
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
what
1 sec
this is the only thing i want in c# rn, so used to it in typescript and then when i come to c# im like... :c
real
gotta love my false | undefined
but fr though discriminated unions are amazing
How can I make a hitmark on a player?
Player.SendHitmarker
Woo
make a plugin that makes this not stupid
i nono wanna
how much does sl even use
use what
network reader
like
its pooled for a reason probably....
1k seems excessive, but idk how much itd use at a time roughly
Technically only one
heh?
but maybe like
100?
You're not gonna be reading multiple messages at once
Reading messages from clients
yeah but how much
1 per message
And you're not reading multiple messages at once (unlikely)
blehh!
i mean
Unless Mirror is doing something weird idk
i think its bad to assume that only one networkreader is in use at any given time
It's not if you know the logic behind it, like why would there be multiple messages coming in at once (unless it's multithreaded which I don't believe it is)
You pass in the same reader
Because it's reading that one payload
Unless I'm not aware of something
a ReadX() method might get a new networkreader
Yall suck!!
theres often multiple networkwriters at once so
Don't read methods pass in the network reader
That would make more sense than what you're describing
but having 1k readers
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
U do it
i would if i wasnt working on ruei
Hmm
Say what
Is that inside mirror or nw?
If in mirror then 
mirror
Check their readme ig
ยฏ_(ใ)_/ยฏ
huh
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
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
No clue
it would be so neat if we had a translationparameter or something so i could incorporate base game hints :3
clientside mods when
northwood has made it clear they dont like client side mods
i just need base game hints to not hide all of my hints
You have reached the limit for Keycard (3/3) 
Shot themselves in the foot with an antimateriel rifle on that one
oh well
the urge to correct ur spelling of materiel
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?
there is a chance they change their mind some time in the future
materiel means like
equipment
right
i think so
oops
i just remember it being antimateriel and being confused why it was an e
yearhhh
they also obfuscated the client code for some reason
mfw anticheat is useless
Still wonder why even bother wasting money on it when there's solutions made by bigger companies available
i genuinely dont get whats the point of that, there might be some reason but i dont know
IL2CPP for performance probs
are u sure thats not just it being cpp
no im not actually
i think obfuscating it is like literally a checkmark
i dont know how compilation tends to work
that might be something different
Clearly useless anyway on that part 
basically it just turns it into low level code
(all i know is many unity games are fully decompilable and SL is not)
i mean doesnt most compiling work that way?
ah alr
well
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
how can i check per code if a bullet is already in the chamber of an automatic weapon?
.
pleasee nw
how can i change the max ammo for a gun .w.
Well
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
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
How are you spawning it
NetworkServer.Spawn()
What are you spawning
a gameobject
Send code
GameObject instance = GameObject.Instantiate(prefab, position, Quaternion.identity);
NetworkServer.Spawn(instance);```
What's the prefab
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
So uhh O.o
IDoorPermissionRequester how i can get it from the player?
What are yout rying to do with it?
if (player.RoleBase is IDoorPermissionProvider doorPermissionProvider)
{
// Now you can use the doorPermissionProvider from the player
}```
remote keycard
then who requester
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
why not just requester.CheckPermissions(IDoorPermissionProvider provider)?
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;
}```
only scp can be provider?
Fun fact those already has bypass too
At least you're not wasting money making your less efficient version
I know
Which is why considering the limited funds NW has
Making their own is stupid
Yeah, anyway back to sleep see ya at 12'
?
@grand flower ^^
Don't really have any idea based on that code unfortunately
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);
i'll do it
ReloadingWeaponEvent, get the IPrimaryAmmoContainer and cancel if it has 0 stored ammo
you can't just create a primitive and spawn it
you must use the primitivobjecttoy prefab
we have ScaleMessage but for now i'd suggest sticking with this approach, it doesn't brick the server
-# if you use ReadyList you're fine, Player.List will break some things
I'm aware of the scale stuff, and yeah, using Player.List absolutely totals everything
Yeah, one of the major things that breaks is reloading
That would explain why only primitive doesnt work lol
Is it so destructive?
shouldn't be a replacement?
setting the scale on role change causes the server to hang
so as always, you gotta do Timing.CallDelayed(0.1f

I love CallDelayed
always works
best friend of sl modders
CallDelayed is cool
yup
what if you're eve and you have a problem with NW
also it doesnโt even have to be 0.1, 0.0 also works the exact same way
not for scalemessage apparently ๐ญ๐ญ
damn
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
spawned event is not called iirc
RoleChanged should work, no?
that's after the role is initialized
if you delay one frame yes

sorry its the exiled brain rot
ยฏ_(ใ)_/ยฏ
lmaoi
im primary exiled user, spawned event for exiled is ran after role is changed
this includes death btw
spawned as spectator
yeah
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"
i think i saw someone once suggest exiled wrappers for labapi events
is TotalDamageDealt can be trusted?
For jailbird?
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
If you're just trying to check how much damage was dealt with the jailbird
Yes that's good
generally it can be trusted if its like, part of the wrapper
i dont think people will implement broken properties on a wrapper
๐
exiled fell off
and on hurting, TotalDamageDealt always 0
exiled has some cool stuff
yes
i use lab api and exiled both
but it's dying now cuz labapi exists
that way i get anything i want
i will be sad because exiled took care of me back in 2022, and again in late 2024
๐
trueing
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
I don't think so

Exiled has a lot of cool things that LabAPI doesn't
exiled's CASSIE events are one specific example i recently had to deal with
it took me a bunch of patching and snooping through code to achieve the same thing
At least we can patch stuff
once people port the exiled stuff to LabApi its truly gonna be over ๐
Can we hold an exiled funeral
because exiled walked so labapi could speed walk
better than ditching EXILED for NWAPI
oh gosh
its just labapi
the suffering
all my future plugins arenโt going to have an exiled version lol, and i started with text chat
theres no real reason to have an exiled version if youre starting from labapi
my plugins have exiled versions because they always start from exiled and the labapi port is always less stable
yep
i started a project with EXILED and NWAPI support but then labapi emerged
i had labapi & exiled for some time but then just removed exiled
when i achieved almost full feature parity between my exiled and labapi version, euphoria does not adequately describe my feelings
for my cassie plugin
๐ฃ๏ธ๐ฃ๏ธ
So how can I add the prefab to that lsit with all different varients of the primitive?
i love no custom configurations for my plugins now
set the primitive type
PrimitiveObjectToy.Create(..., networkSpawn: false)
then set the type
and spawn it
-# labapi wrapper
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
Just make your own
and people will always use their own system
i never liked exiled custom roles tbh
iโm surprised nobody has made like a really good custom items api yetโฆ
or custom roles
can relate
who
peak custom roles
Bright's
just not public
all my plugins are public, even the one for my server lol
cuz you work for yourself basically
i prefer to do it this way but i understand why
true
Is that what you would do for any admin toy?
In house is better than anything else
all primitives
Because its proprietary and fully fitted to your exact needs
check the labapi wrappers
so yea
camera toy, speaker toy etc
iโm trying to make it so the majority of the stuff on my server is my ownโฆ unless a developer that i consider better than myself has made it then iโll use that instead
altho as a solo dev i usually like cutting corners whereever i can because i dont need to make my own implementatjon of everything
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
iโm still waiting for axโs scp prox chat :3
meaning using plugins
what
altho...
I hate using third party stuff
await SecretAPI.ReleaseVersion2Stable();
another eve issue smh
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 ๐ญ
They really needa make a plugins-dev-chat-2
gta radio rips from youtube are deadass 120 minutes
or give us threads here ๐ญ
wdym gta radio
My point still stands lol
iโd ping lucid if they werenโt LOA

what do you mean this
this
just discord not discording
also gta radio is procedurally generated, but i cant find the individual pieces anywhere online which sucks

turn into audio
how do you solve it
i made a special solution which reads the audio file in real time
@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
you download it? ๐ญ
no i predownload it
as an ogg file
but i read it from the file as it goes
instead of well, loading the entire thing..
yeah that's good
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
no need, i get how you do that
thats a cool thing about being able to make your own plugins
it seems you're making yet another map editor
consider https://github.com/Axwabo/slocLoader
it has an easy api to spawn objects programmatically
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 ๐ญ
wha
I'm not, I'm making a gun, that spawns gameobjcts when shooting, nothing more, nothing less
oh
Hence why Im not using a whole other dependency for it
well you need the primitiveobject prefab for all primitives
why not just
use the LabAPI wrappers
relying on dependency is for pussies :trolley:
Exactly, nah, I dont want a whole dependency to only use like 3 functions from it
true
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
Exactly, or im too lazy
thats why i work with REFERENCEHUBS and ITEMBASE and ROLEBASE
these pansy ass kids using "Player" and "FirearmItem"
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?
How would I use LabAPI wrappers
you just
use it
using LabApi.Features.Wrappers
PrimitiveObjectToy.Create
for structures, you still need the prefab method
You're gonna have to spoonfeed me a second here, I want add a gameobject to a list liek as the prefab, like you would've saw in that function
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
Well I add it to the list when spawning something like the capybara
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
}
I thought you couldnt do the
toy.Type = objectType switch
{
Types.ObjectType.CubePrimitive => PrimitiveType.Cube,
};``` because of the .NET version no?
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
You serious, I could've had that switch thing?
Yup
if you're using VS...
it gaslights you into not being able to swith C# versions
I'm gonna go cry in a corner for a bit, is that okay
yep, completely valid ๐
Okay, so, now that that's done, where does it go?
Is it okay if my .csproj file looks like a nightmare?
yeah
it's uh
old framework style project
you can convert it to SDK-style pretty easily
How do I do that please
That pisses me off so much that I couldve used that type of switch statement
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
define most
99%
Lemme guess type is ObjectType.Cube or ObjectType.Sphere /* ... */) was also another thing that I couldnt do before
correct
Feel free to pr your own change or whatever
ur the one who said it was bad
so
i just relayed that info
idk what's bad about it
lol
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;
}```
why not use trygetvalue in the first if
I dunno, because Im not thinking
@upper vapor Am I allolwed to just change ALL == to is, ALL && to and, ALL || to or?
no need
But what if, I wanna, because it looks better?
if you have a variable that can have multiple values, yes do that
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
oh these cases
yes change them
but for "one to one" equality checks no need to replace to is
Yeah, IM GONNA CRYY
why 3 foreach? or is this from separate files?
I DONT KNOWWW ๐ญ
Lord have mercy on my soul
lmao, just do not get overwhelmed, you'll slowly learn ๐
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
what do you need unsafe anyway
There aint gonna be anew project, this is the project
okay
publicized assemblies
me when publicize 
Oh nvm I dont really know.
All my plugin has unsafe code true
No
existing in minecraft
I like my dependencies private, no need for public showoff 
๐ญ๐ญ
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
I yearn for the day when I sit down and unspaghetti the code
mamma mia
me when
i heard otherwise
I guess depends where
are you italian david
oh cool
But I spent a week in there several times
vacation != living
Wake up, fresh day, feeling fresh, sun is out, sit down, nice clean desk with a clean room, cup of coffee, relaxing music while you unspaghetti your code
I dream of that day
that's what retirement should look like
-# -ThePrimeagen
try living in hungary
No thanks
not recommended
It's not good here either
like omg it's so ice when you visit
but not for long term
i won't get into details lol
I'm gonna do it, I'm gonna make some nice hot chocolate, sit down, and go through every file and update it all, I am just so excited
there are 3 other editors, 2 of which are public
Unknown
click them
Maybe it's cause I'm on phone
bruh
And I still have old discord
Issue
Pretty sure there are unclosed issues which has been resolved in labapi too
I'll go through them next update xd
lol
Slocloader, mapforge
Ax still maintains sloc?
i am upgrading yes
Yipee
wanna know what it took me to update to unity6
just placing it
thats it
not a single line
.
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
What
there's nothing here to validate
like
there's shouldn't be a bit of validation?
if the player is really telling the truth?
it processes using backtrack
it sets your position temporarily and stuff idk
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
What validation you assume
Validating what the client says of who is the client shooting
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?
it validates if you could shoot what ur claiming
it doesn't seem to do it anywhere?
it should backtrack you to claimed position if possible
and if not possible deny idk

ur gay
ax homophobic?!?!?
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
I'm one of yall queersies, dw
you cant make it abstract
but you can make them virtual
hmm
It's just funny to say "omg they're gae
"
so im curious about how to do this then...
public virtual void Die()
{
}
Uh
i just wanna override LoadConfigs() and add a translation, without having to do it for each fucking plugin otherwise ill go insane
it should but it might not since why would you have it like that
literally this is all i do ๐ญ
idk what to do for now other than copy and paste that into every plugin...
Should I do all of the suggested actions?
Source generator 
never used nor seen one i think
How about aaaaa
kill ax
Separate class that has the config and translation
No NAudio for you
๐ญ
Talking to you @upper vapor
Then you only need to copy paste like 2 lines
Which ones
2 most common are the new simplifications and the Collection initialization simplifications
Ye sure
Also there's 550 suggestions
Why not
I'd do that, yeah
But first please check if your IDE has a quick fix for that
time to make a pr to labapi to check if the class is abstract...
I've already done half of that 550
How about you let me do that
Uuuuhhhh
Also, my IDE is VSC lol
will u remember tho...
The C# dev kit should have quick fixes, no?
I need another change in the loader anywag
okie
Yes
Did I just answer that twice
Crazy Span<Attention> 
Goldfish attention span
david why doesn't labapi check for abstract loaders...
you cant make ur own custom loaders now...
Wdym
Make it ReadOnly
You can
If you reinvent it 
if (!plugin.IsAbstract) before instaniating
I'll PR that if it hasn't been PR'd internally
im not building my own labapi ๐ญ
Nothing I would know of
yup
no check
blegh
now gotta hope that ax's pr gets merged before the next sl update and the next sl update being soon...

wdym leak buddy
idk the release timetable
smh
Lettuce then
Haiii
hiiii
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
Do you use [.. ] instead of thigns like ToList()
no
personally i prefer .ToList and .ToArray over [..original]
just pick what looks better for you
Yeah same, I prefer ToList()


