#plugins-dev-chat

1 messages · Page 186 of 1

slate flume
#

It happens maybe 15% of the time?

#

[2026-02-13 03:50:37.187 -06:00] True | False
[2026-02-13 03:50:37.203 -06:00] True | False
[2026-02-13 03:50:37.218 -06:00] True | False
[2026-02-13 03:50:37.233 -06:00] True | False
[2026-02-13 03:50:37.277 -06:00] True | False
[2026-02-13 03:50:37.303 -06:00] True | False
[2026-02-13 03:50:37.327 -06:00] True | False
[2026-02-13 03:50:37.340 -06:00] True | False
[2026-02-13 03:50:37.366 -06:00] True | False
[2026-02-13 03:50:37.402 -06:00] True | False
[2026-02-13 03:50:37.415 -06:00] True | False
[2026-02-13 03:50:37.430 -06:00] True | False
[2026-02-13 03:50:37.459 -06:00] False | False
[2026-02-13 03:50:37.478 -06:00] False | False
[2026-02-13 03:50:37.491 -06:00] False | True
[2026-02-13 03:50:37.506 -06:00] False | True

hmph

#

Two in a row

#

Not boding well

#

Can someone answer my prayers and fix this 🙏🏻 I'm going insane

#

I don't know why it's this difficult to figure out if someone is continuously firing

#

Worst-case scenario I do a five-frame buffer for players and check if a majority is firing, but that's a much more intensive and less convenient version

celest thorn
slate flume
celest thorn
#

im out of here

#

bye bye

slate flume
#

Lmao

celest thorn
#

i know what you are talking about

slate flume
#

Real

celest thorn
#

IM NOT DEALING WITH THAT AGAIN

slate flume
#

Tuffff

celest thorn
#

the fix

slate flume
#

Did you ever find a solution?

celest thorn
#

not doing it

slate flume
#

Could you tell me what it is at least 🙏🏻

#

I'll do crazy shit if it means I can solve this in an efficient way

celest thorn
#

i tried everything

#

its so client side

slate flume
#

🔥🔥🔥🔥🔥🔥

celest thorn
#

that guns are so coded badly for server

slate flume
#

Should I @ maro

#

Cause I'm getting cooked by ts

celest thorn
slate flume
#

Okay!

celest thorn
#

she is sleeping rn

#

but i did fix my issue

#

so let me look at yours lol

slate flume
#

I'm trying to make an effective IsShooting extension to Player

#

To figure out if the revolver is shooting I use

unique crane
slate flume
#

But I want this to work continuously (e.g. if a player holds M1, it returns true while the player is holding M1)

unique crane
#

I think the firing is just handled as requests from the player

celest thorn
#

wait

#

the

celest thorn
#

action module

#

is default

#

the revolver has no

unique crane
#

You cant 100% say they are holding down the LMB

celest thorn
#

Yea

slate flume
unique crane
#

or just click

celest thorn
#

tbh i think its way impossible

slate flume
#

You guys are misinterpreting my point

unique crane
#

Might be just client thing

#

let me see

slate flume
celest thorn
#

David might save the day

#

like always

#

goated individual

slate flume
#

It works with everything except Revolver cause it's dogshit

celest thorn
#

why are you even doing that^

#

custom guns?

slate flume
#

Yes

#

I want my code to be accurate

celest thorn
#

there are alot of mysterys in the sl source code

#

that i do wonder if it evolves by itself

#

or real humans type it

#

but yea wait for david

#

maybe he could save your soul

celest thorn
#

tbh we need an event like that it would be really cool

unique crane
#

yeah this is client side

slate flume
#

What is

unique crane
#

your only getting the "oh hey im starting to pull the trigger"

celest thorn
#

you got your answer

unique crane
#

"i want to shoot pls"

celest thorn
#

PLZZZZ LET ME SHOOT

#

type of shit

unique crane
#

server only checks if its in timely manner

celest thorn
#

maybe a suggestion to make it an event

slate flume
#

I hate that every other gun works except revolver

celest thorn
#

could be cool

unique crane
#

The only time you can control this is when you have dummy

slate flume
celest thorn
#

something like

#

"Held or no"

#

like idk how to explain it

#

but something specific for the revolver holding

slate flume
#

I mean I can already essentially check that for everything except revolver

#

Revolver is just bad

unique crane
#

idk how the revolver pull really works

celest thorn
#

enlight us

slate flume
#

Is it a client lag thing

#

Latency-type stuff?

celest thorn
unique crane
#

that wouldnt be latency

#

message gets send to everyone

#

so I guess host hub too

slate flume
#

Huh?

#

I don't understand that

#

How does that mean it's not latency

unique crane
#

idk

celest thorn
#

At nw please make better internet by inventing light speed internet

unique crane
#

eletricity kinda do be fast

slate flume
slate flume
celest thorn
unique crane
#

Universe update 3

#

Buffed electricity

#

Nerfed neutron stars

#

Fixed bug where stars would randomly explode after a while

celest thorn
#

fixed brain

#

it doesn't work anymore

upper vapor
slate flume
upper vapor
#

Muh electrons 096_why

celest thorn
#

average developer working on the Universe

#

imagine if thats true

#

and we are actually just a bug

#

btw does anyone know when i click round restart on the RA will it do the command round restart?

#

or what

celest thorn
#

ok because exiled has a lovely problem ig

#

on handling that

#

im gonna patch it and make it trigger it

unique crane
#

Whats thats not my problem then XD

celest thorn
#

True

#

not mine either

upper vapor
waxen kayak
#

i want to know

#

how much time we need for next version

#

and allow me change SubtitleCategory._speakerName

