#plugins-dev-chat

1 messages Β· Page 28 of 1

buoyant oyster
#

how do i format permissions.yml? is it automatically created?

grand flower
#

Any chance at us getting profilers for servers?

worthy rune
#

what situation is servers TPS dropping for you

grand flower
#

Large player count

#

Would need to be able to profile a server to find out where the problem lies

#

even on lower counts, the fact we can't profile servers and plugins makes it harder

limpid fjord
limpid fjord
worthy rune
# worthy rune what situation is servers TPS dropping for you

its very likely the FPC distributer, atm it recalculates the relative position for every player cobo each tick, so if theres 30 players its creating 900 relative positions. creating new relative positions are not cheap as to make one it needs to check the distance to every waypoint on the map. i have not tried this but you could try caching the relative position per player and use a patch to use the cached relative position in the distributer. so at most you only recalculate the relative position per player so 30 times a tick for 30 players

grand flower
#

That is good to know ty, I'll try and patch that

#

oop

#

yeah found the code that does it

#

ouch

grand flower
#

3 TPS boost with 100 (dummy) players

#

will have to test with actual players

#

but on a 32/48 player server i feel like it won't be very noticeable

worthy rune
#

i see'

grand flower
#

actually

#

7 TPS on a more intensive server

#

and players moving around don't share the same cached relative position (spawning 100 dummies has some of them within each other)

#

so not a bad optimization at all

unique crane
#

@grand flower I can give you something to test too

#

For optimalization

grand flower
#

sure

unique crane
#

(when I get out of bed)

grand flower
#

just poke me whenever you're ready and i'll implement it

grand flower
#

@unique crane DogKek

unique crane
#

Oh yea

#

5 mins

restive turret
#

waky waky

#

time to add 783917 events

grand flower
#

hah

restive turret
#

I need help.
So I remove the item when the InventoryExtensions.OnItemRemoved called.
But PlayerUsedItemEventArgs run AFTER the item being destroyed so

unique crane
#

from my testing the patch actually makes it worse kekw

grand flower
#

fair hah

#

well the relative positioning caching does work so it could be a nice thing to have in SL natively

unique crane
#

Huh?

grand flower
#

does IWeaponModifierPlayerEffect not work for custom modded effects

restive turret
#

😭

unique crane
grand flower
#

fuck

#

any chance of getting that in the future?

restive turret
#

no custom effect for anyone

unique crane
#

maybe

restive turret
#

in 2095

unique crane
grand flower
#

fair

#

bummer though had a pretty fun idea with it

#

guess i'll just pump the player full of 1853 in the meantime

unique crane
#

But rather than custom effects it will be on the firearms themself

grand flower
#

that works as well

unique crane
#

That would be easier to do

grand flower
#

wanted to give the player pinpoint hipfire accuracy

unique crane
#

Well you can do that

#

Shots are handled server-side

upper vapor
#

Won't reflect the values on the client but that's not a big deal

grand flower
#

yeah i wanted it to be reflected

upper vapor
#

Laser

grand flower
#

wasn't the only thing, although I'll have to check but you can't change the double action speed on the revolver atm right

#

stuff like that

unique crane
#

No

#

Unless its affected by the green liquid thingy

grand flower
#

figured

grand flower
upper vapor
#

Hip accuracy is a modifier

#

You can set it on an attachment

vivid thorn
#

Where I should place subconfigs for main config in project?

#

Maybe some Configs path?

icy knoll
#

if you have multiple configs that aren’t just basic config and translation, then configs folder yea

restive turret
#

if i change the ammoType in server side what would happen

unique crane
#

PathManager.Configs

worn gull
#

Hi! For the raycast what layer/mask is the text on or is it possible to detect it with raycast?

royal mica
#

QueryTriggerInteraction.Collide

#

But probably easier to get the GO's layers and add to the list of layers

worn gull
#

Okay thanks

upper vapor
royal mica
#

Wait, arent LoadConfig requires the type to be TConfig, which is the config class defined at class level? Or am thinking something else/ this was changed

#

Oh im orange now instead of green sadding

restive turret
#

it is just must be a class that can be created with just new();

#

so uh how can I throw an item?

#

ClientDropItem

#

or UserCode_CmdDropItem__UInt16__Boolean? or what

upper vapor
hearty shard
#

ignore the errors im ignoring

#

thats just cuz

#

server host

#

and null item

icy knoll
hearty shard
#

yes thats fine

#

ignore it!

restive turret
#

not drop

hearty shard
#

nuh uh

#

doesnt it have a bool

restive turret
#

there is no BUTT

hearty shard
#

idk

icy knoll
#

look at how item throwing works and just borrow the code TrollDespair

restive turret
#

fun fact

#

there is no throwing

#

in labapi

hearty shard
#

ThrowableItem trolling

#

although

#

that only works for like

#

2176 or wtv

grand flower
#

just drop the item and give its rigidbody a nudge

hearty shard
#

and ball

#

and whatever else

restive turret
#

that doesnt trigget OnThrow/OnThrew

#

so no

grand flower
#

you can trigger it manually

#

nothing stopping you from doing so

restive turret
#

thank u exiled

hearty shard
#

oh yuck

grand flower
#

at least it's not a transpiler

restive turret
#

yea

grand flower
#

although im starting to enjoy them

#

makes me feel like a wizard

restive turret
#

wizard of what

grand flower
#

idk but writing a transpiler that works is awesome

#

got a 5-7 TPS boost on high player count servers

restive turret
#

what did u overwrite

#

Vector3 maths?

restive turret
#

catch deez

#

sory

hearty shard
#

slejm

#

ur dead.

#

GONE

restive turret
#

what if u try the transpiler for Vector3 math

hearty shard
#

also yea Vector3 is apparently #1 issue in sl

grand flower
#

really

hearty shard
#

or one of the bigger ones

hearty shard
#

aka

grand flower
#

what's the transpiler look like

hearty shard
#

vec - otherVec

#

creates a new vector

restive turret
#

I guess

hearty shard
#

😭

restive turret
#

u can just do prefix , dont forget the bool to do not run the normal func

hearty shard
#

yes

unique crane
#

I tried that today

grand flower
#

aren't transpilers a tad bit more performant though

restive turret
#

and

unique crane
#

the patch makes it slower

hearty shard
#

at all

unique crane
#

xdd

hearty shard
#

😭

#

πŸ’€

restive turret
#

😭

unique crane
#

Like the reflection itself or whatever does harmony do

restive turret
#

how was your patch

unique crane
#

is slow

hearty shard
#

so basically

unique crane
#

But the logic for the optimalization is correct

hearty shard
#

replace harmony with a custrom version

grand flower
#

that's why im saying transpiler would be better

hearty shard
restive turret
#

try it

unique crane
hearty shard
#

