#plugins-dev-chat

1 messages ยท Page 27 of 1

worthy rune
#

OnPlayerLeft is called from ReferenceHub.OnDestroy and before its removed from the cache so it should be grabbing the correct player wrapper instance and the player shouldnt be destroyed at that point

hearty shard
#
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

worthy rune
#

maybe, in the playerLeftEvent try logging the player like this "${ev.Player}" and see if it comes up as destroyed

celest thorn
#

so referencehub still exist

worthy rune
#

also log before and after counts when you remove(or just log the bool returned)

celest thorn
#

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?

worthy rune
#

most likely, it also triggers role changed too

celest thorn
#

That could be why?

#

so if i just add on my respawn logic

#

x.ReferenceHub == null

#

it shouldn't

worthy rune
#

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

celest thorn
#

let me test

#

so yea i will add a flag

#

oh wait

#

i can actually do

#

if (player.Role == RoleTypeId.Destroyed)

worthy rune
#

yeah that should work

celest thorn
#

yep it works

hearty shard
#

oh yeah riptide

celest thorn
#

Oh nope

#

it doesn't

#

lol

hearty shard
#

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?

#

๐Ÿ˜ญ

worthy rune
#

sounds like a base game issue, make an issue and someone can take alook

worthy rune
hearty shard
#

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

grand flower
#

How functional is 3144 to NW

#

Just had to disable it because it would break servers

hearty shard
#

wat

#

3114 or 1344

grand flower
#

3114

hearty shard
#

The item or the scp

#

skeleton works fine for me

grand flower
#

Disguising issues, invisible to clients sometimes, and servers breaking after round restart due to broken ragdolls

hearty shard
#

On a modded server and on vanilla

grand flower
#

odd

hearty shard
#

Ik the cause btw

#

Of that

#

You are using Player.List somewhere

#

And telling server smth you shouldnt

grand flower
#

nope and we patched that

hearty shard
#

Well

#

Thats how i caused it

grand flower
#

yeah it is a cause for sure

hearty shard
#

You send server a player update

grand flower
#

but 3114 kept having issues after all those fixes so idk

hearty shard
#

well

#

you issue

#

cuz i fixed it with removing server host from getting network msg about scale

wispy dirge
#

how would i make the server restart after every round?

#

since my coding breaks the server after every round r estart

royal mica
#

trigger rnr after round end?

#

Or you need hard restart?

wispy dirge
#

hard restart as in?

hearty shard
#

Or should be

#

It reloads plugins etc

unique crane
#

rnr is hard restart yea

hearty shard
#

Yes

royal mica
#

Ah

wispy dirge
#

how do i trigger rnr?

royal mica
#

ServerStatic.StopNextRound = ServerStatic.NextRoundAction.Restart;

wispy dirge
#

i dont want to use Server.ExecuteCommand("rnr"); since i ehard like thats unoptimized or smthn

royal mica
hearty shard
unique crane
#

Just see what the command does

#

xd

#

and copy paste the code

royal mica
#

idk why multiadmin ptero just eats the command but it is so random

hearty shard
#

But yea you can check commands for what they do, but calling the commands is extra steps

hearty shard
#

Why not localadmin?

royal mica
#

not multiadmin, the default that ships

wispy dirge
#

the server already suffers enough with my shitty coding

royal mica
#

just me not remember which is used nowadays

#

yeah LocalAdmin v. 2.5.16

young phoenix
#

how can I disable/lock win conditions and trigger a win myself when a condition is met?

grand flower
#

OnServerRoundEnding

#

you can prevent it and change the winning team too

young phoenix
#

so I just set IsAllowed to false, how do I trigger one then?

grand flower
#

although

#

sec

#

Round.End()

worn gull
#

How can I do this?

young phoenix
static meteor
grand flower
#

Modify it in OnServerRoundEnding()

static meteor
young phoenix
worn gull
#

If I size it to 15 it works but as I see on the picture it works with the original size