#

my server s players hate Emergency Door Button so i made this [HarmonyPatch(typeof(EmergencyDoorRelease))] public static class EmergencyDoorReleasePatch { [HarmonyPatch("ServerInteract")] [HarmonyPrefix] public static bool Prefix() { return false; } }

upper vapor
#

you gotta use TMPro magic (for now at least)

celest thorn
#

make a client and your own sl centrals

#

(probably would get taken down for eula violation)

restive turret
#

And also there is a issue/idea on git and it got imported

slate flume
#

I HATE REVOLVERSSSS

#

I made this whole shooting cache thing before realizing that the only way to know if a revolver is in the middle of a dry fire is to log the chamber state before firing and store that, which means I need to rewrite this again

upper vapor
#

you're cooked

slate flume
#

Did Hubert code Revolver?

#

Whoever did was smoking something dude

#

I'm ultra-cooked

#

Everything works so nice except revolver

#

Okay but I did finally get it cause I'm awesome

#

Revolver shenanigans mean guns register as firing for like 2 frames after they're done firing, but I figure that's fine because it also means lag compensation is accounted for

#

I was just reminded

#

That there's GeneralDamageHandler, StandardDamageHandler, UniversalDamageHandler, and DamageHandlerBase

#

Why?

#

Uhhhhhhhhh

#

...

upper vapor
#

brilliant question

slate flume
next jungle
next jungle
#

just to be used by a single weapon

slate flume
#

It took me like 5 minutes to make it for every gun in the game besides Revolver

#

Revolver is what made me take over an hour

next jungle
#

sounds about right

slate flume
#

One of those isn't a DamageHandler

#

No fucking lie

next jungle
#

-# what

slate flume
#

GeneralDamageHandler handles achievements lmao

#

I mean you can see why it was named that
But also shitty name choice

waxen kayak
restive turret
#

Imported does not mean it is done or is in the next release

#

You can read the labels description btw

#

It should give more info

waxen kayak
#

nooooooooo

celest thorn
#

@serene vine

restive turret
#

@serene vine banish this guy

celest thorn
#

bread

#

WAIT ITS MR BREAST

slate flume
#

Mods, kill this man

celest thorn
#

PLEASEEEE MR BREAST GIVE ME A GAZZILION MONEY

#

PLEAAASSEEEE

restive turret
celest thorn
#

im gonna 100% send you my last money

celest thorn
#

How tf people fall for this shit

#

is so funny

celest thorn
#

Fun fact

restive turret
# waxen kayak nooooooooo

Imported only means it got added to our imported suggestions.
When the idea got accepted or denied u get a new label

celest thorn
#

the url doesn't work

#

so this scam is not gonna work

slate flume
#

That's wild

celest thorn
#

bro doesn't even update their own scam url

#

like lol

slate flume
#

I'm guessing they probably hard-coded the malware to send those images and can't even update it lmao

serene vine
serene vine
#

Sorry, discord no noti

celest thorn
#

in alot of channel

#

it spammed

#

so go check them all

serene vine
#

I have a lot of channels on hidden

slate flume
#

I literally had the same scam post happen in my server earlier today

serene vine
upper pike
celest thorn
#

I've pinged some of them

#

and art showcase too

serene vine
#

Okay, so the softban thing works the way I thought

slate flume
#

Should've pinged Hubert to take care of it

serene vine
#

All gone, in one message.

serene vine
#

(That would take years)

sinful bronze
#

(fail)

restive turret
#

Every month I see the fast inverse square root quake 3 video pop-up in my yt feed

celest thorn
# restive turret Every month I see the fast inverse square root quake 3 video pop-up in my yt fee...
float Q_rsqrt( float number )
{
    long i;
    float x2, y;
    const float threehalfs = 1.5F;

    x2 = number * 0.5F;
    y  = number;
    i  = * ( long * ) &y;                       // evil floating point bit level hacking
    i  = 0x5f3759df - ( i >> 1 );               // what the fuck?
    y  = * ( float * ) &i;
    y  = y * ( threehalfs - ( x2 * y * y ) );   // 1st iteration
//    y  = y * ( threehalfs - ( x2 * y * y ) );   // 2nd iteration, this can be removed

    return y;
}
waxen kayak
tulip kiln
thin shuttle
thin shuttle
waxen kayak
#

exiled dont have it and i dont want to use labapi(long long namespace)

static meteor
waxen kayak
#

i made it in 2 hours after update

upper vapor
thin shuttle
#

But not 2hours

#

I just check the event was there at first release

#

Of the update

thin shuttle
#

I believe

waxen kayak
#

because

#

long long namespacw

#

LabApi.Events.Handlers.PlayerEvents.

upper vapor
#

It's not that bad

#

Also

#

Using statement

#

like your IDE can't auto-import or something?

icy knoll
#

exiled is the same length btw

hearty shard
hearty shard
#

since Exiled is Player.cs and not PlayerEvents.cs

waxen kayak
#

but im lazy~

hearty shard
#

idk why we're complaining about 6 letters though

upper vapor
icy knoll
#

complaining about 6 letters is crazy

restive turret
#

atleast you not coding on paper

hearty shard
#

wait

upper vapor
#

Type "PlayerEv" then enter

hearty shard
#

thats the class

upper vapor
#

Boom

hearty shard
#

not even the namespace

upper vapor
#

Plus

hearty shard
#

+6 letters for class not namespace, lumi was correct about it being same

upper vapor
#

CustomEventsHandler exists

hearty shard
#

so like

#

the real excuse is "i dont wanna use labapi because i like exiled"

upper vapor
#

DetectEve

hearty shard
#

Lmao