not if its harmony issue...

#

but

grand flower
#

since you just overwrite the IL that way no

unique crane
#

Idk

#

Its possible,

restive turret
#

mayhaps

hearty shard
#

try and seee

unique crane
#

If you overwrite il then it may be faster

#

Do it

hearty shard
#

i want to see it

#

and then

#

DAVIDDDDDD

#

david do you even have a server

restive turret
#

pff thanks automod

hearty shard
#

i forgot

unique crane
#
public static bool Prefix(Vector3 a, Vector3 b, ref Vector3 __result)
{
    Vector3 res;
    res.x = a.x - b.x;
    res.y = a.y - b.y;
    res.z = a.z - b.z;

    __result = res;

    return false;
}
#

Here is the optimized version

hearty shard
#

oh yeah it has to be ref

unique crane
#

If you can do it via IL

unique crane
hearty shard
#

what do you do SL for

unique crane
#

Oh

hearty shard
#

whats ur purpose here

unique crane
#

no one currently

hearty shard
#

me begging

#

youll get 1 cent a year

unique crane
#

I get more from hoobert

hearty shard
#

how much

#

whats ur worth

unique crane
#

a lot

hearty shard
#

so 2 bucks is ur worth

#

got it

#

i can make it 2.1

unique crane
#

Enough as a extra money

restive turret
hearty shard
#

System numerics?

unique crane
#

πŸ’€

restive turret
#

I dont have unity stuff in the website

unique crane
#

We are doing Unity Vector3 buddy

#

xdddd

restive turret
#

but should be similar

unique crane
#

Thats not gonna work

#

Your patching different struct

hearty shard
#

😭

#

hell nah

restive turret
#

ITS A WEBSITE

grand flower
#

i don't get how this is slow though

restive turret
#

it doesnt have unity references

#

dawg

hearty shard
#

is slow

unique crane
grand flower
#

hmmm

hearty shard
#

yeah

#

its an entire new object being created

unique crane
#

No its just the constructor call

unique crane
hearty shard
#

oh

#

whys the constructor bad

#

is it C# moment or unity

unique crane
#

Well its another method call

#

And its called a lot

#

like a lot

hearty shard
#

yes but other than that

#

is that it

unique crane
#

Yea

hearty shard
#

😭

unique crane
#

its just the method call

hearty shard
#

thats crazy

upper vapor
hearty shard
#

when does official SL patch this

#

trust

#

make a new engine

grand flower
#

hmmm

#

how does one patch an operator

unique crane
#

I did it like this

hearty shard
#

its just a method is it not

unique crane
#
  [HarmonyPatch]
  public static class Vector3SubtractionPatch
  {
      public static MethodBase TargetMethod()
      {
          return typeof(Vector3).GetMethod(
              "op_Subtraction",
              BindingFlags.Public | BindingFlags.Static,
              null,
              new[] { typeof(Vector3), typeof(Vector3) },
              null
          );
      }

      [HarmonyPrefix]
      public static bool Prefix(Vector3 a, Vector3 b, ref Vector3 __result)
      {
          Vector3 res;
          res.x = a.x - b.x;
          res.y = a.y - b.y;
          res.z = a.z - b.z;

          __result = res;

          return false;
      }
  }
#

Yea

#

Its a method

grand flower
#

sweet

hearty shard
#

could just "op_Subtraction"

unique crane
#

Dont know

#

Chat did that XD

#

Too lazy

hearty shard
#

chatGPT told me to new() it (when i provided it ur code)

#

πŸ’€

unique crane
#

He dumb

grand flower
#

the cheat code is just writing it and copying the IL from Rider

unique crane
#

True

upper vapor
#

Find every usage of the subtraction operator and patch toomuchtrolling

hearty shard
restive turret
#

as in untiy

#

since you allocate a new struct too

upper vapor
royal mica
grand flower
#

we'll see in a second

restive turret
#

try this

#

its addition

#

for sub use Sub instead of Add

grand flower
#

### Patch: static UnityEngine.Vector3 UnityEngine.Vector3::op_Subtraction(UnityEngine.Vector3 a, UnityEngine.Vector3 b)
### Replacement: static UnityEngine.Vector3 UnityEngine.Vector3::UnityEngine.Vector3.op_Subtraction_Patch0(UnityEngine.Vector3 a, UnityEngine.Vector3 b)
### Patch: static UnityEngine.Vector3 UnityEngine.Vector3::op_Subtraction(UnityEngine.Vector3 a, UnityEngine.Vector3 b)
### Replacement: static UnityEngine.Vector3 UnityEngine.Vector3::UnityEngine.Vector3.op_Subtraction_Patch0(UnityEngine.Vector3 a, UnityEngine.Vector3 b)
IL_0000: Local var 0: UnityEngine.Vector3
IL_0000: Local var 1: UnityEngine.Vector3
IL_0000: // start original
IL_0000: ldloca.s   1 (UnityEngine.Vector3)
IL_0002: ldloc.0
IL_0003: ldfld      System.Single UnityEngine.Vector3::x
IL_0008: ldloc.1
IL_0009: ldfld      System.Single UnityEngine.Vector3::x
IL_000E: sub
IL_000F: stfld      System.Single UnityEngine.Vector3::x
IL_0014: ldloca.s   1 (UnityEngine.Vector3)
IL_0016: ldloc.0
IL_0017: ldfld      System.Single UnityEngine.Vector3::y
IL_001C: ldloc.1
IL_001D: ldfld      System.Single UnityEngine.Vector3::y
IL_0022: sub
IL_0023: stfld      System.Single UnityEngine.Vector3::y
IL_0028: ldloca.s   1 (UnityEngine.Vector3)
IL_002A: ldloc.0
IL_002B: ldfld      System.Single UnityEngine.Vector3::z
IL_0030: ldloc.1
IL_0031: ldfld      System.Single UnityEngine.Vector3::z
IL_0036: sub
IL_0037: stfld      System.Single UnityEngine.Vector3::z
IL_003C: ldloc.0
IL_003D: stloc.1
IL_003E: ldloc.1
IL_003F: // end original
IL_003F: ret
DONE
restive turret
#

huh wha

grand flower
#

i think my transpiler's broken

restive turret
#

ye

grand flower
#

just a little bit

restive turret
#

i dont htink thats a valid code

grand flower
#

falling through the world was funny at least

grand flower
restive turret
#

huh what not work

grand flower
#

black screen

#

guessing stuck in 0 0 0

#

sec