wispy dirge
#

is there a way to remove the alarm from EZ red room?

static meteor
#

I dont believe so

wispy dirge
#

is it some client sided thing then?

#

or is it just like not accesable?

#

or not known

#

either way just wondering

worthy rune
#

you can access it from the server and do what ever you want, but none of the changes will sync with the client

wispy dirge
#

ah

hearty shard
#

trust

#

cant go wrong

worthy rune
wispy dirge
#

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 ๐Ÿ˜ญ

static meteor
#

would mean alot more load on the server though

hearty shard
#

Also

#

Everything means everything possible

#

including textures

wispy dirge
#

sending textures to client trol

hearty shard
#

Well sometimes client needs to control smth

#

But server should be validating it 99% of the time

wispy dirge
#

i am not a professional network person ๐Ÿ™

hearty shard
wispy dirge
#

scared to even add Mirror as a reference ๐Ÿ˜ญ

hearty shard
wispy dirge
#

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?

wispy dirge
#

yeah but

#

duh

#

but like it just doesnt work

hearty shard
#

Room.Get or smth

wispy dirge
#

light.Room.gameObject.transform;

wispy dirge
hearty shard
#

Though

wispy dirge
#

it just doesnt work

#

idk

#

no error

hearty shard
#

Show code

wispy dirge
#

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

hearty shard
#

Err

wispy dirge
#

is my code just shit? ๐Ÿ˜ญ

royal mica
#

In my case, I used the second method. It is easier than creating a Harmony patch

#

@worn gull

young phoenix
#

how can I disable ntf/chaos respawn waves?

wispy dirge
#

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

young phoenix
wispy dirge
#

ill check 1 sec

grand flower
wispy dirge
grand flower
#

Set IsAllowed to false

wispy dirge
#

that denys wv spawn tho i think

young phoenix
wispy dirge
young phoenix
wispy dirge
#

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

young phoenix
#

thanks I'll try it out

hearty shard
wispy dirge
#

idk if there is a way to stop them from naturally spawning

#

maybe the event has a bool like IsNatural or smthn

young phoenix
#

question, does d class always spawn as chaos conscript when they escape?

hearty shard
#

well

#

Unless theyre cuffed

#

Then its specialist ntf

unique crane
young phoenix
hearty shard
#

errrrr

#

im proving you wrong

unique crane
#

"err errrr"

#

Hmm yes yes

#

Cant argue with that

hearty shard
#

Damn

#

I proved myself wrong

#

I cant believe youd make class d privates

#

Are they not good enough?

#

Discrimination against d boys?

unique crane
hearty shard
unique crane
#

You wouldnt do that

hearty shard
grand flower
#

How does one change the amount of players that will spawn in a wave

wispy dirge
#

ntfwave wrapper or smthn

#

there is a number for amount of ntfprivate etc

#

unless im wrong

unique crane
#

There is total player multiplayer

#

And amount of Sargents and captain(s)

#

Same for chaos wave

grand flower
#

awesome ty

hearty shard
wispy dirge
#

๐Ÿ˜ญ

grand flower
#

So just

#

RespawnWaves.PrimaryMtfWave.MaxWaveSize = int.MaxValue; would be enough?

wispy dirge
#

prob

#

looks right

grand flower
#

8 hours doesn't sound half bad

restive turret
#

Took me probably 2 days in beta

grand flower
#

took us two weeks and there was 3 of us ;-;

restive turret
#

And i still fixing some bugs causing some issues

grand flower
#

same here hah

#

but we got ours stable and playable

#

still got some bugs but none that are critical

restive turret
#

I have to fix bunch of things since idk what bugs (the bunny)

#

I don't think my thing ever be stable

true cedar
#

aren't you

grand flower
#

Yeah

true cedar
#

anyways have fun dredging through my code lol

grand flower
#

well, 3 on SL

true cedar
#

ah

grand flower
#

Although Matrix wasn't fully available

grand flower
true cedar
#