icy knoll
#

people complain about anything

hearty shard
#

i genuinely thought it was 6 letter complaint, but its 0 letter complaint

unique crane
#

Low quality rage bait

upper vapor
restive turret
#

atp dont write code cus you will refactor 1 minute later

hearty shard
#

lel

#

oh em gee whats up besties

slate flume
#

I'm much faster typing than I am writing so it was painful whenever I had to do it
It's nice when my hands can somewhat keep up with what my brain is thinking

true arch
#

i code in notepad

thin shuttle
#

yeah it's exactly same number of letter

#

clearly namespace are fine for LabAPI

#

and even if it's was 10 letter more i wouldn't care

slate flume
upper vapor
upper vapor
unique crane
#

We love namespaces!

#

We shall make them 255 chars long

upper vapor
#

Lab.Api.LabApi.Northwood.SecretLaboratory.SecretLab.PluginFramework.OfficialPluginFramework.OfficialSecretLaboratoryApplicationProgrammingInterface.Events.LabApiEvents.SecretLabEvents

#

not sure if that's >= 255 chars

restive turret
#

More

hearty shard
#

guh

restive turret
#

I can say by looking at it

upper vapor
#

183 chars only :(

hearty shard
#

now thats a unique trait

upper vapor
#

-# eye speaker

hearty shard
#

bro

#

i am so cold

restive turret
hearty shard
#

i regret going outside :(

upper vapor
#

cuddles

restive turret
#

Get hugs from yo gf then

upper vapor
hearty shard
upper vapor
#

split the ocean

#

be the next Moses

hearty shard
#

yk what thats a valid point

#

didnt think of that one

upper vapor
#

Moshes

hearty shard
#

...

#

lumi....

upper vapor
hearty shard
#

why r u like this

icy knoll
hearty shard
#

ALMOST VALENTINESSSSS

#

5 hours

#

or 6 if ur british

#

or like

#

11-14 if ur in the US

upper vapor
hearty shard
#

idk the other timezones and thus i dont acknowledge them

upper pike
#

Happy Valentines to every single person out there

hearty shard
hearty shard
#

get out

restive turret
upper vapor
worn gull
restive turret
thin shuttle
restive turret
#

huh

warped prairie
#

yes

hearty shard
#

chats

humble haven
#

Is it true that you are reopening the servers for version 11.0?

restive turret
#

me?

humble haven
#

in general

#

sorry but i don't speak english

#

:D

celest thorn
humble haven
humble haven
celest thorn
humble haven
#

So all the old versions?

celest thorn
humble haven
#

I apologize for my poor understanding of the text

#

:(

humble haven
celest thorn
humble haven
#

okk thank you

slate flume
#

@restive turret remember the BarrelTipExtension and how it sometimes fails?

Apparently, it's possible that occasionally a weapon doesn't register its world model to FirearmWorldmodel.Instances

Not sure why that can happen

slate flume
#

Also why isn't the cooldown in the LabAPI ChangingSubmersionEvent

#

Guess I'm making another transpiler

soft depot
#

cant you just trigger a cooldown from the event or no?

slate flume
#

I would have to do some BS like
((Scp106Role)ev.Player.RoleBase)._sinkholeCtrl._submergeCooldown.Trigger(10);
When they could just include it as a variable in the event like they do with SCP-096 Scp096EnragingEvent

upper vapor
slate flume
#

It's the world model for players holding guns

#

That's the point of the firearmworldmodel and barreltipextension lmao

#

You know bullet tracers? How else are they going to find where to start the tracer

upper vapor
#

right

upper vapor
#

also to FirearmWorldmodel.OnSetup

slate flume
#

I pointed it out to SlejmUr because it's a bug and we had discussed it prior

slate flume
#

It could be that in certain cases, the Identifier already matches, so that initial setup never runs

#

All Unlink does is make sure the current identifier is removed

restive turret
restive turret
celest thorn
#

Im surprised but i think i found a bug quite strange, i have a command that removes coins from my inventory

        player.RemoveItem(ItemType.Coin, n);

What happens is that when i have 2 coins and only 2 coins in my inventory then the plugin will just remove 1 coin and not the other

#

n = 2

#

but if i have 3 coins it works fine

#

it says my inventory is full

#

but my inventory is empty

#

amazing

restive turret
#

Huh

#

When does the removeitem has count

celest thorn
#

idk

#

since alot ig

celest thorn
#

i quite need a fix lol

upper vapor
#

that is all i can say

sinful bronze
#

lmao

celest thorn
upper vapor
#

player.Items.Where().Select(serial).Take().ToArray()

#

and remove by serial

sinful bronze
#

i trying to add to ammo item

#

with raycast

celest thorn
#

BY SERIAL???

sinful bronze
#

and me kicking sl ac

celest thorn
#

bro who tf you think I AM

sinful bronze
#

this is so

upper vapor
upper vapor
upper vapor
celest thorn
# upper vapor zer0two
        player.RemoveItem(ItemType.Coin, n);

        ItemType randomShopItem = itemTypes[UnityEngine.Random.Range(0, itemTypes.Count)];
        
        if (!player.IsInventoryFull)
            player.AddItem(randomShopItem);
        else
            Pickup.Create(randomShopItem, player.Position);

This is the full code maybe for something strange??

sinful bronze
#

i will try to check

upper vapor
#

crazy

celest thorn
#

so

#

whats the fix

upper vapor
#

okay who wrote that RemoveItem method

celest thorn
restive turret
#

Git blame

sinful bronze
upper vapor
#

tryna git blame but github is fucking stupid

upper vapor
#

remove each

celest thorn
upper vapor
#

make an issue ig

restive turret
#

Ax will fix it

celest thorn
upper vapor
#

i gave you the fix

#

and you jut

celest thorn
#

bruh

upper vapor
#

have no eyes iog

restive turret
#

Itnore

celest thorn
#

My optimization

upper vapor
#

can't see the big yellow highlighted message

restive turret
#

Optimize deez nuts

celest thorn
restive turret
#

Np

#

You can write your own remove item then

#

Tbh most efficient is the linq one

celest thorn
#

Wait

#

but does player.Items have a set?

#
player.Items.Where(x => x.Type == ItemType.Coin).Take(n).ToArray();
upper vapor
celest thorn
#

If you take items and then the items aren't cleaned??

upper vapor
#

you do toarray

#

then foreach and remove

celest thorn
#

what?

#

im more confused

#

than anything ngl

upper vapor
restive turret
#

The Items is an IEnumerator

upper vapor
#

you have to store the items you want to remove

#

and then loop over it

#

loop over an array

#

remove each one from the inventory

celest thorn
#
        foreach (Item item in player.Items.Where(x => x.Type == ItemType.Coin).Take(n).ToArray())
        {
            player.RemoveItem(item);
        }
upper vapor
celest thorn
#

so like this

celest thorn
restive turret
#

You can also add listpool if u wanna optimize it more ClassDTrollHD

celest thorn
#

a bit of ram

#

usage

#

will not be bad

#

he has A SHIT TON of ram

#

so a bit of killobytes more wouldn't be a problem

restive turret
#

You slowly becoming ax who eats ram

celest thorn
upper vapor
#

mega troll

celest thorn
#

starves instead

restive turret
#

Cus atoh is offline

celest thorn
#

wait i forgot now its COokies tower of hell

celest thorn
celest thorn
#

Cross and midnightcooxies are hosting it trolling

#

they liked it alot ig

#

if you search on the list Towers

#

its the first one

#

yea btw it works

upper vapor
#

erm actually you could optimize it even more

#

with 1 keyword

restive turret
#

Tbh I would just copy paste this to labapi

restive turret
upper vapor
upper vapor
#

we have to see some benchmarks

celest thorn
#

benchmarking one method is crazy

restive turret
upper vapor
celest thorn
upper vapor
#

nobody does benchmarks

#

on one method

#

EVER

celest thorn
#

next time im gonna find a remote unknown error on labapi

#

im gonna send this

upper vapor
#

bug we have a developer

celest thorn
restive turret
#

Not like you make mistakes

celest thorn
restive turret
#

Khmm

#

Wrong writing values

upper vapor
wary gust
#

Is there a way to check if a Firearm is being reloaded?

wary gust
upper vapor
#

you probably have to look at the animation state

wary gust
wary gust
upper vapor
#

actually

#

IReloaderModule.IsReloading

#

crazy ik

restive turret
#

U r crazy

upper vapor
#

i know

#

thank you very much

restive turret
#

Same

#

Np

upper vapor
wary gust
upper vapor
#

i just closed the solutoin

#

okay

#

there should be an IsBusy property on modules

#

which use IsReloadingOrUnloading

celest thorn
#

I love decompiledSL

upper vapor
wary gust
#

(it doesn't rn)

upper vapor
#

yeah it probably should

wary gust
upper vapor
#

ye feel free to do taht

wary gust
upper vapor
#

yes ofc

wary gust
restive turret
#

is there a dev branch?

wary gust
#

TF this means

restive turret
#

there is no dev branch so yes you should target master

restive turret
wary gust
#

or do you guys not have that set up

sweet flax
#

They probably dont have actions since they use internal git

restive turret
#

no cus it would need to pull branch & sometimes we work on branches that isnt released

#

and since the master is protected only a few plp can push into it

wary gust
#

I just never saw Mergining is blocked is all.

restive turret
#

as david/beryl/ced who can as i think

wary gust
restive turret
#

usually squassed

wary gust
#

since I kinda did 2 changes where 1 might be unwanted

#

well worst case someone will tell me to open one with just 1 commit ig

restive turret
#

thats up to whoever merging it , im fine with it tbh

sweet flax
#

is there a way to force player to start using e.g medkit

#

and also i have seen smth like RightHandIK in thirdperson and is there a way to set players hand to x position

slate flume
#

Am I going to have to download and learn the Unity Editor in order to figure out NavMeshes cause I'm getting pissed off trying to figure out how to bake them with the API

unique crane
#

SL map is generally not compatible with nav meshes

upper vapor
vast canopy
#

How to check if player is continue shooting without coroutines?

upper vapor
#

enlighten them Kek

vast canopy
#

🐀

pale vector
#

I done the translating and config fixing, sorry for being late because I had other projects :)

slate flume
vast canopy
slate flume
#

If you want to reliably check if a player is continuously shooting, the only way is to use a component/coroutine

#

At least for some weapons

#

Some weapons work fine, but might fail if you don't compensate for lag

#

I personally use a five-frame buffer and check if an ActionModule is attached to the current item and if that ActionModule is busy
Then if 3/5 frames are busy, the player is continuously shooting
This means it takes 2 frames to register a shot, and the end of the shooting lags by two frames, but it works

#

Related follow-up, if anyone knows
How would one prevent a player from shooting

#

Is there a way to stop client prediction that you will shoot

#

Cause cancelling the ShootingWeapon event still plays the animation on the client

soft depot
#

idk it seems the client tells the server when it starts shooting, as well as when each bullet is fired

#

so it seems like the denying the Shooting event should stop the client from shooting

#

I guess if that doesn't work it's not possible (unless you disable the gun or something idk)

slate flume
#

At least not last time I tried

#

I doubt they updated it since then

tulip kiln
#

The only way I could prevent a client from shooting was fooling it that it has 0 available ammo

soft depot
#

hmmm

#

I also just realized

#

Shooting event is for particle disruptor

restive turret
soft depot
#

I think

#

no I'm just stupid

#

you can try ServerSendRejection in AutomaticActionModule though, idk

slate flume
#

I've seen servers implement charge rifles

#

Holding down M1 with an E11

#

I know it's possible, I just don't know how

#

There's gotta be a way to block firing for the client

slate flume
soft depot
#

¯_(ツ)_/¯

slate flume
#

I need to figure out how to block primary actions or firing

soft depot
#

I'm looking into making a patch rn

slate flume
#

I'm intrigued

soft depot
#

maybe SSS, idk

slate flume
#

I'm going to bump my original ask because we've talked for so long and had no progress

slate flume
unique crane
#

You will have to disable it before the player even attempts to shoot

#

It is not possible to cancel the shooting event on client as it is done so you dont need to wait for your ping to see the effects

slate flume
#

I FUCKING FOUND THE CLIP

sweet flax
unique crane
#

^

#

most likely yea

sweet flax
#

or the round is not chamberd

unique crane
#
  • SSS
#

100% this

slate flume
#

Okay so it's a dry firing thing

unique crane
#

You can hear the dry fire sound

soft depot
slate flume
#

I found the clip literally a minute ago

sweet flax
slate flume
slate flume
slate flume
soft depot
#

I thought you were talking like you tried it in person lol

#

if you said "I saw a clip of a charge rifle" I woulda known

#

anyways

slate flume
#

My bad homie

soft depot
#

it's 100% dryfiring

#

it just makes more sense

soft depot
#

cuz no SSS

slate flume
#

I'm stealing the charge rifle idea cause it's goated

unique crane
#

ive seen cooler custom guns stuff

restive turret
#

P90?

unique crane
#

no

soft depot
sweet flax
soft depot
#

you can use SSS for it

#

but dry firing is just easier

sweet flax
soft depot
#

true...

sweet flax
#

it looks like super duper harmony transpiler time if no sss

slate flume
celest thorn
#

I LOVE TRANSPILERS

sweet flax
#

i love harmony il code error

vast canopy
celest thorn
sweet flax
celest thorn
#

its red

#

trust me

#

Harmony wants you

vast canopy
#

The only red thing after some transpiler patching are eyes

sweet flax
#

i use logger.error instead of logger.debug cuz im too lazy to enable debug in config

vast canopy
#

Cause.. Yes..

celest thorn
#

true me too

celest thorn
#

they are SOOOO CUTEEEE

slate flume
hearty shard
#

YOU

slate flume
#

I already have it working and everything, it adds an extension to the Player to check IsShooting boolean

slate flume
hearty shard
#

hello!!!

slate flume
#

Hi!

hearty shard
#

it is I

#

the now lonely eve

hearty shard
#

because my gf went to zzzz

#

and this is a very sad time

vast canopy
celest thorn
#

guys we don't need a new SCP to the game we need rats

#

RatToy

slate flume
#

Checking if a player is shooting is not an intensive task

#

The modules are cached on the firearm so there's no expensive components calls or anything

soft depot
#

guys can we perchance get a check on whether the parent of cachedTransform is a network identity here? (cuz without it, if you parent your admin toys to non-net identity game objects, your position sync will be messed up)

celest thorn
vast canopy
# slate flume How so?

I got dictionary which updates on player shooting event and i just wanted clear it if player stop shooting. If i will place this extension in event it will create 2 many coroutines i think..

soft depot
#

I guess I can transpile that in

celest thorn
#

a lovely prefix

#

works too

slate flume
celest thorn
#

they would do the same exact thing

slate flume
vast canopy
slate flume
#

It's a component on the player

#

It caches the last 4 frames (+current) to see if a player is continuously firing

#

I cache those components and check them when needed

#

No coroutines

vast canopy
slate flume
#

All good

#

I can send it to you later, I have to get groceries

vast canopy
#

And i have to go sleep i guess.. So yeah. Gn everyone

#

It was a close call

celest thorn
#

we all love rats

slate flume
soft depot
#

here's the patch I cooked up for anyone curious:

    [HarmonyPatch]
    public class UpdatePositionServerImprovement
    {
        private static readonly HashSet<AdminToyBase> HasNetParent = [];

        [HarmonyPatch(typeof(AdminToyBase), nameof(AdminToyBase.UpdatePositionServer))]
        public static bool Prefix(AdminToyBase __instance)
        {
            Transform cachedTransform = __instance.CachedTransform;
            Vector3 pos;
            Quaternion rot;

            if (HasNetParent.Contains(__instance))
                cachedTransform.GetLocalPositionAndRotation(out pos, out rot);
            else
                cachedTransform.GetPositionAndRotation(out pos, out rot);

            __instance.NetworkPosition = pos;
            __instance.NetworkRotation = rot;
            __instance.NetworkScale = cachedTransform.localScale;

            return false;
        }

        [HarmonyPatch(typeof(AdminToyBase), nameof(AdminToyBase.ServerParentId))]
        public static void Postfix(AdminToyBase __instance, uint __result)
        {
            if (__result != 0)
                HasNetParent.Add(__instance);
            else
                HasNetParent.Remove(__instance);
        }
    }
sweet flax
#

why no trasnpiler?

soft depot
#

too lazy

sweet flax
#

im kidding

#

it would probably take twice this long

#

or maybe more

#

and more thinking

soft depot
#

hey isnt this literally the same as a List<int> because it's a reference type?

unique crane
#

Ref is kinda a pointer wrapper in c#

slate flume
unique crane
#

Passing ref List<int> into a method and then assigning it to another list will change the original one aswell

slate flume
#

I know pathfinding is possible, I'm just hoping I don't have to make a manual grid/nodes

harsh thorn
unique crane
#

Barotrauma-ish solution would be the best

harsh thorn
#

navmesh can work, i did it before
but it requires knowing exactly how navmesh work so you know what parameters for generation to tweak

unique crane
#

with predefined paths for each room

harsh thorn
slate flume
#

Took a lot of tweaking and some filtering

unique crane
#

Afaik if you want to use navmesh

#

you gotta scale down the agents

#

A lot

#

There is thread in NWAPI discord somewhere Kek

harsh thorn
#

iirc i ended up patching some unity method to change agent settings

slate flume
harsh thorn
#

as you couldnt do it at runtime

#

and some agent size changing (not the object, but the setting)

slate flume
#

So is the best method repurposing navmesh or should I make my own system

harsh thorn
#

well, idk if you have this issue
but i had an issue where some classes were somehow unable to move through doors (except 173)

#

but im not sure if this is even navmesh related or not

unique crane
#

Depends what you want to do

#

Do you want complex NPCs that can use doors and elevators and such?

#

or just temporary path finding

slate flume
#

Generally speaking

harsh thorn
#

cuz itd be separate from the actual navigation

#

if you can get an NPC to move from A to B then thats already a lot of the work done

unique crane
#

fair

slate flume
#

^

harsh thorn
#

elevator/door logic you'd just do using some kind of statemachine

#

eg move to elevator, call it, wait, go inside, etc

slate flume
#

I mean so far for doors I've just been raycasting and if it's in the way, open and delay

harsh thorn
#

yeah thats what i did

slate flume
#

It's worked fine enough so far

harsh thorn
#

just see whats infront of the npc and do something with it

unique crane
#

Sounds good

slate flume
#

But I need to figure out the actual pathfinding for NPCs

slate flume
harsh thorn
#

but movement is tricky
navmesh is simple but it only works in a specific part and idk how to make that work, ididnt bother figuring it out as i got distracted with other projects

its hard to make navmesh work as its typically designed to be used in the editor where you can.. change the objects and such

slate flume
#

I mean I could wing it with my own system but that might take a while
If that's the best option tho I don't mind doing it

harsh thorn
#

so you could either try to export the rooms and spin up a unity project, and use the visual tools unity gives you to see what the issues are, and try some navmesh component tools or manual collider creation to fix issues with it

or just map out a grid of dots in each room, and pathfind between these dots

unique crane
#

Generally what I remember what were the issues:

  • Ignore doors during baking
  • Make agent scale much smaller as otherwise they wont be able to walk through doors
  • Somehow get rid of the inactive room connectors in HCZ as all of them are accounted into the navmesh
slate flume
harsh thorn
slate flume
harsh thorn
#

navmesh actually sees colliders set as trigger but on the default layer as obstacle

#

atleast from when i used it on a different project

slate flume
harsh thorn
#

yeah that works

#

i think you might be able to dynamically build the navigation grid some way
(or you want to place them throught rooms lol)

#

but multifloor rooms may be more complicated

slate flume
#

I pretty much solved every problem by carefully choosing colliders/meshes
Got essentially all of LCZ working
The problem is that no matter what settings or tweaks I made, it didn't work in every room
My tests failed in about 1/5 of rooms

unique crane
#

What tests

slate flume
#

I summon points and see if it detects a navmesh within a certain distance

#

Worked 100% of the time for me to detect if a room was broken or not

unique crane
#

Broken as like its a seperate area they cant walk into or..

slate flume
#

Broken as in you can't pathfind in that room

unique crane
#

Oh well

slate flume
#

As in the navmesh doesn't work or didn't bake properly

#

Because the points can't find a navmesh in the room

#

The test isn't that complicated but it tells you all you need to know

slate flume
#

It means the navmesh is broken

#

Idk how else I'm supposed to state it

#

Doesn't detect navmesh = broken

unique crane
#

Yeah man I get it now

harsh thorn
#

tbh idk why navmesh was broken in some rooms
the only way to actually find it is putting the room into the unity editor with the navmesh tools on it, so you can actually use the navmesh tools kek

slate flume
slate flume
#

Thanks for your guys' help

#

I'll look into some alternatives later

#

I've implemented A* before, the hard part is just going to be getting the data for it

harsh thorn
#

easiest may be something like a* (point based nav) yeah
getting the data, idk tbh
maybe try getting the names of all the floor colliders and use that kek
but that doenst solve multifloored rooms

unique crane
#

Manually done main paths for each room

#

if you just dots connected

slate flume
#

Worst comes to worse. I've got some items I use to log position data, so I can repurpose that to make manual pathing

harsh thorn
#

i mean what you could do is generate each point automatically and just "remove" all the invalid dots and save the rest

#

but that seems tedious outside of unity

#

unless you wanna go around the game shooting primitives with a "toolgun"

slate flume
#

I'm not afraid of a little manual labor

#

I'll probably be doing some combination manual and automatic systems

#

Like getting a basic path for a room and then just deviating off of that path to get to different areas
That kind of thing

restive turret
#

@hearty shard

sacred sierra
#

is there any reason why BoxCollider OnTrigger thingy can work perfectly on PrimitiveType.Plane primitive but at the same time not work at all on PrimitiveType.Cube one

barren pasture
#

How do I make a player shit their pants?

restive turret
#

Spawn a trantum on their position

crimson dune
#

you could use the brown candy prefab

restive turret
#

Isn't that available or shown only at holidays

crimson dune
#

its in network client prefabs

hearty shard
#

Guh.

#

i think nw needs to hire janitors

#

@restive turret you

#

Ur a janitor now

#

Get to mopping

restive turret
#

Nuh uh

restive turret
crimson dune
#

yeah so is the prismatic thing

restive turret
#

🔥

crimson dune
#

though the effect is non existent so it does nothing

slate flume
crimson dune
#

rainbow tower :)

slate flume
#

What prefab are you spawning

#

And why is it so many colors

crimson dune
#

cause its the prismatic cloud prefab

slate flume
#

Ahhh interesting

#

Didn't know that existed

crimson dune
#

PrismaticCloud

#

exact name

slate flume
#

Damn I'll have to go through the prefabs sometime that is mad cool

crimson dune
#

PrismaticCloud
SnowPoop – TantrumObj
TantrumObj (Brown Candy)

#

those are the holiday exclusive ones that are still in the game year round

burnt hearth
#

(literally)

soft depot
upper vapor
#

we could use the OnTransformParentChanged unity event though

soft depot
#

Add an instance bool that’s set by the parent thing

#

That’s what I basically did with my patches

upper vapor
#

it could be easily solved by removing waypoints

celest thorn
upper vapor
#

?????,,

#

mb for the typo bruh

upper vapor
#

from

#

/?

celest thorn
dusk tangle
#

Is there any way to reduce the time in ObjectiveCompletionMessage?

celest thorn
#

and btw you cannot create your own

#

they need to be synced to the client

slate flume
#

This is actually true

#

Wow I forgot I was scrolling through old chat logs

#

My bad

#

That's like 3 months old

dusk tangle
celest thorn
#

the only thing the server sends is an Int related to the index of that message

dusk tangle
#

ok thxSteamHappy

unique crane
#

We Objective completing event

#

With setters

#

Oh

#

Time it displays

#

Nop not that

#

Though you mean time it reduces

dusk tangle
#

yes

celest thorn
#

to change the text

#

the ObjectiveCompleteMessage has just an Index

unique crane
#

But you can change the influence and time

#

And team

celest thorn
#

yea

celest thorn
#

how is the skybox handled?

#

like the skybox is a Fogtype?

#

or just a dome

restive turret
unique crane
celest thorn
#

oh thats so sad

#

it would've been cool asf

#

to have a skybox effect or something

#

the great void on atoh makes me sad

restive turret
# celest thorn what

You can in server but for client you need to send the one that is already existing

upper vapor
celest thorn
#

i have a crazy question

#

nah nvm

#

i forgot mirror is safe asf and wouldn't allow for something like that

upper vapor
#

(un)fortunately it doesn't allow you to overthrow the governmeownt

celest thorn
#

i wanted to make that when it sends the message for redirecting

#

then the client would send back a message where it said like "plz teleport to this"

#

and internally on the server handled

#

for doing something specific like a sort of additional message

thin shuttle
#

why l^ k i"ke

#

is ban

#

lol

#

remove the space and special char

wary gust
#

Sorry to bother you but what does your SerializeObject function look like?

ashen hound
#
    static ArraySegment<byte> SerializeObject(NetworkBehaviour nb, Action<NetworkWriter> syncvarSerialize)
    {
        using (NetworkWriterPooled writer = NetworkWriterPool.Get())
        {
            ulong objectDirtyBit = 0;

            ulong behaviorBit = 1UL << (nb.ComponentIndex & 31);

            objectDirtyBit |= behaviorBit;

            if (objectDirtyBit != 0)
                Compression.CompressVarUInt(writer, objectDirtyBit);

            using (NetworkWriterPooled writerTemp = NetworkWriterPool.Get())
            {
                SerializeComponent(writerTemp, nb, syncvarSerialize);

                ArraySegment<byte> segment = writerTemp.ToArraySegment();
                writer.WriteBytes(segment.Array, segment.Offset, segment.Count);
            }

            return writer.ToArraySegment();
        }
    }

    static void SerializeComponent(NetworkWriter writer, NetworkBehaviour nb, Action<NetworkWriter> syncvarSerialize)
    {
        int headerPosition = writer.Position;
        writer.WriteByte(0);

        int contentPosition = writer.Position;
        try
        {
            writer.WriteULong(0);
            syncvarSerialize?.Invoke(writer);
        }
        catch (Exception e)
        {
            Logger.Error($"OnSerialize failed\n{e}");
        }

        int endPosition = writer.Position;
        writer.Position = headerPosition;

        int size = endPosition - contentPosition;
        byte safety = (byte)(size & 0xFF);

        writer.WriteByte(safety);
        writer.Position = endPosition;
    }```
upper vapor
restive turret
#

Using keyword should generate a Dispose call the end of it

upper vapor
#

yes, the problem is that they're using data from a writer that's been disposed

wary gust
icy knoll
#

can we normalise not returning pooled classes

upper vapor
upper vapor
#

you should send the data before the writer is disposed

ashen hound
#

what really happens it wont get GC but only after send is done

wary gust
upper vapor
ashen hound
#

idk wheres issue when Im creating new ToArraySegment from it soo networkWritePool is returned to pool

upper vapor
#

ToArraySegment just references the backing array

#

so mirror named it wrong

#

it should be AsArraySegment cuz it's not creating a copy

wary gust
# upper vapor you should send the data before the writer is disposed
public static void SendTextToyRotation(this TextToy toy, Player player, Quaternion rotation)
{
    var pooledWriter = ObjectSerializer.SerializeObject(toy.Base, (writer) =>
    {
        // Dirty Bit
        // Rotation = 2
        ulong dirtyBit = 2;

        writer.WriteULong(dirtyBit);
        writer.WriteQuaternion(rotation);
    });
    
    var message = new EntityStateMessage()
    {
        netId = toy.Base.netId,
        payload = pooledWriter.ToArraySegment()
    };

    player.Connection.Send(message);
    
    pooledWriter.Dispose();
}
/// <summary>
/// All credit for this method goes to Killers0998.
/// </summary>
public static NetworkWriterPooled SerializeObject(NetworkBehaviour nb, Action<NetworkWriter> syncvarSerialize)
{
    NetworkWriterPooled writer = NetworkWriterPool.Get();
    ulong objectDirtyBit = 0;

    ulong behaviorBit = 1UL << (nb.ComponentIndex & 31);

    objectDirtyBit |= behaviorBit;

    if (objectDirtyBit != 0)
        Compression.CompressVarUInt(writer, objectDirtyBit);

    using (NetworkWriterPooled writerTemp = NetworkWriterPool.Get())
    {
        SerializeComponent(writerTemp, nb, syncvarSerialize);

        ArraySegment<byte> segment = writerTemp.ToArraySegment();
        writer.WriteBytes(segment.Array, segment.Offset, segment.Count);
    }

    return writer;
}
upper vapor
#

no need for dispose, use the using keyword

wary gust
upper vapor
#

but yeah other than that it looks fine

sweet flax
#

PlayerItemUsageEffectsApplyingEventArgs ev.IsAllowed = false;does not work for adrenaline / painkillers

icy knoll
celest thorn
#

How can i bypass the Idle mode for a specific coroutine

worn gull
celest thorn
#

nuh uh

upper vapor
#

or RealtimeUpdate

#

(the segment to run the coroutine in)

slate flume
#

That I think I posted earlier

#

Okay never mind I might not have posted it

#

The problem is that ItemUsageEffectsApplying event is in the wrong place

#

I made some harmony transpilers to move it

#
[HarmonyPatch]
public class MigrateItemUsageEffectsApplying
{
    [HarmonyPatch(typeof(UsableItemsController), nameof(UsableItemsController.Update))]
    public static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
    {
        var codeMatcher = new CodeMatcher(instructions, generator);
        
        codeMatcher.MatchStartForward(CodeMatch.WithOpcodes([OpCodes.Newobj], typeof(PlayerItemUsageEffectsApplyingEventArgs).GetConstructor([typeof(ReferenceHub), typeof(UsableItem)])))
            .MatchStartBackwards(CodeMatch.Calls(typeof(KeyValuePair<ReferenceHub, PlayerHandler>).PropertyGetter("Key")))
            .Advance(-1);
        int start = codeMatcher.Pos;
        codeMatcher.MatchStartForward(CodeMatch.Calls(typeof(UsableItem).Method(nameof(UsableItem.ServerOnUsingCompleted))))
            .Advance(-2)
            .RemoveInstructionsInRange(start, codeMatcher.Pos - 1);

        return codeMatcher.Instructions();
    }
    
    [HarmonyPatch(typeof(Consumable), nameof(Consumable.ActivateEffects))]
    public static bool Prefix(Consumable __instance)
    {
        PlayerItemUsageEffectsApplyingEventArgs ev = new PlayerItemUsageEffectsApplyingEventArgs(__instance.Owner, __instance);
        LabApi.Events.Handlers.PlayerEvents.OnItemUsageEffectsApplying(ev);
        if (ev.IsAllowed) return true;
        __instance._alreadyActivated = true;
        return false;
    }
}

Paste this somewhere in your codebase and it'll be working again

#

It kind of really sucks, it's not how I normally make transpilers, but I was losing my mind when I had to make this

#

Iirc it was literally the third LabAPI event I had to make a patch for that day

#

The gist of it is some shit about how the UsableItemsController is what is responsible for items completing their effect, but some items already have extra code that run for detection (e.g. if you holster the item and the effects haven't been applied, apply the effects)
I moved the event to the actual application of effects for Consumables (as it should be) and I've had no issues since

#

If you encounter a problem with that code lmk cause I'd want to fix my stuff too

celest thorn
#
            heartbeatHandle = Timing.RunCoroutine(HeartbeatLoop(), Segment.FixedUpdate);

tbh i did this but nope

upper vapor
#

can we pin this guy

#

i mean

#

that guy

slate flume
#

🔥

#

It was odd finding that out

sweet flax
celest thorn
#

and then it will be done

#

btw the #triangleupdate movement is growing

slate flume
# slate flume It was odd finding that out

I kept having consumable custom items where, if interrupted, they would give the base effects and not the custom effects I wanted
I went down a rabbit hole and figured all this stuff out as a result
It's really some odd stuff, and I'm not sure why it wasn't implemented like this in the first place

#

Like I had painkillers that make you blow up and they would get used, 3114 would strangle the player right before it ends, and it would cause the base painkillers to work and not the explosion

celest thorn
#

@upper vapor btw the Segment.UpdateFix doesn't work

#

Timing.RunCoroutine(HeartbeatLoop(), Segment.FixedUpdate);

#

still gets lowered

celest thorn
upper vapor
upper vapor
#

i have no idea when the next patch comes out

slate flume
celest thorn
slate flume
#

Didn't Paisley come out with a plugin fixing that?

upper vapor
#

just fucking restart

celest thorn
#

Oh it works

#

lol

upper vapor
#

you can also solve it by not having a server

celest thorn
#

im pretty sure

celest thorn
#

im crying

#

YESSS

#

IT SAID IT

sweet flax
soft depot