#
### Patch: static UnityEngine.Vector3 UnityEngine.Vector3::op_Subtraction(UnityEngine.Vector3 a, UnityEngine.Vector3 b)
### Replacement: static UnityEngine.Vector3 UnityEngine.Vector3::UnityEngine.Vector3.op_Subtraction_Patch0(UnityEngine.Vector3 a, UnityEngine.Vector3 b)
IL_0000: Local var 0: UnityEngine.Vector3
IL_0000: Local var 1: UnityEngine.Vector3
IL_0000: // start original
IL_0000: ldloca.s   1 (UnityEngine.Vector3)
IL_0002: ldloc.0
IL_0003: ldfld      System.Single UnityEngine.Vector3::x
IL_0008: ldloc.1
IL_0009: ldfld      System.Single UnityEngine.Vector3::x
IL_000E: sub
IL_000F: stfld      System.Single UnityEngine.Vector3::x
IL_0014: ldloca.s   1 (UnityEngine.Vector3)
IL_0016: ldloc.0
IL_0017: ldfld      System.Single UnityEngine.Vector3::y
IL_001C: ldloc.1
IL_001D: ldfld      System.Single UnityEngine.Vector3::y
IL_0022: sub
IL_0023: stfld      System.Single UnityEngine.Vector3::y
IL_0028: ldloca.s   1 (UnityEngine.Vector3)
IL_002A: ldloc.0
IL_002B: ldfld      System.Single UnityEngine.Vector3::z
IL_0030: ldloc.1
IL_0031: ldfld      System.Single UnityEngine.Vector3::z
IL_0036: sub
IL_0037: stfld      System.Single UnityEngine.Vector3::z
IL_003C: ldloca.s   1 (UnityEngine.Vector3)
IL_003E: // end original
IL_003E: ret
DONE
#

fixed

#

gonna do the same for add

#

and then we'll check the performance diff ig

restive turret
#

what the fuck is ldloca_s 1 when I didnt even write that code

grand flower
#

nah that was mine

restive turret
restive turret
#

u prob have to patch many of the op_

#

UnaryNegation is doing new, multipy too

#

division too

#

== and != doesnt need patch

grand flower
#

i love broken transpilers

restive turret
#

ofc

#

do u want to shown what u did?

grand flower
#

didn't load the right register

#

fixed now

royal mica
#

So the rider IL is broken LULE

grand flower
#

a little too verbose for no reason yeah

#
### Patch: static UnityEngine.Vector3 UnityEngine.Vector3::op_Subtraction(UnityEngine.Vector3 a, UnityEngine.Vector3 b)
### Replacement: static UnityEngine.Vector3 UnityEngine.Vector3::UnityEngine.Vector3.op_Subtraction_Patch0(UnityEngine.Vector3 a, UnityEngine.Vector3 b)
IL_0000: Local var 0: UnityEngine.Vector3
IL_0000: Local var 1: UnityEngine.Vector3
IL_0000: // start original
IL_0000: ldloca.s   1 (UnityEngine.Vector3)
IL_0002: ldloc.0
IL_0003: ldfld      System.Single UnityEngine.Vector3::x
IL_0008: ldloc.1
IL_0009: ldfld      System.Single UnityEngine.Vector3::x
IL_000E: sub
IL_000F: stfld      System.Single UnityEngine.Vector3::x
IL_0014: ldloca.s   1 (UnityEngine.Vector3)
IL_0016: ldloc.0
IL_0017: ldfld      System.Single UnityEngine.Vector3::y
IL_001C: ldloc.1
IL_001D: ldfld      System.Single UnityEngine.Vector3::y
IL_0022: sub
IL_0023: stfld      System.Single UnityEngine.Vector3::y
IL_0028: ldloca.s   1 (UnityEngine.Vector3)
IL_002A: ldloc.0
IL_002B: ldfld      System.Single UnityEngine.Vector3::z
IL_0030: ldloc.1
IL_0031: ldfld      System.Single UnityEngine.Vector3::z
IL_0036: sub
IL_0037: stfld      System.Single UnityEngine.Vector3::z
IL_003C: ldloca.s   1 (UnityEngine.Vector3)
IL_003E: // end original
IL_003E: ret
DONE
#

this is the working one

royal mica
#

Iy gives so strange code idk why

grand flower
#

wtf

#

it just randomly stopped working

#

Reason: Invalid IL code in (wrapper dynamic-method) UnityEngine.Vector3:UnityEngine.Vector3.op_Subtraction_Patch0 (UnityEngine.Vector3,UnityEngine.Vector3): IL_003e: ret

#

that or I just... didn't notice it being wrong?

#

oh

#

it was lmao

#
### Patch: static UnityEngine.Vector3 UnityEngine.Vector3::op_Subtraction(UnityEngine.Vector3 a, UnityEngine.Vector3 b)
### Replacement: static UnityEngine.Vector3 UnityEngine.Vector3::UnityEngine.Vector3.op_Subtraction_Patch0(UnityEngine.Vector3 a, UnityEngine.Vector3 b)
IL_0000: Local var 0: UnityEngine.Vector3
IL_0000: Local var 1: UnityEngine.Vector3
IL_0000: // start original
IL_0000: ldloca.s   1 (UnityEngine.Vector3)
IL_0002: ldloc.0
IL_0003: ldfld      System.Single UnityEngine.Vector3::x
IL_0008: ldloc.1
IL_0009: ldfld      System.Single UnityEngine.Vector3::x
IL_000E: sub
IL_000F: stfld      System.Single UnityEngine.Vector3::x
IL_0014: ldloca.s   1 (UnityEngine.Vector3)
IL_0016: ldloc.0
IL_0017: ldfld      System.Single UnityEngine.Vector3::y
IL_001C: ldloc.1
IL_001D: ldfld      System.Single UnityEngine.Vector3::y
IL_0022: sub
IL_0023: stfld      System.Single UnityEngine.Vector3::y
IL_0028: ldloca.s   1 (UnityEngine.Vector3)
IL_002A: ldloc.0
IL_002B: ldfld      System.Single UnityEngine.Vector3::z
IL_0030: ldloc.1
IL_0031: ldfld      System.Single UnityEngine.Vector3::z
IL_0036: sub
IL_0037: stfld      System.Single UnityEngine.Vector3::z
IL_003C: ldloc.0
IL_003D: // end original
IL_003D: ret
DONE


#

the real working one

#

hopefuly

#

nvm i fall through the map

restive turret
#

this is what u do in IL

grand flower
#

bruh

#

rider's il really is fucked

restive turret
#

and u didnt try mine so

grand flower
#

testing

#

wanted to try rider's version first

royal mica
restive turret
#

just dont use rider ClassDTroll

royal mica
#

Cause using two tools jist for patcges are inconvinient

restive turret
#

I rather have no IL than fucked up IL

royal mica
restive turret
#

atleast i dont use to create false IL

royal mica
#

I mean you can you dnspy or ilspy, just really inconvinient not to use the built in

restive turret
#

well ye since I reverse I always have open dnspy and ILSPY

#

so

grand flower
# restive turret try this