is it better quality than the rest of the codebase

#

i sure hope so

grand flower
#

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

true cedar
#

i only do that if its a small number of items that don't meet the criteria

buoyant oyster
#

I can't use CommandHandler or ICommand in my project for some reason, am I missing something?

true cedar
#

and then get a random item

#

or make 2 passes

worthy rune
grand flower
#

I'd still go for that instead tbf

true cedar
#

eh

buoyant oyster
grand flower
#

There was only one place where it could've been bad bad so it's not a big issue anyway

true cedar
#

i did all the codematcher transpilers

grand flower
#

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

true cedar
#

ic

grand flower
#

Got a backlog of stuff to rewrite once we have time and there's no pressing issues to resolve

#

But so far so good

true cedar
#

i had a rewrite backlog too lmfaooooo

grand flower
#

I just left a buttload of todos in the codebase while I was porting/rewriting bits over

true cedar
#

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

grand flower
#

aye, cya

grand flower
#

Uhhh question

#

Does null propagation not work with Unity

#

I'm getting some null refs that are pretty surprising

#
!player?.ReferenceHub?.gameObject
true cedar
grand flower
#

fucking UNITYYYYYYYYYYYYYYYYYYYYY

true cedar
#

it only overrides == so that it equals null

#

if the internal c++ backing thing is null

grand flower
#

every day working with this god forsaken engine I understand i've made the right choice leaving it years ago

true cedar
#

c++ / ue isnt much better

#

rust however

grand flower
#

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

true cedar
#

yea but you still have to deal with the fucking mess that is c++

grand flower
#

got used to it hah

#

I made the switch because Unity was shit in terms of networking

true cedar
#

thats like getting used to living in smogged london

grand flower
#

or well, when it had networking considering they kept deprecating everything

#

C# was my first language, C++ my second, I like both

true cedar
#

i hate c++ on an indescribable level

grand flower
#

to each their own DogKek 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

true cedar
#

c# is just bloated to all hell

true cedar
grand flower
#

oh I just got sent a handful and that's how I discovered the issue

#

I figured I was forgetting something

grand flower
#

Player needs an IsDestroyed property like the other wrappers

#

mostly for latent actions

buoyant oyster
#

how do i set ncikname

#

idek the commands to do it ingame

static meteor
buoyant oyster
#

ah

#

i was doing Nickname

buoyant oyster
#

setting my cap to 32 bc arbitrary number but idk if theres an actual cap above or below that number

static meteor
#

idk

spice hatch
#

hey can someone coach me on creating plugins

#

teach me the lingo

#

i have the creative thinking already

buoyant oyster
#

brute force it with the tutorials and example code

#

if u literally just

#

look up enough things on google you can learn the basics

spice hatch
#

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

teal junco
#

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

spice hatch
#

no i hate tutorials

#

reminds me of class lectures

#

well the video ones at least

#

i can probably do a written one'

spice hatch
#

the syntax has descriptions

teal junco
#

and you should also delve into other codebases

upper vapor
grand flower
#

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

spice hatch
#

not on writing lab api plugins

buoyant oyster
#

why are you here then

#

this is the labapi category

#

if youre looking for exiled stuff youre in the wrong place

grand flower
#

I think they mean there's no labapi tutorial

#

which would make sense considering it's barely out

buoyant oyster
#

oh

#

i mean

#

there are

spice hatch
#

why would i be talking about exiled in lab api

#

like what are you on about

buoyant oyster
#

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

grand flower
#

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

buoyant oyster
#

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

upper vapor
#

Not exactly a tutorial but it's good to get started

buoyant oyster
#

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

upper vapor
#

Try sending an Rpc though the ChaosKeycardItem

#

Check how it writes messages

buoyant oyster
#

i uh

#

dont know how to do that

upper vapor
#

Decompile

#

Check if the player's current item is a ChaosKeycardItem (base-game)

#

There should be some SendRpc methods

buoyant oyster
#

