#plugins-dev-chat
1 messages ยท Page 27 of 1
private static bool Prefix(Intercom __instance, ReferenceHub hub, ref bool __result)
{
__result = false;
if (_proximityChatModule == null)
{
CustomModule.TryGetModule(out _proximityChatModule);
if (_proximityChatModule == null)
return true;
}
if (!CheckRange(hub, __instance) || VoiceChatMutes.IsMuted(hub, true))
return false;
if (_proximityChatModule.ToggledHubs.Contains(hub) || hub.roleManager.CurrentRole is HumanRole)
{
if (hub.roleManager.CurrentRole is IVoiceRole voiceRole)
__result = voiceRole.VoiceModule.ServerIsSending;
}
if (!__result)
return false;
PlayerUsingIntercomEventArgs ev = new(hub, Intercom.State);
LabApi.Events.Handlers.PlayerEvents.OnUsingIntercom(ev);
__result = ev.IsAllowed;
return false;
}
private static bool CheckRange(ReferenceHub hub, Intercom intercom)
{
if (hub.roleManager.CurrentRole is not IFpcRole fpcRole)
return false;
return (fpcRole.FpcModule.Position - intercom._worldPos).sqrMagnitude < intercom._rangeSqr;
}
definitely over done
but still
intercom for scps :D
maybe, in the playerLeftEvent try logging the player like this "${ev.Player}" and see if it comes up as destroyed
it does say that the gameobject tho is == null to false
so referencehub still exist
also log before and after counts when you remove(or just log the bool returned)
yea i did
and it says
1
then after sanitizing 0
so yea something was going on
Wait
@worthy rune could it be that the player is dying?
and it triggers the dying event?
most likely, it also triggers role changed too
That could be why?
so if i just add on my respawn logic
x.ReferenceHub == null
it shouldn't
it might still be non destroyed at that point
even if OnDestroy has already gone through, unity waits until the end of the frame before flagging as destroyed
let me test
so yea i will add a flag
oh wait
i can actually do
if (player.Role == RoleTypeId.Destroyed)
yeah that should work
yep it works
oh yeah riptide
how would you go on fixing Ghostly effect in plugins that allow players to keep effects
cuz ghostly breaks client side
only way is to ig remove it and readd it?
๐ญ
sounds like a base game issue, make an issue and someone can take alook
thats probably the only way atm
yeahh
Cuz client has to get told of it
And client doesnt expect it to stay after role change
and to allow 1344 to be kept i need to patch the item giver thing probably
3114
Disguising issues, invisible to clients sometimes, and servers breaking after round restart due to broken ragdolls
On a modded server and on vanilla
odd
Thats
Ik the cause btw
Of that
You are using Player.List somewhere
And telling server smth you shouldnt
nope and we patched that
yeah it is a cause for sure
You send server a player update
but 3114 kept having issues after all those fixes so idk
well
you issue
cuz i fixed it with removing server host from getting network msg about scale
how would i make the server restart after every round?
since my coding breaks the server after every round r estart
hard restart as in?
๐ญ
That is hard restart
Or should be
It reloads plugins etc
rnr is hard restart yea
Yes
Ah
how do i trigger rnr?
ServerStatic.StopNextRound = ServerStatic.NextRoundAction.Restart;
i dont want to use Server.ExecuteCommand("rnr"); since i ehard like thats unoptimized or smthn
this
I run the game in Ptero and sometimes the commands are eaten and the server doesn't recognise it 
Its just never good to use commands
exactly same with me
idk why multiadmin ptero just eats the command but it is so random
But yea you can check commands for what they do, but calling the commands is extra steps
Multiadmin...?
Why not localadmin?
not multiadmin, the default that ships
the server already suffers enough with my shitty coding
how can I disable/lock win conditions and trigger a win myself when a condition is met?
so I just set IsAllowed to false, how do I trigger one then?
Don't set IsAllowed to false
although
sec
Round.End()
How can I do this?
thanks, is there a way to say which team won?
Probably a harmony patch
Modify it in OnServerRoundEnding()
I think cedmod does that if you want to look
got it thanks
Yeah I tried that but if I want to make it look like in the picture then it just replace the name with ...
If I size it to 15 it works but as I see on the picture it works with the original size
is there a way to remove the alarm from EZ red room?
I dont believe so
is it some client sided thing then?
or is it just like not accesable?
or not known
either way just wondering
you can access it from the server and do what ever you want, but none of the changes will sync with the client
ah
when do you make everything server sided
trust
cant go wrong