Invalid IL code in (wrapper dynamic-method) UnityEngine.Vector3:UnityEngine.Vector3.op_Subtraction_Patch0 (UnityEngine.Vector3,UnityEngine.Vector3): IL_000f: stfld 0x00000005

restive turret
#

also easier to seach stuff in there

grand flower
#

ehhh forget it

#

problem for future me

restive turret
#

skill issue

grand flower
#

i've got work and it's not worth the hassle

#

other performance tweaks got us good results so we don't need it atm

restive turret
#

just edit the plain dll and apply the changes

#

ClassDTroll1 l

grand flower
#
[log] ArgumentException: An item with the same key has already been added. Key: ReferenceHub (Name='Player [connId=33]', NetID='19766', PlayerID='46')
[log] at System.Collections.Generic.Dictionary`2[TKey,TValue].TryInsert (TKey key, TValue value, System.Collections.Generic.InsertionBehavior behavior) [0x0015a] in <069d7b80a3914a08b6825aa362b07f5e>:0
[log] at System.Collections.Generic.Dictionary`2[TKey,TValue].Add (TKey key, TValue value) [0x00000] in <069d7b80a3914a08b6825aa362b07f5e>:0
[log] at LabApi.Features.Wrappers.Player..ctor (ReferenceHub referenceHub) [0x0000b] in <bea7f403b90e4786abd99fa819db9853>:0
[log] at LabApi.Features.Wrappers.Player.AddPlayer (ReferenceHub referenceHub) [0x00008] in <bea7f403b90e4786abd99fa819db9853>:0
[log] at (wrapper delegate-invoke) System.Action`1[ReferenceHub].invoke_void_T(ReferenceHub)
[log] at ReferenceHub.Start () [0x00009] in <8db1ca0fe9a6484084cda320b139932c>:0

is this getting fixed or is it a me issue?

restive turret
#

didnt seen this issue

royal mica
grand flower
#

mostly when someone disconnects on our end

#

sucks

royal mica
#

For us when players are connecting and got auth accepted

restive turret
#

i dont see it

royal mica
#

It is in LocalAdminLogs, usually it happens 3-4 times per round

#

I wonder if something setup in plugin causes that

royal mica
restive turret
#

nop

royal mica
#

Oh. @grand flower do you use CustomDataStore? If yes, do you access it in OnPlayerJoined?

grand flower
#

Possibly yes

#

I can check

#

Although data stores are pissing me off since they seem to carry over rounds and even disconnects sometimes (?)

royal mica
#

I wonder if fetching the datastore causes it. Cause the GetPlayer creates it if it doesnt exists

grand flower
#

Had so many bugs due to that

#

GetPlayer creating if it doesnt exist is a bad decision

#

IIRC someone at NW said they knew about it though so hopefully it gets fixed soon

royal mica
#

We just use that for persistent data. For per round we reimplemented the PluginAPI update loop custom object handling cause we needed the loop dogkek

grand flower
#

I just made a TransientDataStore subclass that gets nuked on round restart or when the player leaves

#

Made it easier

#

Also have an IRoleLifetime interface that marks a data store as only being valid for the duration of one role

#

Little helpers like that are useful

olive falcon
#

N879UYIHJKNMΓ– 98IOKJMΓ– 0*OPLΕžΓ‡Γ–PĞŞLΓ‡EREROL-ΔžΕžΔ°Γ‡.

#

,+

royal mica
#

Same man, same.

hearty shard
#

you're welcome

olive falcon
hearty shard
olive falcon
#

fast and accurate

celest thorn
#

Someone knows a way to make primitives glow?

#

because i tried

new Vector4(primitive.NetworkColor.r, primitive.NetworkColor.g,
                                primitive.NetworkColor.b, Glowing);

But it doesn't work

hearty shard
celest thorn
royal mica
#

Is there even a glow shader in SL?

celest thorn
#

but i don't quite understand, when i asked there alot of time ago they told me this

royal mica
#

Look at MER source then

celest thorn
#

Wait if its negative

#

it EATS light

#

Lol

#

WHAT is HAPPENING LOL

terse bone
#

ig if you set each color (r, g, b) to some big number > 1 it will glow

celest thorn
#

the light is shitting itself

#

oh my god

#

the game is dying lol

#

lights around the facility are dying

unique crane
#

Bro is going into 4th dimension

celest thorn
unique crane
#

its an anomaly

celest thorn
#

ok i found out something strange

#

lol

#

the cubes create lights

#

but becomes like in a bug state

royal mica
#

Lmao

celest thorn
#

where it reflects its own shadow

royal mica
#

Self reflecting cubes

celest thorn
#

IT looks cool

#

but its not WHAT i wanted lol

#

OH WAIT

#

NEGATIVE

#

its a transparent cube

#

but with reflecting abilities

unique crane
#

Yeah its RGBA...

celest thorn
#

THIS IS CRAZY

#

this is cool asf

royal mica
#

I wonder deep the cursed can go

#

how deep

celest thorn
#

im fixing it rn

#

to be more stable

royal mica
#

Sadly im not at home so I cany

celest thorn
#

sad

royal mica
#

I would have liked to

celest thorn
#

tell me a number

restive turret
royal mica
#

Eww going outside

celest thorn
#

got told alot of time ago it worked

#

didn't belive it

#

until i tested it myself

#

and it works

#

im really surprised

#

it didn't work

#

because i've made a mistake the first time lol

#

now it should always work

restive turret
#

i meant the values

celest thorn
#

and second one -20

#

this is how you see it on the editor

#

i think i've made a mistake?

restive turret
#

show me your Attribute on the color

celest thorn
#

OH WAIT

restive turret
#

[ColorRGBA] or smth

celest thorn
#

IT WASN'T THE CUBE

restive turret
#

it will not work with it

celest thorn
#

the cube was reflecting the light source

#

i forgot to remove it

restive turret
celest thorn
#

am i stupid?

#

yes

#

i've found it

#

if its negative

#

it works

#

it becomes the death cube of blackness with blue aura

#

WAIT

#

THIS IS SO COOL

#

I created lens

restive turret
#

huh

celest thorn
#

so cool

restive turret
#

aintnoway

unique crane
# celest thorn

Make one flat plane with that material and parent it in front of a player

#

how to get high 101

celest thorn
#

not negative glowing

#

lol

unique crane
#

*-1f it

celest thorn
#

I did

hearty shard
unique crane
#

Theeen I dont know

hearty shard
#

fake sync my beloved

celest thorn
hearty shard
#

david!!!

unique crane
#

eve!!

hearty shard
#

whats ur actual job

celest thorn
#

nameless you are mean ;(

hearty shard
#

outside SL

unique crane
#

None

hearty shard
#

oh.

#

okay

unique crane
#

still studying

hearty shard
#

so ur poor?

unique crane
#

No

hearty shard
#

zero pay us

#

oh

#

pay me not david then

restive turret
#

can zero pay me

hearty shard
#

who r u again

restive turret
#

your worst nightmare

hearty shard
#

u stink

restive turret
#

u poopy

celest thorn
upper vapor
#

i didn't know you could smell your nightmares

celest thorn
#

I don't pay none

celest thorn
#

Btw crazy idea

hearty shard
#

us!

celest thorn
#

im not rich

#

rn i have the money to pay my monster addiction

upper vapor
celest thorn
#

white monster and pink one are the best

restive turret
celest thorn
#

THSI SI SO COOL

unique crane
celest thorn
unique crane
#

want it?

celest thorn
#

:3

restive turret
#

dont UV light the facilty

celest thorn
#

btw i got an idea

#

IF i multiply all of the numbers

#

what happens

#

Im probably going to put this like under a section called Unsafe

#

because its probably unsafe lol

#

people can become blind

unique crane
celest thorn
#

lol

#

Im going to test rn

#

if the game crashes is going to be funny

#

i don't think im supposed to do this

#

i always wondered who was the first one to commit to SL source code primitives

#

was Hubert?

unique crane
#

I can look in a few mins

restive turret
#

scrolling tru 4000 commits

celest thorn
#

fr

#

WHAT HAPPENED

#

THE CUBE NOW REFLECT LIGHT

#

but is blank

#

like idk how to explain it

#

WHAT

#

THIS IS CRAZY

#

blank cube but you can shine it and it becomes a color

#

THIS COULD BE COOL FOR ALOT OF STUFF

#

yep i found the way to do them

#

OH MY GOD THIS IS LAGGY

#

lol

#

i've created the cubes that eats light

restive turret
#

congrat

icy knoll
celest thorn
#

but if you do

#

-340282300000000000000000000000000000000 it creates light

#

340282300000000000000000000000000000000 it eats light

#

thats what it does if you multiply all of the numbers and A channel

unique crane
#

tf are you doing

icy knoll
celest thorn
#

now im testing with only A channel

celest thorn
icy knoll
#

if you shine light on it, it doesn’t reflect

#

at all

#

eats light

celest thorn
#

lol

#

even light around

#

i don't fucking know what i created

#

it creats light

#

but reflect its own light

#

and its invisible

#

and depending where you see it, it changes color

#

i think im destroying unity HDPR pipeline

#

Wait

#

its normal that the cube reflects like metal?

#

because i've never seen this effect

#

like in this way

unique crane
#

Very lightly

celest thorn
#

Lets see how fast before they make something crazy

#

With this new technique

#

I don’t think its even possible to do crazy strats

young phoenix
#

is there a way to debug the plugin with visual studio debugger?

young phoenix
#

πŸ’”

unique crane
#

@grand flower Delegates are not executed randomly (event) as far as I know

#

U sure you cant just load one plugin before another to keep the order you want?

#

Or perhaps.. combine them?

grand flower
#

not always possible

#

and afaik C# delegates aren't guaranteed to run in the order they're bound

#

example is adding/removing a handler on effect enable/disable

#

there's plenty of times where i'd do that but i'd still want them to run before idk CustomEventHandlers

#

I could make my own priority system but it'd be nice to have it natively within LabAPI

grand flower
#

I did somewhat have one made but like, it made everything super dirty

#

handlers could prevent other handlers from firing which was cool but it was a mess

#

ended up scrapping it all and just using the static events

ionic prawn
#

i keep getting stuck
Severity Code Description Project File Line Suppression State Details
Error (active) CS1503 Argument 1: cannot convert from 'LabApi.Features.Wrappers.Generator' to 'LabApi.Scp079Generator' NoKeycardHold C:\Users\Admin\source\repos\NoKeycardHold\EventsHandler.cs 34

grand flower
#

send code

ionic prawn
#

public static bool HasKeycardPermissionD(Door door, Player player) =>
HasPlayerPermission(player, door.Base);
public static bool HasKeycardPermissionL(LabApi.Features.Wrappers.LockerChamber chamber, Player player) =>
HasPlayerPermission(player, chamber.Base);
public static bool HasKeycardPermissionG(Scp079Generator generator, Player player) =>
HasPlayerPermission(player, generator)

#

public override void OnPlayerInteractingGenerator(PlayerInteractingGeneratorEventArgs ev)
{
var Generator = ev.Generator;
var player = ev.Player;

    var requiredPermission = PluginFunctions.HasKeycardPermissionG(Generator, player);
}
#

both are in different btw

grand flower
#

Generator.Base

ionic prawn
#

oh

#

ty

hearty shard
#

Whats ur HasPlayerPermission code

ionic prawn
#

i stole it cause im too tired to make my own πŸ˜‚

ionic prawn
# hearty shard Whats ur HasPlayerPermission code

public static bool HasPlayerPermission(Player player, IDoorPermissionRequester requester)
{
DoorPermissionFlags flags = DoorPermissionFlags.None;

    if (player.IsBypassEnabled)
        return true;

    if (player.RoleBase is IDoorPermissionProvider doorPermissionProvider)
        flags |= doorPermissionProvider.GetPermissions(requester);

    foreach (Item item in player.Items)
        if (item is KeycardItem keycardItem)
            flags |= keycardItem.Base.GetPermissions(requester);

    return requester.PermissionsPolicy.CheckPermissions(flags);
}
hearty shard
#

Oh

#

Did you use my code

#

Looks like it

#

I updated it btw

ionic prawn
#

wait

hearty shard
#

Uses enum now to decide what to check

ionic prawn
#

this

hearty shard
#

What purpose do u need it for btw

ionic prawn
#

also how should i even trigger the door to open and close 😭

#

im new to C# and LabAPI

#

😭

hearty shard
ionic prawn
hearty shard
#

I dont rememeber

ionic prawn
hearty shard
#

What is the goal with the check

ionic prawn
#

to see if they have right permission

#

so they dont have to hold thier card

#

/ remotecard

hearty shard
#

okay yeah

#

thats fine

ionic prawn
hearty shard
#

just making sure ur not checking for all items if ur only meaning to check the held one

ionic prawn
#

lol

hearty shard
#

Remote card makes sense

ionic prawn
#

yeah

hearty shard
#

?

ionic prawn
#

okay

hearty shard
#

I have no clue

#

im doing off memory and guesses

ionic prawn
#

isopen dosent exist

hearty shard
#

tf

#

Oh irs

#

IsOpened

ionic prawn
#

well i checked another one

#

they use NetworkTargetState

hearty shard
restive turret
#

Ye

hearty shard
#

If there is wrapper

ionic prawn
#

ok

hearty shard
#

If u r beginner

#

It is not a good idea to mix and mash unless yk what ur doing

ionic prawn
#

door.IsOpened = !door.IsOpened; πŸ€‘

restive turret
#

Tip number zero:
Learn c#
Tip numero uno:
IDE help you VS22, Rider use it to your advantage

ionic prawn
#

on generator its isopen

ionic prawn
#

im stupid when you try to open a door when holding a keycard or a door without keycard it will intercept 😭

#

so it will stay closed

restive turret
ionic prawn
#

how to detect if your holding a keycard?

icy knoll
restive turret
#

^

ionic prawn
#

i suck
if (player.CurrentItem.Category == LabApi.Features.Wrappers.KeycardItem);

#

😭

#

Severity Code Description Project File Line Suppression State Details
Error (active) CS0119 'KeycardItem' is a type, which is not valid in the given context NoKeycardHold C:\Users\Admin\source\repos\NoKeycardHold\EventsHandler.cs 39

restive turret
#

There is no category

restive turret
#

No

#

If you want to check category you equal to Category.Keycards

#

Or something

ionic prawn
#

still same error ):

restive turret
#

Use VS damnit

#

Whag type is the Category

ionic prawn
#

yay if (player.CurrentItem.Category == ItemCategory.Keycard);

restive turret
#

Yey

#

Yes

ionic prawn
#

):

[2025-05-25 01:35:14.784 +02:00] [ERROR] [LabApi] 'NullReferenceException' occured while invoking 'OnPlayerInteractingDoor' on 'NoKeycardHold.EventsHandler': 'Object reference not set to an instance of an object', stack trace:
at NoKeycardHold.EventsHandler.OnPlayerInteractingDoor (LabApi.Events.Arguments.PlayerEvents.PlayerInteractingDoorEventArgs ev) [0x00029] in <fd2d828c4ed349f6b1500b5827f600a1>:0
at LabApi.Events.EventManager.InvokeEvent[TEventArgs] (LabApi.Events.LabEventHandler`1[TEventArgs] eventHandler, TEventArgs args) [0x0001d] in <bea7f403b90e4786abd99fa819db9853>:0