I'm really not sure what you mean by base-game

upper vapor
#

The one in the namespace InventorySystem.something

#

Not the LabApi wrapper

buoyant oyster
#

i assume basegame means everything under SCP Secret Laboratory Dedicated Server\SCPSL_Data\Managed?

#

or only Assembly-CSharp

upper vapor
#

The game's code is whay we refer to as base-game

random scaffold
buoyant oyster
#

i thought so, just wanted to clarify

upper vapor
#

Including systems like GameObject pooling (from Pooling.dll)

upper vapor
buoyant oyster
#

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

buoyant oyster
upper vapor
#

When you break free from j*va streams

upper vapor
buoyant oyster
#

i was trying to go thru player.Inventory first oops

#

thats a lot simpler than i was thinking it was

upper vapor
#

That would work, too
Though LabApi helps a bit lol

slate flume
#

Real talk

#

Hi Fel!

buoyant oyster
#

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!

slate flume
#

That's me ๐Ÿ˜„

buoyant oyster
#

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

fresh zenith
#

how do i get how often the player used SCP330?

buoyant oyster
#

wdym by that

#

like the number of times the player used it?

fresh zenith
#

yea

buoyant oyster
#

super easy way with no basegame would probably be to use a Dictionary or similar data type alongside PickedUpScp330 or InteractedScp330 events

fresh zenith
#

i found it nvm

buoyant oyster
#

whats the basegame way to do it

fresh zenith
#

yea its just ev.uses lmao

buoyant oyster
#

oh

#

lole

fresh zenith
upper vapor
buoyant oyster
#

i will admit i do miss the in depth spigot and paper javadocs

#

basegame got zero documentation

fresh zenith
frank flicker
#

Feels like a scavenger hunt sometimes

royal mica
#

But it help you learn to not be dependent on documentation

buoyant oyster
#

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

royal mica
#

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 LULE

fresh zenith
#

hey uh is there a way to Enable effects like this:
plr.EnableEffect<Config.Effect>(); ?

unique crane
#

You can get the effect by its name

fresh zenith
#

do you have an small example atm?

icy knoll
fresh zenith
#

i got it working on my own. thanks for the help tho

buoyant oyster
royal mica
#

Creating a community pdb LULE

wispy dirge
#

the server I work on is magical how some things dony work

tribal dagger
#

how to get the default color from a light controller?

#

Base.NetworkOverrideColor, Base.OverrideColor and OverrideLightsColor properties all return Color.Clear

wispy dirge
#

i think there is like a resetcolor thing and it outputs the color or smthn

#

idk

#

when did i turn orange

unique crane
tribal dagger
#

cant find it :/

wispy dirge
#

oh shi the resetcolor thing is exiled sry

#

i really need to look at how labapi works

tribal dagger
wispy dirge
#

๐Ÿ˜ญ

tribal dagger
#

which is the default

unique crane
#

Hmmm

tribal dagger
#

im trying to add a smooth transition

#

and i cant do that if the start color is always clear

#

as everything just becomes dark

unique crane
#

controller.transform.parent.GetComponentsInChildren<RoomLight>().First().LightSource.color

#

You need publicized assembly for it

tribal dagger
#

alright

unique crane
tribal dagger
#

roomLightController.Base.transform.parent.GetComponentsInChildren<RoomLight>().First().LightSource.color

unique crane
#

Uhh try GetComponentsInChildren<RoomLight>(true)

#

so it includes inactive

tribal dagger
#

thanks!

#

i need to get to know how to get components, seems like a really useful skill

hearty shard
#

ok so turns out this doesnt work

#

ghostly on client works weird

wheat flower
#

what are you doing ๐Ÿ’€

hearty shard
#

ghostly stays bugged on client

#

i might just need a frame delay tbh

wheat flower
#

yeah i used frame delay when resyncing stuff

#

probably good

#

for effects specifically

#

๐Ÿ”ฅ

hearty shard
#

ghostly and 1344 stink