isnt making everything server sided good for like preventing cheats or smthn
since its all managed by server
idk what im talking about
i dont know shit about networking ๐ญ
Errr
would mean alot more load on the server though
sending textures to client 
Um
Well sometimes client needs to control smth
But server should be validating it 99% of the time
i am not a professional network person ๐
The 1% is when its me (omw to do horrific things)
scared to even add Mirror as a reference ๐ญ
Rly useful sometimes
oh shit i do have it as a reference
dont even know what i use it for
also how do i get a rooms gameobject from a RoomLightController?
trying to attach carmelldansen to a room
#serverhost-cat message
.gameObject

Room.Get or smth
light.Room.gameObject.transform;
ok ๐ญ
Show code
foreach (var light in RoomLightController.Instances)
{
if (light.Room.Name == RoomName.EzRedroom)
{
light.gameObject.AddComponent<RainbowLight>();
AudioPlayer audioPlayer = AudioPlayer.CreateOrGet($"{Time.timeSinceLevelLoad}", onIntialCreation: (p) =>
{
p.transform.parent = light.Room.gameObject.transform;
Speaker speaker = p.AddSpeaker("disco", isSpatial: true, minDistance: 5f, maxDistance: 15f);
speaker.transform.parent = light.Room.gameObject.transform;
speaker.transform.localPosition = Vector3.zero;
});
audioPlayer.AddClip("carmelldansen", 3, true, false);
}
rainbowlight works
just not
audio
Err
is my code just shit? ๐ญ
In my case, I used the second method. It is easier than creating a Harmony patch
@worn gull
how can I disable ntf/chaos respawn waves?
there are some other ways but you could give all waves -50 tokens
which will prevent them from spawning naturally but they can be spawned with wv spawn ntf/chaos still etc
since wv spawn doesnt check for tokens
what class/method?
ill check 1 sec
I will try to do it, thanks
OnWaveSpawning
no idea but try like RespawnWave or smthn im not sure
Set IsAllowed to false
that denys wv spawn tho i think
doesn't have anything related
try NtfWave?
it would be nice if I still could control it, instead of denying everything
there was some sort of exiled thing for it but i dont know im too used to exiled ๐ญ
LabApi.Features.Wrappers.RespawnWaves.PrimaryMtfWave.RespawnTokens = -50;
that should work for MTF
i think
thanks I'll try it out
Surely theres a better way ๐ญ
could do isallowed on the event but that fucks over wv spawn ๐
idk if there is a way to stop them from naturally spawning
maybe the event has a bool like IsNatural or smthn
question, does d class always spawn as chaos conscript when they escape?
yes
well
Unless theyre cuffed
Then its specialist ntf
No its private xd
thanks
Damn
I proved myself wrong
I cant believe youd make class d privates
Are they not good enough?
Discrimination against d boys?
nvm fixed
Provided to YouTube by The Orchard Enterprises
That's The Way It Is ยท Daniel Lanois ยท Rocco DeLuca
The Music of Red Dead Redemption 2 (Original Soundtrack)
โ 2019 Lakeshore Records
Released on: 2019-07-12
Producer: Daniel Lanois
Auto-generated by YouTube.
Im gonna murder you
You wouldnt do that
Oh okay
How does one change the amount of players that will spawn in a wave
ntfwave wrapper or smthn
there is a number for amount of ntfprivate etc
unless im wrong
There is total player multiplayer
And amount of Sargents and captain(s)
Same for chaos wave
awesome ty
Multiplayer is crazy
๐ญ
https://cdn.discordapp.com/attachments/880533488539951104/1375250528409223208/image.png?ex=6831015c&is=682fafdc&hm=87d121212e2759079e4c24535a613f36e603a90d7e73db45d84c02937482b63a&
Ported every plugin that I have to LabApi (I wanna die) 
8 hours doesn't sound half bad
Took me probably 2 days in beta
took us two weeks and there was 3 of us ;-;
And i still fixing some bugs causing some issues
same here hah
but we got ours stable and playable
still got some bugs but none that are critical
I have to fix bunch of things since idk what bugs (the bunny)
I don't think my thing ever be stable
oh you're the new brights dev
aren't you
Yeah
is matrix not there?
anyways have fun dredging through my code lol
well, 3 on SL
ah
Although Matrix wasn't fully available
Wasn't so bad ^^
Not sure who each piece of code belonged to tbh
One thing I will mention though is you tend to do loop until random element is acceptable a lot
instead of filtering then choosing a random item
i only do that if its a small number of items that don't meet the criteria
I can't use CommandHandler or ICommand in my project for some reason, am I missing something?
plus that requires you to convert an ienumerable to a list
and then get a random item
or make 2 passes
add a reference to CommandSystem.Core.dll
I'd still go for that instead tbf
eh
i assumed they were baked into LabApi, thanks
There was only one place where it could've been bad bad so it's not a big issue anyway
i did all the codematcher transpilers
aye, barely touched the transpilers
did write a ton of patches and remove some existing ones that weren't needed anymore but transpilers aren't my thing heh
ic
Got a backlog of stuff to rewrite once we have time and there's no pressing issues to resolve
But so far so good
i had a rewrite backlog too lmfaooooo

I just left a buttload of todos in the codebase while I was porting/rewriting bits over
i made a whole ass mega pr to implement a new custom role system, a new event system, and like a billion bug fixes and then i got burnt out and never finished it
well glhf i have to go
aye, cya
Uhhh question
Does null propagation not work with Unity
I'm getting some null refs that are pretty surprising
!player?.ReferenceHub?.gameObject
it doesn't
fucking UNITYYYYYYYYYYYYYYYYYYYYY
it only overrides == so that it equals null
if the internal c++ backing thing is null
every day working with this god forsaken engine I understand i've made the right choice leaving it years ago
Never had that issue with UE
Weak object pointers when I do funky things that don't keep the object referenced by the GC, otherwise it's safe
yea but you still have to deal with the fucking mess that is c++
thats like getting used to living in smogged london
or well, when it had networking considering they kept deprecating everything
C# was my first language, C++ my second, I like both
i hate c++ on an indescribable level
to each their own
and now I leave to go through the entire codebase and remove all of my fancy null propagation stuff i did
surprised most of it held up
c# is just bloated to all hell
you're going to eat the nres and you're going to enjoy it
oh I just got sent a handful and that's how I discovered the issue

I figured I was forgetting something
Player needs an IsDestroyed property like the other wrappers
mostly for latent actions
Player::DisplayName = "What";
is there a cap on name length?
setting my cap to 32 bc arbitrary number but idk if theres an actual cap above or below that number
idk
hey can someone coach me on creating plugins
teach me the lingo
i have the creative thinking already
brute force it with the tutorials and example code
if u literally just
look up enough things on google you can learn the basics
im not gonna sit there and waste my energy looking up shitty made tutorials when someone here has 3 times the knowledge than the guy making the tutorial
The guy who made the tutorial is probably smarter than all of us.
Look, if you don't want to do the tutorials, I don't know if this is for you.
If you're having trouble, I think we would be happy to help you set up a code environment and IDE
But I think being open to using tutorials is a good thing
no i hate tutorials
reminds me of class lectures
well the video ones at least
i can probably do a written one'
honestly i could learn by just typing the alphabet
the syntax has descriptions
there are written tutorials
and you should also delve into other codebases
Set the config to restart after every round
Does the floor in front of the 914 input/output doors have a weird collider?
grenades exploding at that spot don't do damage to players around it
why are you here then
this is the labapi category
if youre looking for exiled stuff youre in the wrong place
I think they mean there's no labapi tutorial
which would make sense considering it's barely out
if you look at the githubs there are basic tutorials and you can learn a bunch of other stuff by looking at the source for other plugins in #1336031121699377213, no ones gonna directly coach you but if you have small questions while you're learning you can just ask every now and then
mb for that assumption
heck it's anywhere close to 914
no explosion damage
same next to generators
is there a way to change the trace mask so I can ignore 914/generators when blowing up a grenade?
there's a ton of things on the map that seem to just allow players to tank a grenade just because of the colliders
this thing in front of nuke too
;-;
939 room pipes too
That's annoying
has anyone figured out if you can actually change the behavior of the snake game yet
im looking at the dll and it kinda looks like you can but idk fs and i dont want to try unless i know its possible
Not exactly a tutorial but it's good to get started
why do you think so?
Snake.dll is using a network writer to sync its display to every player
idk the specifics im new to this
it has these methods and it looks like you could probably make your own minigame with snake by using UpdateDisplay and building your own SnakeDisplay object
i have no idea how to actually take advantage of things like this so thats why im asking if its worth trying so i can learn how to do it
Decompile
Check if the player's current item is a ChaosKeycardItem (base-game)
There should be some SendRpc methods
I'm really not sure what you mean by base-game
i assume basegame means everything under SCP Secret Laboratory Dedicated Server\SCPSL_Data\Managed?
or only Assembly-CSharp
Mostly that since the game has many dependencies
The game's code is whay we refer to as base-game
i thought so, just wanted to clarify
Including systems like GameObject pooling (from Pooling.dll)
Yep you were correct
im like entirely new to C# coming from minecraft plugin and mod development in java, the apis and frameworks are super easy to use over there so im struggling a little bit here
how would i get this from a LabAPI Player?
Try LINQ
When you break free from j*va streams
if (player.CurrentItem?.Base is ChaosKeycardItem card)
// do something
i was trying to go thru player.Inventory first oops
thats a lot simpler than i was thinking it was
That would work, too
Though LabApi helps a bit lol
it looks possible but it seems like it means i have to figure out how to build snake packets and i dont really want to do that
hello tech!
That's me ๐
what u doin here
idonwanna
there are public methods to send and process received snake packets
but i dont wanna mess with that it seems like a lot to tackle rn
maybe l8r
c# is def a lot more fun than java
how do i get how often the player used SCP330?
yea
super easy way with no basegame would probably be to use a Dictionary or similar data type alongside PickedUpScp330 or InteractedScp330 events
i found it nvm
whats the basegame way to do it
yea its just ev.uses lmao
for the event in LabAPI atleast
๐ฃ๏ธ ๐ฃ๏ธ
i will admit i do miss the in depth spigot and paper javadocs
basegame got zero documentation
for the moment. maybe someone will do some in the future
Feels like a scavenger hunt sometimes
But it help you learn to not be dependent on documentation
i cant lie
if you know how to code its usually easy to not be dependent on documentation if the code youre looking at is good
just really inconvenient
It is, especially on decompiled code since it takes extra effort to understand what is going on
and then there is code which you do not understand even with documentation 
hey uh is there a way to Enable effects like this:
plr.EnableEffect<Config.Effect>(); ?
You can get the effect by its name
do you have an small example atm?
probably Config.Effect.GetType() or smth (ill probably get evelyn angry with this or smth idk)
well thx will be trying
i got it working on my own. thanks for the help tho
becoming a chaotic neutral developer and adding documentation on obfuscated code
Creating a community pdb 
didnt work but server static thing worked
the server I work on is magical how some things dony work
how to get the default color from a light controller?
Base.NetworkOverrideColor, Base.OverrideColor and OverrideLightsColor properties all return Color.Clear
i think there is like a resetcolor thing and it outputs the color or smthn
idk
when did i turn orange
Setting it to Color.Clear will reset it to the default color
cant find it :/
well, im not trying to reset the light color, but actually get the Color object
๐ญ
which is the default
Hmmm
im trying to add a smooth transition
and i cant do that if the start color is always clear
as everything just becomes dark
controller.transform.parent.GetComponentsInChildren<RoomLight>().First().LightSource.color
You need publicized assembly for it
alright
Called from the RoomLightController
im getting InvalidOperationException: Sequence contains no elements when using First()
roomLightController.Base.transform.parent.GetComponentsInChildren<RoomLight>().First().LightSource.color
thats mostly working, im getting some NREs but ill figure it out
thanks!
i need to get to know how to get components, seems like a really useful skill
what are you doing ๐
effect keep patch
ghostly stays bugged on client
i might just need a frame delay tbh
yeah i used frame delay when resyncing stuff
probably good
for effects specifically
๐ฅ
If I set UnlockingGenerator IsAllowed to true still not unlocking it
PermissionUsed callback;
bool flag = this.PermissionsPolicy.CheckPermissions(ply, (IDoorPermissionRequester) this, out callback);
PlayerUnlockingGeneratorEventArgs ev4 = new PlayerUnlockingGeneratorEventArgs(ply, this);
ev4.IsAllowed = flag;
LabApi.Events.Handlers.PlayerEvents.OnUnlockingGenerator(ev4);
if (!ev4.IsAllowed)
flag = false;
if (!flag)
{
if (this._deniedStopwatch.Elapsed.TotalSeconds >= (double) this._deniedCooldownTime)
{
this._deniedStopwatch.Restart();
this.RpcDenied(ply.GetCombinedPermissions((IDoorPermissionRequester) this));
if (callback != null)
{
callback((IDoorPermissionRequester) this, false);
break;
}
break;
}
break;
}```
So this is the game code and if I set the ev4.IsAllowed to true then the flag is not turning to true or am I wrong?
nothing is setting flag = true
Yes
despite you cannot do anything even if you set IsAllowed true
deny the event and unlock it yourself
Okay
This should be fixed, no? bruh
well there is so many stuff that NW can done with these events
No, SL uses Any Deny approach, since managing every plugins flag setting would be a nightmare
Ah okay
If you check, none of the events are permissive, all of them orients towards denial
if NW would add CanOpen that would be better
bc rn if you set isallowed true but the permission return a false you cannot change that
Yup and that's my problem ๐
Is this the correct permissions.yml?
default:
inherited_groups: []
permissions: []
owner:
inherited_groups: []
permissions:
- mt.*
head:
inherited_groups:
- deputy
permissions:
- mt.*
deputy:
inherited_groups: []
permissions:
- mt.*
Yeah but the mt.* in head is redundant due to inherited_groups
also do note if you have aaa.bbb.ccc you need aaa.bbb.* as well
actually, why aaa.** not supported for recursive matching?
Thanks for the full explanation!
Jesus-QC was lazy 
how can I increase the time it takes before lcz is decontaminated?
patch
is it LightContainmentZoneDecontamination.DecontaminationController.Singleton.TimeOffset?
Decontamination.Offset
oh ok thanks
guys how can I properly disable respawn waves?
setting RespawnWaves.PrimaryMtfWave.RespawnTokens to -50 didn't work
You can just disallow the WaveRespawning event
but I want to control the wave spawn manually
oh well I guess I'll let that idea slide
anyone know how I can increase the maximum amount of special scp weapons a person can carry?
Thats a server side setting for item limits
I dont know if you can change from plugin
that's unlucky
technically
you can...
you just gotta jank it
unlucky
make the config max server side
then fake sync your amount to client
or smth
or smth
or maybe just a fake sync idk
i think theyre referring to player specific
no it should count for everyone
well then
I'll try it out thanks
DAVID!
Eve!
hi!
haiiii
What are you sniffing
you
wait how does it work, it's an ILimit<>
thanks
also
why thats a new()
Oh
i see
cuz its
ah
Could've been a file class smh
is there a way to give someone an effect?
I tried Player.EnableEffect(new AntiScp207()); but it didn't work
player.EnableEffect<AntiScp207>()
you cant create a new instance of an effect like that
I see, thanks
(you actually cant create when player is already on)
well ig you could technically
just weird behaviour iirc
it didn't give any errors or anything, I thought it was like a class with static info
the anti scp 207 effect didn't work, do I need to pass in a duration or is it already permanent?
hmm it didn't apply for some reason
How do I get the role color of the roles set in remote admin config?
apparently doing it in PlayerReceivedLoadout doesn't work
delay isnt needed i dont think
thanks
also how can I see when a jailbird has run out of charges, because it doesn't trigger the playerDroppedItem event
You could subscribe to InventoryExtensions.OnItemRemoved
It should be reported there
got it thanks
PlayerLeftEvent: [Player: DisplayName=Crous, PlayerId=2, NetworkId=568, UserId=xxxxxx@steam, IpAddress=127.0.0.1, Role=Destroyed, IsServer=False, IsReady=True]
can we make it ahead of destroyed?
player isnt destroyed while in the PlayerLeftEvent, it just has the destroyed role
i think they mean keep the old role in there
the one that isnt Destroyed
i see
you should able able to get is by checking the newRole for destroyedRole from one of the change role events
next labapi release should have it
ServerStatic.PermissionHandler.GroupSomething contains defined roles by name
Maybe not exactly what I said, I'm just remembering
btw looking at the lab api how to get started docs and its giving me errors on the code they typed up
what error
show ur thing
public override Version RequiredApiVersion { get; } = new (LabApiProperties.CompiledVersion);
why do i have to implement this when it has a file for the version description copyright etc
its required version?
I think its so it uses the one you built it with
its the version of labapi you require
its a safety check
if your labapi required is old then it wont load iirc
public override Version Version => GetType().Assembly.GetName().Version;
no i just want to remove the errors from my console
the error was in required api version
which seems to be luke using a different Version than LabAPI does
but doesn't it seem to retain some of the properties of the player, like health, position, etc

how
project settings
how
do this #plugins-dev-chat message
Visual studio users are coping
im using jetbrains brah
doesnt it still have csproj
yes
just add <LangVersion>latest</LangVersion>
Right click project, properties
that works to use the latest c# version on ur machine
edit your .csproj and place the following under a property group
<LangVersion>13</LangVersion>
or latest yeah
i see assembly info
?
i dont have a csproj file
Right click to your project
And then click show in the file explorer
find it in file explorer
it doesnt show by default tho
why doesnt it show by default
ยฏ_(ใ)_/ยฏ
because you have it set to Solution
also this works fine in Rider
so idk what ur issue is 
vs why won't let us change the version of c#
It's so funny to me how ms did that (or didn't)
Why do I have to deal with this?
because
Because Microsoft said so
they can handle it as simply as rider
big microsoft knows best
Just add this to the csproj
<PropertyGroup>
<LangVersion>latest</LangVersion>
</PropertyGroup>
but he earns a lot just because of 1,000 employees per function
It's not worth it for them to implement lol
It would take too much money 
Also they're trying to get people to move to VSC
how can I get the player from the OnItemRemoved event?
ev.player
lol
isn't there, parameters are ReferenceHub rh, ItemBase ib, ItemPickupBase ip
Huh
Player.Get(hub);
That's the base-game event
nw moment
because basegame uses them?
like player changing role has a basegame event
because basegame has to do checks on it
like remove effects
oh okay
Not sure I understand so let me break it down
A .NET solution (.sln, purple one) contains projects (.csproj, green one)
In the C# project you write code that facilitates the plugin
You need to right click the project (csproj) to edit its properties (language version)
so you can actually make your own events and subscribe them internally
it works but it gives this error, how do I add these assemblies?
thats interesting, i would have hardcoded the functionality
in server files
๐ญ
no i got it
wdym
huh?
now it just does this error
You can subscribe to events that you make
oh
Insane behavior
Does PlayerChangingRoleEvent run before any role change actually happens?
Events reduce coupling but can lead to funky behavior sometimes
Like, Don't use return types with events
It should
it happens before the role changes
but its after the role change is ASKED for
public void RoleChange(PlayerChangingRoleEventArgs ev)
{
if (ev?.NewRole != RoleTypeId.Spectator)
{
if (ev != null) util.UpdateSpectatorHint(ev.Player.CurrentlySpectating);
}
}
this is throwing a NullReferenceException
events with ing run before, and ones with ed run after
ev cant be null
CurrentlySpectating is null
CurrentlySpectating can be
it shouldnt be though
it SHOULD
you check for NEW role
not old
the new role is a spectator
but you do the check before they change
I'm intending to check who they were spectating before their role updates
yeah but
ur using NEW role
oh
wait
am i stupid
yeah
when changing to spectator
you check for their current spectating
but the only way that could work is if they were already spectator (or overwatch) before and then get swapped to spectator again
if u want to check their old spectate then use ev.OldRole == Spectator
yes
I would have added the checks as part of the role changing code
but I guess thats why im a plugin dev and not a game dev
then role change needs to account for everything
its easier to not hardcode it
makes it more maintainable
I assume this is why OnEscaping fires even for mtf
well
because it still requests it
yes
yeah
well its
for plugins this one
scps also trigger it now
because we asked nw to make it that way
yeah i guess so
I should look into how C# events work
yes
theyre super useful
theres unity events too but idk the difference ngl
for a cancelable event I assume I create an event arg, do InvokeSafely, and then do if (!args.Isallowed) return; right
I looked into exiled transpilers for events
For denying behavior that you know is only gonna be denied by your code I think it makes more sense to couple the code and check for requirements at the call site
If you're making an api that devs will use then yes use events
i use cancellable events in my own code
or i will
more dynamic
its not better performance
just more dynamically controllable
for internal stuff it's a bit unnecessary imo
More dynamic but also gets confusing to check what causes issues
it depends rly
And yeah, performance
to clarify, it's ev.Player.CurrentlySpectating that's causing the nullreferenceexception when a player is changing from spectator to another role, not anything else. If the value is updated after the event fires and not before, it shouldn't be doing that
how can I destroy an item and check if it is destroyed from ItemBase?
thats not what you check tho
you check for them BECOMING spectator
is it not?
Oh
new role isnt spectator is like also called when escaping
from class d to ntf
or ci
etc
Check if the precious role is spectator
yeah
delete
i feel stupid rn
so does that mean I run the handlers manualy at the function
Since there are conditions that you need to satisfy I think it makes more sense to handle those at the call site
If you have a modular system then events are more convenient
yeah
i could have just done if (ev.Player.CurrentlySpectating != null) lmao im so stupid
that too yeah
I find this easier though cuz I don't need to deal with subscribing/unsubscribing
I can just add a subcomponent anywhere in the hierarchy and implement the interface
-# this isn't an SL project btw
oh absolutely a cool way
SL has some stuff like this
like fpc collision handler has so you can inherit an interface and Ghostly and stuff uses it
its cool
Yup
will it be in OnPlayerLeft?

OnPlayerLeft seems to only stably fetch the UserId
Do you have info on how LabApi releases will make their way to the server builds?
Will there be purely LabApi releases or will we have to wait for some game update
Imagine if pushing to master created a build
labapi is part of SL files so yeah prob stuck waiting for SL updates
its possible for both, but for example the old role one would require a new server build
Both require server rebuild to update the dll for everyone
How about
Release notes that include whether LabApi was updated without any base game changed
The server could update (probably with a prompt first) LabApi in that case
Bit of a stretch? Maybe
Could it be useful? Kinda, yeah
-# I should justmake a PR smh
Thats.. possible yea
we prob need like many events and actual event args
and please let us change cooldown in scp roles , remove the const and make it static (or by instance) ๐
I hope a lot of things going to change to accommodate LabAPI, moving away from the client/server side only impl to a server controllable approach
i also need broadcast queue / player and a bool that is empty 
I mean that is already a thing no? Or is that client side only?
I hope more vars become synced
It would be awesome if there would be some advanced custom gamemodes
Imagine SCPSL surf maps
Im mostly talking about role stats as well as gun stats like recoil and firerate and reload and shit
That would require modding on a level not currently possible
Recoil is probably representable by an object right
not our problem we are not SL devs
role stats like movement speed, ability cooldown, names, intro screen
only with movementboost effect
yea i dont think that syncs....
yeah
@unique crane can u check if Intercom.CheckPlayer is enough to allow scps to talk in it
Sure
cuz i dont think its working like other than playing the sound
No it wont sync
Add [SyncVar] att to it
Its not NetworkBehavior
Fuck
Why is sl written so uniquely
David
Did you write the part of generators labapi impl?
:D
it should work but i just dont think it does
Oh
I need to patch the range dont i
you always need pathc
public override VoiceChatChannel ValidateReceive(ReferenceHub speaker, VoiceChatChannel channel)
{
if (speaker == this.Owner)
return VoiceChatChannel.None;
if (channel == VoiceChatChannel.Mimicry)
return channel;
if (this.IsRoundSummary && (this.ReceiveFlags & GroupMuteFlags.Summary) == GroupMuteFlags.None)
return VoiceChatChannel.RoundSummary;
return Intercom.CheckPerms(speaker) && channel != VoiceChatChannel.Scp1576 ? VoiceChatChannel.Intercom : channel;
}
Standard voice does that
But that should be fine?
Except..
so yeah
i need to patch that too...
turns out
?
Intercom.CheckRange patch is required
because it uses that to validate if a player is allowed intercom usage even if you allow Intercom.CheckPlayer
i am saddened by this revelation
i keep getting a error while trying to load my dep and plugin
BadImageFormatException
while everything is correct
recompile and reupload your plugin
should i compile with x32 or x64 or x86?
seem to have fixed it
ok
i only patched the CheckPlayer cuz i thought it was the only place itd check
X64
but the speaking also validates intercom current player
@unique crane i lied
it doesnt work
i literally have no clue now
what langugage version should i use?
Ideally the latest
12/13
idk tf is wrong now
cause rn im using 10.0
That's fine, too
intercom SUCKS
maybe its client sided issue???
or maybe its issue with my
Though you're missing out on collection expressions
proximity chat thing??
OH MY GOD
ITS MY FAULT
wait no its not
i check for scp chat
does being on intercom not override scp chat
What the
ok so
Also I don't think you can modify the struct
Cuz the backing field isn't a ref field
Icon shows up
and intercom looks to be used
but the actual message doesnt work
but its intercom not scpchat so why
tf
What's in SendProximityMessage
public static void SendProximityMessage(this VoiceMessage msg, float distance)
{
Player speaker = Player.Get(msg.Speaker);
foreach (Player listener in Player.ReadyList)
{
if (listener.RoleBase is not IVoiceRole voiceRole)
continue;
Vector3 comparePos = listener.CurrentlySpectating?.Position ?? listener.Position;
if (Vector3.Distance(speaker.Position, comparePos) >= distance)
continue;
if (voiceRole.VoiceModule.ValidateReceive(speaker.ReferenceHub, VoiceChatChannel.Proximity) is VoiceChatChannel.None)
continue;
msg.Channel = VoiceChatChannel.Proximity;
listener.Connection.Send(msg);
}
}
it shouldnt call this tho
because its intercom being used
Right
i am so confused ๐
Real talk
make sure not to send the voice packets back the speaker 
shh
funky hearing yourself talk
oh i havent had that issue
but i dont know what my issue is
maybe im just losing it
i tried to use a already made plugin but it said the same error
Oh
yeah i fixed that with if (voiceRole.VoiceModule.ValidateReceive(speaker.ReferenceHub, VoiceChatChannel.Proximity) is VoiceChatChannel.None)
regardless
i need to figure out intercom
not
doing its thing
Is it possible to make someone's voice like when he ate the cake?
I think it's clientside right
when the player has the cake effect
I tried looking into it and IIRC that's what I found out
yeah but you could technically process it server side to do it
by modifying the voice message
we're 4 months into development
last issue is the momentum
only way to do it would be increasing movement speed
does it use physics
how does that sync properly
its been stable so far
i was under the impression I cant even deny a jump request without my client shitting itself
LMAO
we did it for the pvp server
42 million client primitives
its def possible to push it to 50
isnt it an issue on the client side because of how it was coded
so it predicts jumps before validating
cancollide:true invis primitive gets destroyed when player jump is valid
otherwise it is spawned
so they cant "jump" until its validated
anyways i said too much already so byeee :3
How to log in LabApi?
In which namespace?
just type logger and most ides will let you import like that
is there a repo with a default visual studio project set up? One with every dll, language verison, etc. setup so new people can start out immediately
This is how i have created a new gun with specifications so far using Exiled.
How do i use LabAPIs weapon modules to clear/set attachments and the magazine/ammo values?
-# Edit: For ammo i found the CylinderAmmoModule and used its UnloadAllChambers(), afterwards i simply block the reloading event.
Skill issue because nw deleted or disabled it
If you willingly copy a csproj rename it and edit the csproj to use the renamed name for the assembly and namespace yes