restive turret
#

Ah ye

#

Because the CurrentItem can be null

ionic prawn
#

OHHHH

#

YEAH IT HAPPENDS WHEN I DONT HOLD A CARD

grand flower
#

if (player.CurrentItem is {IsDestroyed: false, Category: ItemCategory.Keycard})

restive turret
#

if (player.CurrentItem != null && yourstuffhere

grand flower
#

Not sure it has IsDestroyed, if not remove that part

ionic prawn
#

if (hasPermission)
{
if (player.CurrentItem.Category != ItemCategory.Keycard)
{
if (!player.IsBypassEnabled)
{
door.IsOpened = !door.IsOpened;
}
}
}
}

#

right now

#

i have this for the door

#

Severity Code Description Project File Line Suppression State Details
Error (active) CS0019 Operator '&&' cannot be applied to operands of type 'bool' and 'ItemCategory' NoKeycardHold C:\Users\Admin\source\repos\NoKeycardHold\EventsHandler.cs 42

#

oh

#

wait

#

cant use && on bool

if (player.CurrentItem.Category != ItemCategory.None && ItemCategory.Keycard)

grand flower
#
            if (hasPermission)
            {
                if (player is { CurrentItem: { IsDestroyed: false, Category: not ItemCategory.Keycard }, IsBypassEnabled: false })
                {
                    door.CanOpen = true;
                }
            }