#

ok it works

#

just needed frame delay

spring lionBOT
worn gull
#

If I set UnlockingGenerator IsAllowed to true still not unlocking it

restive turret
#

ye bc the permission for it runs the check too

#

deny and unlcok it

worn gull
#
          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?
restive turret
#

nothing is setting flag = true

worn gull
#

Yes

restive turret
#

despite you cannot do anything even if you set IsAllowed true

#

deny the event and unlock it yourself

worn gull
#

Okay

worn gull
restive turret
#

well there is so many stuff that NW can done with these events

royal mica
worn gull
#

Ah okay

royal mica
#

If you check, none of the events are permissive, all of them orients towards denial

restive turret
#

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

worn gull
#

Yup and that's my problem ๐Ÿ˜„

vivid thorn
#

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.*
royal mica
#

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?

vivid thorn
#

Thanks for the full explanation!

upper vapor
young phoenix
#

how can I increase the time it takes before lcz is decontaminated?

random scaffold
#

patch

hearty shard
young phoenix
# hearty shard

is it LightContainmentZoneDecontamination.DecontaminationController.Singleton.TimeOffset?

hearty shard
#

Decontamination.Offset

young phoenix
#

oh ok thanks

young phoenix
#

guys how can I properly disable respawn waves?
setting RespawnWaves.PrimaryMtfWave.RespawnTokens to -50 didn't work

hollow pewter
young phoenix
young phoenix
#

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?

teal junco
#

I dont know if you can change from plugin

young phoenix
#

that's unlucky

hearty shard
#

you can...

#

you just gotta jank it

teal junco
#

unlucky

hearty shard
#

make the config max server side
then fake sync your amount to client

#

or smth

#

or smth

#

or maybe just a fake sync idk

unique crane
#

Well

#

Server.CategoryLimits?

#

@hearty shard @young phoenix try this

hearty shard
unique crane
#

Aha

#

Well in that case... patch

hearty shard
#

unless im taking

a person can carry
too literally

#

otherwise yeah that works

unique crane
#

I understand that as like anyone

#

but thats up to him

young phoenix
hearty shard
#

er

#

my bad

#

๐Ÿ˜ญ

unique crane
#

well then

young phoenix
unique crane
#

Server.CategoryLimits

#

yea

hearty shard
#

DAVID!

unique crane
#

Eve!

hearty shard
#

hi!

unique crane
#

haiiii

hearty shard
#

its mee!!!

#

and u!!

unique crane
#

What are you sniffing

hearty shard
#

you

unique crane
#

e

#

ok

young phoenix
unique crane
#

Indexer

#

Server.CategoryLimits[ItemCategory.SpecialWeapon] = 2;

#

Like that

young phoenix
#

thanks

hearty shard
#

btw david

#

flip you!!

#

no one has fixed this ๐Ÿ’”

hearty shard
#

why thats a new()

#

Oh

#

i see

#

cuz its

#

ah

upper vapor
#

Could've been a file class smh

young phoenix
#

is there a way to give someone an effect?
I tried Player.EnableEffect(new AntiScp207()); but it didn't work

hearty shard
#

you cant create a new instance of an effect like that

young phoenix
#

I see, thanks

hearty shard
#

(you actually cant create when player is already on)

#

well ig you could technically

#

just weird behaviour iirc

young phoenix
young phoenix
hearty shard
#

0 is permanent

#

which is also default value

young phoenix
#

hmm it didn't apply for some reason

buoyant oyster
#

How do I get the role color of the roles set in remote admin config?

young phoenix
carmine prawn
#

try OnPlayerChangedRole

#

with Timing.CallDelayed 0f

hearty shard
#

delay isnt needed i dont think

carmine prawn
#

I'll try

#

yep

#

doesn't need it

young phoenix
#

thanks

#

also how can I see when a jailbird has run out of charges, because it doesn't trigger the playerDroppedItem event

tulip kiln
#

It should be reported there

young phoenix
#

got it thanks

carmine prawn
#

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?

worthy rune
#

player isnt destroyed while in the PlayerLeftEvent, it just has the destroyed role

hearty shard
#

the one that isnt Destroyed

worthy rune
#

i see

hearty shard
#

also when Player::OldRole ?

worthy rune
#

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

upper vapor
#

Maybe not exactly what I said, I'm just remembering

spice hatch
#

btw looking at the lab api how to get started docs and its giving me errors on the code they typed up

spice hatch
#

stuff like this

#

even though im copying the code they have on the docs

hearty shard
spice hatch
#

public override Version RequiredApiVersion { get; } = new (LabApiProperties.CompiledVersion);

hearty shard
#

where is Version from

#

cuz it has to be from System i believe

spice hatch
#

why do i have to implement this when it has a file for the version description copyright etc

teal junco
hearty shard
#

its the version of labapi you require

#

its a safety check

#

if your labapi required is old then it wont load iirc

upper vapor
hearty shard
#

thats Version Version

#

but yeah that works for using csproj file for version

upper vapor
#

Yeah

#

They probably want it to get the version from the assembly though

spice hatch
#

no i just want to remove the errors from my console

hearty shard
#

the error was in required api version

#

which seems to be luke using a different Version than LabAPI does

spice hatch
#

ignore the first

#

and idfk about the last'

hearty shard
#

you use new()

#

that is only in C# 9

#

change ur C# language version

upper vapor
#

I should make a plugin template

#

But

#

Many people might not like it lol

carmine prawn
spice hatch
hearty shard
random scaffold
upper vapor
random scaffold
#

i cant change in settings

#

lol

#

only by hands in .csproj

hearty shard
#

pretty sure u can

#

i never do it cuz i just copy paste my csprojs

spice hatch
#

im using jetbrains brah

hearty shard
#

which means i never have to do that

#

so do i

teal junco
hearty shard
#

yes

teal junco
#

just add <LangVersion>latest</LangVersion>

upper vapor
teal junco
#

that works to use the latest c# version on ur machine

young phoenix
# spice hatch how

edit your .csproj and place the following under a property group

<LangVersion>13</LangVersion>
#

or latest yeah

spice hatch
#

i see assembly info

young phoenix
#

?

spice hatch
#

i dont have a csproj file

olive falcon
hearty shard
#

.csproj

olive falcon
#

And then click show in the file explorer

teal junco
hearty shard
#

it doesnt show by default tho

spice hatch
#

why doesnt it show by default

olive falcon
#

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

hearty shard
#

because you have it set to Solution

#

also this works fine in Rider

#

so idk what ur issue is PI_Shrug

olive falcon
#

vs why won't let us change the version of c#

unique crane
#

Edit it in csproj

#

not a big deal

hearty shard
#

uses jetbrains riderr soooo

upper vapor
random scaffold
upper vapor
olive falcon
random scaffold
upper vapor
olive falcon
#

they can handle it as simply as rider

young phoenix
#

big microsoft knows best

random scaffold
#

they have stupid code

unique crane
#

Just add this to the csproj

<PropertyGroup>
  <LangVersion>latest</LangVersion>
</PropertyGroup>
random scaffold
#

but he earns a lot just because of 1,000 employees per function

upper vapor
young phoenix
#

how can I get the player from the OnItemRemoved event?

spice hatch
#

which one

#

the one for the plugin or the one for the project?

random scaffold
#

lol

young phoenix
upper vapor
#

Huh

random scaffold
#

Player.Get(hub);

upper vapor
#

That's the base-game event

teal junco
#

why does basegame have events

#

actually curious

random scaffold
#

nw moment

hearty shard
#

like player changing role has a basegame event

#

because basegame has to do checks on it

#

like remove effects

teal junco
#

oh okay

upper vapor
# spice hatch the one for the plugin or the one for the project?

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)

teal junco
#

so you can actually make your own events and subscribe them internally