ionic prawn
#

ty

#

what about if bypass?

grand flower
ionic prawn
#

oh

#

if i hold a card nothing happends when i interact

#

and if i dont hold a card it wont open

grand flower
#

oh wait

#

sec

#

here modified the code

hearty shard
#

I feel like theres a better way of this

grand flower
#

how so

hearty shard
#

Oh

#

ev.CanOpen = true

#

@ionic prawn

ionic prawn
#

bruhhh

ionic prawn
#

ev.CanOpen = !ev.CanOpen?

hearty shard
#

Assuming ur using this event...

ionic prawn
#

namespace NoKeycardHold;

using Interactables.Interobjects.DoorUtils;
using LabApi.Events.Arguments.PlayerEvents;
using LabApi.Events.CustomHandlers;
using LabApi.Features.Console;
using LabApi.Features.Wrappers;
using LiteNetLib;
using System.Net;

public class EventsHandler : CustomEventsHandler
{
public override void OnPlayerInteractingDoor(PlayerInteractingDoorEventArgs ev)
{
var door = ev.Door;
var player = ev.Player;

    var requiredPermissions = door.Base.RequiredPermissions;
    bool hasPermission = PluginFunctions.HasKeycardPermissionD(door, player);

    if (hasPermission)
    {
        if (player is { CurrentItem: { IsDestroyed: false, Category: ItemCategory.Keycard }, IsBypassEnabled: false })
        {
            ev.CanOpen = !ev.CanOpen;
        }
    }
}

public override void OnPlayerInteractingGenerator(PlayerInteractingGeneratorEventArgs ev)
{
    var Generator = ev.Generator;
    var player = ev.Player;

    bool hasPermission = PluginFunctions.HasKeycardPermissionG(Generator.Base, player);

    if (hasPermission)
    {
        if (player is { CurrentItem: { IsDestroyed: false, Category: ItemCategory.Keycard }, IsBypassEnabled: false })
        {
            Generator.Base.IsOpen = !Generator.Base.IsOpen;
        }
    }
}

}

grand flower
#

just = true

#

wrong event

ionic prawn
#

what

hearty shard
grand flower
#

OnPlayerUnlockingGenerator

#

is probably what you want

hearty shard
#

Oh

#

I was on door

#

My bad

grand flower
ionic prawn
#

so this on door ev.CanOpen = true; and generator?

hearty shard
ionic prawn
#

ok

#

gonna test it now

#

wait

hearty shard
#

idk if gen will work like that

#

Idk how nw does their things

ionic prawn
#

what about if your holdin the correct card to open?

hearty shard
ionic prawn
#

ok

#

when i hold the card it works fine but if i unequip my card it wont work

grand flower
#

what are you trying to do

ionic prawn
#

remote card

grand flower
#

i updated it

ionic prawn
#

ok

slate flume
hearty shard
#

CanOpen should be used

#

Instead of opening door manually

grand flower
#

updated

#

meant the condition

#

not the body

ionic prawn
#

so i could just add a not on the category

#

Category: not ItemCategory.Keycard

hearty shard
ionic prawn
#

nope wont open when i dont hold the card

#

isnt it ev.CanOpen and not Door.CanOpen

hearty shard
ionic prawn
#

but it wont work

hearty shard
#

It should

ionic prawn
#