young phoenix
teal junco
#

thats interesting, i would have hardcoded the functionality

spice hatch
#

no i got it

spice hatch
#

now it just does this error

upper vapor
hearty shard
upper vapor
#

Insane behavior

hearty shard
#

yeah

#

SL does that

#

i do too

#

C# events are rly useful

buoyant oyster
#

Does PlayerChangingRoleEvent run before any role change actually happens?

upper vapor
hearty shard
buoyant oyster
#

public void RoleChange(PlayerChangingRoleEventArgs ev)
{
if (ev?.NewRole != RoleTypeId.Spectator)
{
if (ev != null) util.UpdateSpectatorHint(ev.Player.CurrentlySpectating);
}
}
this is throwing a NullReferenceException

worthy rune
upper vapor
hearty shard
#

CurrentlySpectating can be

buoyant oyster
#

it shouldnt be though

hearty shard
#

you check for NEW role

#

not old

#

the new role is a spectator
but you do the check before they change

buoyant oyster
#

I'm intending to check who they were spectating before their role updates

hearty shard
#

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

teal junco
teal junco
#

but I guess thats why im a plugin dev and not a game dev

hearty shard
#

then role change needs to account for everything

#

its easier to not hardcode it

#

makes it more maintainable

teal junco
hearty shard
#

well

teal junco
#

because it still requests it

hearty shard
#

yes

#

yeah

#

well its

#

for plugins this one

#

scps also trigger it now

#

because we asked nw to make it that way

teal junco
#

I should look into how C# events work

hearty shard
#

theyre super useful

#

theres unity events too but idk the difference ngl

teal junco
#

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

hearty shard
#

ermmm

#

so it depends

upper vapor
#

If you're making an api that devs will use then yes use events

hearty shard
#

i use cancellable events in my own code

#

or i will

#

more dynamic

#

its not better performance

#

just more dynamically controllable

upper vapor
hearty shard
#

it depends rly

upper vapor
#

And yeah, performance

hearty shard
#

its less performance yeah

#

extra calls and stuff

buoyant oyster
young phoenix
#

how can I destroy an item and check if it is destroyed from ItemBase?

hearty shard
#

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

upper vapor
#

Check if the precious role is spectator

hearty shard
#

yeah

random scaffold
buoyant oyster
#

i feel stupid rn

teal junco
buoyant oyster
#

man

upper vapor
hearty shard
#

yeah

buoyant oyster
#

i could have just done if (ev.Player.CurrentlySpectating != null) lmao im so stupid

hearty shard
#

that too yeah

upper vapor
#

I can just add a subcomponent anywhere in the hierarchy and implement the interface

#

-# this isn't an SL project btw

hearty shard
#

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

upper vapor
#

Yup

carmine prawn
#

OnPlayerLeft seems to only stably fetch the UserId

upper vapor
#

Imagine if pushing to master created a build

hearty shard
worthy rune
#

its possible for both, but for example the old role one would require a new server build

unique crane
#

Both require server rebuild to update the dll for everyone

upper vapor
unique crane
#

Thats.. possible yea

upper vapor
#

โŒ never going to be implemented
โœ… possible

restive turret
#

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) ๐Ÿ™

royal mica
#

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

restive turret
#

i also need broadcast queue / player and a bool that is empty ClassDTroll

royal mica
#

I mean that is already a thing no? Or is that client side only?

restive turret
#

client side

#

or idk i dont see Broadcast Queue on acs

hearty shard
#

uh

#

if you send a broadcast

#

and u dont override the old one

#

it will queue

restive turret
#

ye

#

no shit

#

i know

#

i want to see when empty

hearty shard
#

not allowed

teal junco
royal mica
#

It would be awesome if there would be some advanced custom gamemodes

#

Imagine SCPSL surf maps

teal junco
#

Im mostly talking about role stats as well as gun stats like recoil and firerate and reload and shit

teal junco
teal junco
restive turret
teal junco
restive turret
#

you can change movement speed

#

but i think thats server side

hearty shard
restive turret
hearty shard
#

yea i dont think that syncs....

restive turret
#

prob not

#

worth a shot

teal junco
hearty shard
#

@unique crane can u check if Intercom.CheckPlayer is enough to allow scps to talk in it

unique crane
#

Sure

hearty shard
#

cuz i dont think its working like other than playing the sound

unique crane
restive turret
unique crane
#

Its not NetworkBehavior

restive turret
#

Fuck

#

Why is sl written so uniquely

#

David

#

Did you write the part of generators labapi impl?

hearty shard
#

it should work but i just dont think it does

#

Oh

#

I need to patch the range dont i

restive turret
#

you always need pathc

hearty shard
#
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...

unique crane
#

It should

hearty shard
unique crane
#

?

hearty shard
#

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

ionic prawn
#

i keep getting a error while trying to load my dep and plugin

#

BadImageFormatException

#

while everything is correct

hearty shard
#

recompile and reupload your plugin

ionic prawn
#

should i compile with x32 or x64 or x86?

hearty shard
unique crane
#

ok

hearty shard
#

i only patched the CheckPlayer cuz i thought it was the only place itd check

restive turret
hearty shard
#

but the speaking also validates intercom current player

#

@unique crane i lied

#

it doesnt work

#

i literally have no clue now

ionic prawn
#

what langugage version should i use?

upper vapor
#

Ideally the latest
12/13

hearty shard
#

idk tf is wrong now

upper vapor
ionic prawn
#

cause rn im using 10.0

upper vapor
#

That's fine, too

hearty shard
#

maybe its client sided issue???

#

or maybe its issue with my

upper vapor
hearty shard
#

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

upper vapor
#

What the

hearty shard
#

ok so

upper vapor
#

Also I don't think you can modify the struct
Cuz the backing field isn't a ref field

hearty shard
#

Icon shows up
and intercom looks to be used

#

but the actual message doesnt work

#

but its intercom not scpchat so why

#

tf

upper vapor
#

What's in SendProximityMessage

hearty shard
#
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

upper vapor
#

Right

hearty shard
#

i am so confused ๐Ÿ’”

slate flume
grand flower
#

make sure not to send the voice packets back the speaker mmLul

grand flower
#

funky hearing yourself talk

hearty shard
#

oh i havent had that issue

#

but i dont know what my issue is

#

maybe im just losing it

ionic prawn
#

i tried to use a already made plugin but it said the same error

hearty shard
#

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

worn gull
#

Is it possible to make someone's voice like when he ate the cake?

grand flower
#

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

hearty shard
#

yeah but you could technically process it server side to do it

#

by modifying the voice message

teal junco
#

How the fuck are you gonna add surfing to SL

#

unless its really jank

slender lynx
#

we're 4 months into development

#

last issue is the momentum

#

only way to do it would be increasing movement speed

teal junco
slender lynx
#

yea

#

rigidbody

teal junco
#

how does that sync properly

slender lynx
#

its been stable so far

teal junco
#

i was under the impression I cant even deny a jump request without my client shitting itself

slender lynx
#

oh thats simple

#

just rewrite mirror

#

๐Ÿฝ๏ธ

slate flume
slender lynx
#

we did it for the pvp server

#

42 million client primitives

#

its def possible to push it to 50

teal junco
#

isnt it an issue on the client side because of how it was coded

#

so it predicts jumps before validating

slender lynx
#

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

hearty shard
#

this fixed it

#

yippie

vivid thorn
#

How to log in LabApi?

hearty shard
vivid thorn
icy knoll
grand flower
#

the LabAPI one not UnityEngine

#

LabAPI.Features.Console.Logger iirc

young phoenix
#

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

plain gazelle
#

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.

wheat flower
#

what are the font options for texttoy

#

im a goober

#

i need a monospace one

restive turret
#

Skill issue because nw deleted or disabled it

restive turret