public override void OnPlayerInteractingDoor(PlayerInteractingDoorEventArgs ev)
{
var door = ev.Door;
var player = ev.Player;

    var requiredPermissions = door.Base.RequiredPermissions;
    bool hasPermission = PluginFunctions.HasKeycardPermissionD(door, player);
    if (hasPermission)
    {
        if (player is { CurrentItem: { IsDestroyed: false, Category: not ItemCategory.Keycard }, IsBypassEnabled: false })
        {
            ev.CanOpen = true;
  
        }
    }
}
#

public static bool HasKeycardPermissionD(Door door, Player player) =>
HasPlayerPermission(player, door.Base);
public static bool HasKeycardPermissionL(LabApi.Features.Wrappers.LockerChamber chamber, Player player) =>
HasPlayerPermission(player, chamber.Base);
public static bool HasKeycardPermissionG(Scp079Generator generator, Player player) =>
HasPlayerPermission(player, generator);

public static bool HasPlayerPermission(Player player, IDoorPermissionRequester requester)
{
    DoorPermissionFlags flags = DoorPermissionFlags.None;

    if (player.IsBypassEnabled)
        return true;

    if (player.RoleBase is IDoorPermissionProvider doorPermissionProvider)
        flags |= doorPermissionProvider.GetPermissions(requester);

    foreach (Item item in player.Items)
        if (item is KeycardItem keycardItem)
            flags |= keycardItem.Base.GetPermissions(requester);

    return requester.PermissionsPolicy.CheckPermissions(flags);
}
hearty shard
ionic prawn
#

same on gen? but isallowed

hearty shard
#

Idk how gen works and im only doing door based on the naming of it

ionic prawn
#

restarting the server rn

#

ok

#

YESSSSSSSSSSSSSSSS

#

finnaly

#

it works

#

generator dosent work sadly

#

also is those like lockers with that needs keycards is it lockers or something else in coding?

ionic prawn
#

should i do like generator.isunlocked = true?

hearty shard
ionic prawn
#

how do i see how many players there are

#

chekc*

icy knoll
ionic prawn
#

yeaqh

#

server.playercount

#

how to change player speed?

hearty shard
ionic prawn
#

ok

#

only door works but generator or chamber wont work..
public override void OnPlayerUnlockingGenerator(PlayerUnlockingGeneratorEventArgs ev)
{
var Generator = ev.Generator;
var player = ev.Player;

    bool hasPermission = PluginFunctions.HasKeycardPermissionG(Generator.Base, player);

    if (hasPermission)
    {
        ev.Generator.Base.IsUnlocked = true;
    }
}

public override void OnPlayerInteractedLocker(PlayerInteractedLockerEventArgs ev)
{
    var Locker = ev.Chamber;
    var player = ev.Player;

    bool hasPermission = PluginFunctions.HasKeycardPermissionL(Locker, player);

    if (hasPermission)
    {
        ev.Chamber.IsOpen = !ev.Chamber.IsOpen;
    }
}
#

oh

#

chamber i understand now 😭

#

but not generator

#

chamber wont work either

slate flume
#

I NEED A HERO

true cedar
#

also

true cedar
buoyant oyster
#

how do I change what players/teams a player can damage?

grand flower
#

IsAllowed

buoyant oyster
#

oh its that simple

#

alright ty

teal junco
#

How should I go about properly handling an internal personal library for shared functions?

#

im worried about if i implement it incorrectly or something

#

if I make one, wil people be deterred from using my plugin because theres more files?

#

what if I make multiple modules of the library?

true cedar
teal junco
#

its a dll, i need some way to distribute it

#

and the source is public, i dont care.

#

its just not designed for others to develop with.

true cedar
#

oh

#

then just put everything in one dll

#

u dont want people to have to install 18 things just to get betterelevatordoors working

teal junco
# true cedar then just put everything in one dll

yeah thats what i wanted to do, but it would end up dragging several double-dependencies with it. like I have an audio module for my library, but i dont want to add it to the main dll because some of my plugins dont use audio

true cedar
#

just make sure the audio parts don't activate if there's not a plugin using it

#

like the patches

#

i guarantee u the average server owner does not care about how big a plugin is

grand flower
#

can't you just put it as dependencies instead of a plugin

teal junco
grand flower
#

plugins having dependencies is very common

teal junco
#

For the most part i just use reflection to avoid requiring dependencies on assemblies.

grand flower
#

bad

#

just reference them

#

if someone wants your plugin they'll drag the handful of dependencies into the dependencies folder

#

they won't care

teal junco
#

its a soft dependency on another plugin i dont want to force the user to install, for instance UCR

#

UCR is known to break things sometimes and I dont want that to be a requirement.

true cedar
#

y

teal junco
#

or does that only come up when its actually referenced

true cedar
#

maybe with labapi it does but i believe it only occurs when u use something that references it

#

since c# is jit

#

so if theres a method that uses something from that assembly and you run it, even if the code referencing the assembly isnt ran itll still crash if u dont have the assembly

teal junco
#

Okay

true cedar
#

actually idk if it would crash u might be able to try catch it

teal junco
#

so if I basically just avoid using any type or method from the assembly in certain parts of my code, there won't be an issue until I run a part of my code that does

true cedar
#

i think i did something like that for ruei

teal junco
#

does that also include a method simply containing a type from another assembly

#

this is interesting, i cant believe i never realized this lol

true cedar
#

yeah

true cedar
#

basically if the runtime ever tries to find a type and goes "hey wait a second this isnt here"

#

error

teal junco
#

does the runtime search a method fully or just when it executes

#

because I think I can just hide code behind an if-else to prevent errors from throwing

true cedar
#

when the method executes for the first time

true cedar
teal junco
#

but it should work yes?

true cedar
#
if (x) {
   ForeignType.Method();
}

vs

if (x) {
  OtherMethod();
}
OtherMethod:
ForeignType.Method();
#

yea

#

probably

#

idk if labapi fucks it up

teal junco
#

i can also check if the assembly is loaded using the reflection i think...

#

but yeah this is good

true cedar
#

u can yea

heady turret
#

How can I get players which player muted or does he enable mute alives players and etc.?

teal junco
#

i feel kinda stupid for not realizing this

true cedar
#

nah i don't blame u

#

its a bit obscure

teal junco
teal junco
# teal junco

this is the length i went to to avoid my users absolutely needing to install UCR

#

and it was probably for nothing LOL

true cedar
#

its really just a byproduct of how c# works. i don't think they want u to do it

teal junco
true cedar
teal junco
#

is there any "official" way to do soft-dependencies?

#

besides reflection which is what i was doing.

true cedar
#

other than referencing it and never using it if its not loaded not really

teal junco
#

Im not too proud of it now haha

buoyant oyster
#

what do I do to change this specifically?

teal junco
#

Not possible base-game

buoyant oyster
#

is it possible at all?

teal junco
#

youll need to do Player::InfoArea &= ~(PlayerInfoArea.Role | PlayerInfoArea.Nickname); // add all other things you need to hide

#

and then Player::CustomInfo = "{badge}\n{custominfo}\n{name}\n{roletext}"

teal junco
buoyant oyster
#

oh that sounds like fun

grand flower
#

TIL about InfoArea

#

good to know

teal junco
buoyant oyster
#

yea i assumed so

teal junco
#

okay good

buoyant oyster
#

I might have to write my own system to manage it

#

how do I see what info segments are enabled so I can make it look identical to base game

#

nvm its bitwise operations

#

sorry new to c#

#

How do I get the values for each of those things individually so I can rebuild the string? badge, role, nickname, unit name, power status (i have no idea what badge and power status even mean lol)

teal junco
buoyant oyster
#

power status seems pointless so i'll just ignore that

#

badge idk how to get, role i know how to get, nickname i know how to get, unit name i dont know how to get

teal junco
#

Nickname: Player::Nickname
Unit name: NamingRulesManager.ClientFetchReceived(Player::Team, Player::UnitId);

buoyant oyster
#

nvm unit name i can get thru the role type id

#

uh

#

what ab badge

#

thats the last one

upper vapor
#

you should probably keep the badge visible

teal junco
#

yeah

#

just leave it alone

buoyant oyster
#

if it always appears at the top then i'll do that

teal junco
#

it stays on top all the time anyways i think

grand flower
#

Does Unity provide a high-resolution time? I need something that'll update during a method call

upper vapor
#
  1. you don't have to add it to custom info
  2. since it's independent it can change (showtag/hidetag)
buoyant oyster
#

i assumed i'd have to change it cuz idk if it always appeared on top

#

ty guys

teal junco
#

I just needed to share it because i fucking hated working on it

#

@buoyant oyster you probably dont need to show the UnitName manually

grand flower
teal junco
#

just leave it in the InfoArea

grand flower
#

checking how to convert ticks to ms

#

writing some budgetting code

upper vapor
buoyant oyster
teal junco
#

Man I fucking hate programming I dont know why I ever got into this shitshow in the first place

teal junco
#

in fact it only applies to MTF and Guards, but its still a human universal trait

#

(Foreshadowing for CI Unitnames??)

upper vapor
#

you mean

#

source [dot] dot [dot] net

grand flower
#

right they changed it

#

i keep forgetting

buoyant oyster
teal junco
buoyant oyster
#

chaos repressor n whatever

grand flower
#
        /// <summary>Gets the elapsed time since the <paramref name="startingTimestamp"/> value retrieved using <see cref="GetTimestamp"/>.</summary>
        /// <param name="startingTimestamp">The timestamp marking the beginning of the time period.</param>
        /// <returns>A <see cref="TimeSpan"/> for the elapsed time between the starting timestamp and the time of this call.</returns>
        public static TimeSpan GetElapsedTime(long startingTimestamp) =>
            GetElapsedTime(startingTimestamp, GetTimestamp());
 
        /// <summary>Gets the elapsed time between two timestamps retrieved using <see cref="GetTimestamp"/>.</summary>
        /// <param name="startingTimestamp">The timestamp marking the beginning of the time period.</param>
        /// <param name="endingTimestamp">The timestamp marking the end of the time period.</param>
        /// <returns>A <see cref="TimeSpan"/> for the elapsed time between the starting and ending timestamps.</returns>
        public static TimeSpan GetElapsedTime(long startingTimestamp, long endingTimestamp) =>
            new((long)((endingTimestamp - startingTimestamp) * s_tickFrequency));
 
#

easy peasy

teal junco
#

or empty string

upper vapor
#

roles have an UsesUnitNames property or similar

buoyant oyster
#

why it gotta be so complicated

upper vapor
#

wait

teal junco
#

for 99% of cases it literally doesnt matter and will only serve to make your headache worse :3

buoyant oyster
#

good to know

upper vapor
#

but

#

labapi returns -1 if there is no unit so you'd get an ArgumentOutOfRangeException

teal junco
#

only difference
with it disabled and you add your own way to fetch it :

Name
RoleName (UNIT-NAME)```
with it enabled:

Name
Rolename

(UNIT-NAME)```

teal junco
#

hold on

upper vapor
#

omgggggg

#

yea

teal junco
#

yeah the argument out of range exception is true though

#

so... since LabPlayer wrapper just doesnt have UnitName property (which EXILED has and has protections for), and managing it would be a god-damned PAIN anyways

#

Just dont bother with it

#

Coming from one Rolename replacer to another

upper vapor
#

if somebody complains

#

they should not complain

teal junco
#

(Nobody will)

#

Im serious, 99% of players genuinely dont even see this stuff

upper vapor
#

i was also lazy to include unit names in the info because there isn't much point

teal junco
#

like they will have to have a side-by-side to even realize there's a difference

upper vapor
buoyant oyster
#

so to clarify rq the only two that i really need to disable and build a new string for are Nickname and Role?

teal junco
teal junco
#

and ensure CustomInfo is enabled

buoyant oyster
#

good to know

#

ty for the help

teal junco
#

and I bet if I asked 100 players about it, only one would even say anything approaching "oh yeah, i noticed that"

teal junco
# teal junco Im serious, 99% of players genuinely dont even see this stuff

in fact, im fairly certain 99% of players wont even realize if the RoleName is above or below your username. It is definitely way more jarring, but it took even me a long time to explicitly notice that (some customrole implementations use CustomInfo directly instead of rebuilding the InfoArea from scratch)

upper vapor
#

eh, yeah

grand flower
#

Question, can plugins use Unity's RuntimeInitializeOnLoadMethod

#

no they cannot, dunno why I didn't just test it

random scaffold
#

how i can create custom receipt in 914?

#

Scp914ProcessingInventoryItemEventArgs dont have next item or something

frank flicker
#

Oof I've been tinkering with that

#

I'll hop on my PC in a sec

#

Look into the Scp914 class, I think that's where to start looking

grand flower
#

Wdym receipt?

#

P sure you can set the next item in the event args no?

frank flicker
#

probably recipe but autocorrected

grand flower
#

Oh

#

Yeah pretty sure event args have a setter for NextItem

frank flicker
#

I must be really blind if thats true because I couldn't find it -v-

frank flicker
#

and then in the plugin enable (or maybe map generated, havent tested that far yet) you can set the item processor to an instance of your class

#

but someone let me know if I'm doing it a bad way cus its 90% working but I'm not sure whats wrong with the 10%

frank flicker
#

I guess you could set the pickup, say the event is not allowed, and manually move it under Scp914ProcessingPickupEventArgs

#

and can manually change the items in the players inventories under Scp914ProcessingPlayerEventArgs

random scaffold
#

@unique crane do you can review pr? SteamHappy

frank flicker