#plugins-dev-chat

1 messages · Page 46 of 1

upper vapor
#

that includes players

#

create a cachedlayermask with the layers in that except Hitbox

grand flower
#

so default, glass, cctv, door

upper vapor
#

ye

#

idk

grand flower
#

okay I can't for the life of me get the boxcast to detect some simple stairs above 096

#
        var center = Player.Position;
        var halfExtents = new Vector3(0.1f, scale.y, 0.1f);
        if (Physics.BoxCast(center, halfExtents, Vector3.up, out var hit, Quaternion.identity, 0.1f, ScaleMask))
#

wouldn't this be enough

icy knoll
#

bro

grand flower
#

increasing distance to 1.0f worked

#

oh well

upper vapor
#

bru

unique crane
#

That would be nice

grand flower
#

wait nvm im stupid

#

BoxCast doesn't return anything already colliding with it

#

Do player prefabs really not have a capsule collider for simple collision?

upper vapor
grand flower
#

how do you access it

upper vapor
#

the fpcmodule from IFpcRole maybe

grand flower
#

what am I looking for inside it

upper vapor
#

CharacterModelInstance

#

in fpmm

grand flower
#

I meant inside that

upper vapor
#

oh

#

hitboxes

#

those have colliders

#

TargetColliders

grand flower
#

so there's no like

#

collider that's used for movement

#

a capsule

#

oh there is

#

CharacterController

upper vapor
#

right

#

that works too

grand flower
#

yeah cause I can just cast upwards in the shape of the player collision

#

that's what I wanted to do so I don't grow into geometry

grand flower
#

worked perf

#

sweet

upper vapor
hearty shard
#

i did

#

but also a patch

#

Postfix

upper vapor
#

i realized

worthy rune
upper vapor
#

amplify it shrug

#

i'd take a look at the mixers

worthy rune
#

mixers are fine

upper vapor
#

isn't the volume down a bit?

worthy rune
#

also they are used for other stuff not just speaker toys

#

they had a 0db offset

upper vapor
#

bruh

#

maybe there should be a different mixer group fgor speakers

worthy rune
#

i can check again, but it has to be something in the code

restive turret
#

Must be the wind

upper vapor
#

😭

restive turret
#

The wind is -3db so

#

Packet is flew by the wind

upper vapor
#

what if we made the speaker decoder to amplify the audio by +3dB

upper vapor
restive turret
#

IP over Wind

restive turret
upper vapor
#

then you decrease its volume

restive turret
#

-Infinity

upper vapor
#

-0

restive turret
#

NaN

#

Not me accidentally setting HumeShield to float.NaN

#

I heard broke and repair infinite time

upper vapor
restive turret
#

Also sad that SL doesnt push mono exe / ELF so can compile it while the game running

grand flower
#

Just spawn multiple speakers with the same controller id to increase volume

restive turret
worthy rune
#

cant you just multiply the samples before for you send them, or is there a limit to that?

restive turret
#

And ofc its not getting from the ENV to get the path 😭

grand flower
#

Maybe, idk not my field

#

But also less processing to just have multiple speakers

#

With the same ID

restive turret
#

Spawning 255 speaker and playing the same voice

upper vapor
grand flower
#

You'd reach a point where it wouldn't matter long before 255 imo

restive turret
#

Spawn one to each peepoo

upper vapor
#

i don't want to waste resources decoding and encoding packets

worthy rune
restive turret
upper vapor
#

the issue is with volume onoly

worthy rune
#

i mean replicate the same effects like reverb

restive turret
#

Make a SyncVar for volume

worthy rune
#

volume could probably be fixed

upper vapor
restive turret
upper vapor
#

the speakers are affected by the reverb zone anyway

#

not exactly the way voice chat is but that's okay

upper vapor
restive turret
restive turret
upper vapor
#

what were you on about with the volume syncvar

#

that already exists for speakers
but it can't go above 1

grand flower
#

Whats the reason for that

upper vapor
#

unity

#

audiosource

grand flower
#

We love unity

royal mica
#

aww so you cannot metal pipe with 200 volume?

upper vapor
#

you can

icy knoll
upper vapor
#

later

#

in 2-24 business days

icy knoll
#

if you give me the github repo i can make some changes

#

like adding a translation or smth

upper vapor
#

i've added that :3

icy knoll
#

nice :3

#

what are the issues rn anyway?

restive turret
#

Everything

icy knoll
#

for rn tho you probably should just do the stuff on the server 😭

random scaffold
#

how can I create a wall through which it is possible to shoot?

icy knoll
random scaffold
#

and the ability to shoot at targets behind the wall

icy knoll
random scaffold
#

im know

icy knoll
#

that makes it invisible

icy knoll
#

i think

random scaffold
#

how?

icy knoll
random scaffold
#

but he will be collidable?

icy knoll
#

yes

icy knoll
#

how do I send a voice message to a user?

#

oh

#

found it

harsh thorn
#

it wont matter for the clients as it doesnt sync there, but the raycasts for shots should pass through

restive turret
#

how can I check if the gameobject is a pickup?

harsh thorn
#

otherwise youd need to TryGetComponent(out Pickup p)

random scaffold
#

how i can make smooth?

harsh thorn
#

make what smooth

random scaffold
#

animation

harsh thorn
#

like what is that animationgraph for

random scaffold
#

with one speed

harsh thorn
#

uh

#

think its just dragging the red bar to the middle of where you want it to be?

random scaffold
#

something from it

#

but im forgot what

random scaffold
#

-5 +5 -5

#

in a circle

harsh thorn
#

tbh im not that well known with animation graphs

icy knoll
#

would encoding for each player that may have different volumes cause any server issues or is it just decoding?

#

I decode the initial message only once, only modify and encode when a player has a different setting going on

#

is it bad to encode for every player?

#

like this:

restive turret
#

other than maybe wasting server resoursec idk

icy knoll
#

would you say there is a better method for smth like this or nah?

restive turret
#

but dont think you can set the volume to each player

#

if yknow a SyncVar would exists ClassDTroll1

restive turret
#

as said

#

since there is no volume slider for each player/entity stuff and especally the VoiceAdminToy doesnt have a syncvar for the volume just as a "non networked AudioSource component" dont think you can edit the volume to each player accordingly

icy knoll
#

it just grabs the setting for each player and sees if there is an existing msg

#

if not

#

make a new msg

#

and then pipe over whichever message over the connection

#

also i take it i use VoiceMessage over AudioMessage here?

hearty shard
#

AudioMessage i believe is speaker
VoiceMessage is a players voice

icy knoll
#

yeah thought so

#

never worked with structs before

restive turret
#

How

icy knoll
#

never needed to

#

never seen the reason to make them as well

restive turret
#

Useful for interacting with c/c++

unique crane
#

Datetime?

icy knoll
#

me when i thought those were classes

unique crane
#

Eeee

#

happens

upper vapor
icy knoll
#

so defo done thing wrong somewhere then

#

what's ur recommendation for this then?

upper vapor
#

Use multiple encoders

#

Cuz encoding with the same instance on the same frame really compresses audio for some reason

#

It makes the sound inaudible

#

-# I tested this one 1.5y ago

icy knoll
#

so create a new encoder for every instance in the loop?

upper vapor
#

Create a list of encoders and if there aren't enough, add a new one

icy knoll
#

wdym if there arent enough?

upper vapor
#

Also make the buffers static

upper vapor
#

List has 5 encoders

#

And you're sending to 6 players

#

Also, use GroupBy

icy knoll
#

how do i work out how many players use 1 encoder? by the volume they have set?

upper vapor
#

And you'll need to create another buffer for the amplified sound, this code aggregates volume

upper vapor
icy knoll
#

ur confusing me so much 😭

#

like

#

where do i use groupby

#

when do i create a new encoder instance

#

everything

#

nothing is making any sense

upper vapor
icy knoll
#

also make the encoders static?

upper vapor
icy knoll
upper vapor
#

Because you shouldn't re-allocate the encoder every time the event is called

icy knoll
#

also what would I even check for in the group by? group by the volume set or?

upper vapor
#

Opus is a native library so it's even more resource intensive compared to a "simple" managed constructor

icy knoll
#

im so confused 😭

#

which one should and shouldnt i do 😭

upper vapor
#

Okay so

#

Create a static list for the encoders
If the list has less than i encoders, add a new one, otherwise reuse the existing one
Increase i variable in the event handler per volume group

#

You can make the i variable anything

#

-# Duh

icy knoll
#

oh okie i get you

#

and how do i clear it after the intercom has stopped? 😭

upper vapor
#

Dispose elements

#

Clear list

icy knoll
#

well ofc

#

but how do i track if it stopped

#

i meant

upper vapor
#

Is there an event for that

#

Maybe I'm delulu

#

Surely there is...

icy knoll
#

i feel like this is very bloated now

#

is this what you consider optimal now?

upper vapor
#

Uh

#

Not sure if you need a dictionary for that

icy knoll
#

how else am i gunna grab the right encoder for the right volume 😭

upper vapor
#

No need for "right volume"
You can use any encoder that's available

upper vapor
#

That's quite the foreach lol

icy knoll
#

hey im just doing what you recommended

upper vapor
#

Yeah it's just you can break it up into multiple methods later

icy knoll
upper vapor
#

i++

icy knoll
#

where?

upper vapor
#

Make the dictionary a list and I++ at the end of the loop

#

Don't forget the bounds check

icy knoll
#

like check if the item exists or?

upper vapor
#

Count

#

check

icy knoll
#

still seems very long for this stuff i swear 😭

upper vapor
#

just extract it to a method and boom

#

GetOrAddEncoder or something

icy knoll
#

true

icy knoll
#

my guess is "Using" gets called before the person triggers the intercom, when is "Used" triggered? once they finish or once they start

#

this is the problem with these types of wordings sometimes 😭

icy knoll
#

thanks david

unique crane
#

No problem

hearty shard
#

david pls fix the game

unique crane
icy knoll
#

based david /j

restive turret
#

he already does that ClassDTroll

icy knoll
#

@upper vapor just found out smth

#

SendingVoiceMessage event during intercom uses the proximity channel

#

wtf

#

am i doing smth wrong 😭

grand flower
#

You can still hear in proximity

#

Must be another event for the intercom

#

Or some sort of special handling

hearty shard
#

so

icy knoll
#

there is using and used intercom

hearty shard
#

when ur in intercom

#

you get added

#

as the speaker

icy knoll
#

so like how do I tell if someone is talking on intercom or not

#

😭

hearty shard
#

Intercom._curSpeaker

#

or wtv

#

intercom has a method

icy knoll
#

i’ve practically given up now though

#

like

#

in testing

#

the slider setting didn’t work in some points

#

or i sounded terrible

#

so

unique crane
#

Ill like

#

figure this stupid role changed event thing

#

and make the speaker toy volume up to 200%

#

@icy knoll how about that

#

Will that be enough?

icy knoll
#

what 😭

unique crane
#

U said

#

You need to raise the speaker toy volume no?

icy knoll
#

no

#

probably was nameless TrollDespair

unique crane
#

Then what was the opus encoder thing all about

icy knoll
#

that’s what i’m doing

unique crane
#

Oooooh

icy knoll
#

game design doesn’t want that afaik

#

but my server members do

#

so

grand flower
#

why though

#

like

#

what's wrong with having an intercom slider, and even a CASSIE slider

restive turret
#

I want to control idiviual player voice

#

since some player loud af

#

some player is just barly hearable

random scaffold
#

someone big brain

#
// main assembly
public abstract class Shit
{
    internal void FuckIt() { }
}

public class Sto
{
    public Sto()
    {
        SecondaryShit test = new(); // magic ways for get class from other assembly like Assembly.GetAssemblies().Select(r => r.GetTypes()).Where(...);

        test.FuckIt(); // INACESSABLE ERROR WHY
    }
}

// other assembly
public class SecondaryShit : Shit
{
}

why it works so stupidly?

grand flower
#

internal's only accessible to the owning assembly

random scaffold
#

but its that

#

he : Shit

#

already

#

from main assembly

grand flower
#

wat

restive turret
#

make the internal to public

#

also what

#

idk what and how u want that

upper vapor
#

oh wait

#

this isuh

#

maybe vs is just dumb

#

oh wait

#

your type

#

is not

restive turret
#

maybe also read the error more carefully ClassDTroll1

upper vapor
#

SecondaryShit test = new();

#

why isn't it Shit test

random scaffold
random scaffold
upper vapor
#

cuz

#

internal

#

🤯

random scaffold
upper vapor
#

on a different assembly type

random scaffold
upper vapor
#

again

#

the test's type has to be Shit

#

you can create another local variable for it

random scaffold
#

its doesnt works code

#

check comments

upper vapor
#

cuz you didn't change it

restive turret
#

show the error then

random scaffold
restive turret
#

I dont get what you want or how

grand flower
#

Why are you censoring specifiers

restive turret
#

you cannot create a Cycrualr dependency

grand flower
#

Also yeah if you don't give us the exact stuff you're doing, it's not gonna help

random scaffold
#

why can't I call an internal method from a type from another assembly if another type inherits a type that is in the same assembly where the internal method is defined?

grand flower
#

You can't

#

That's not how it works

random scaffold
#

bruh

grand flower
#

If you wanna do that, do protected internal

#

me when I use the C# specifier that only makes it accessible to the defining assembly and then wonder why other assemblies can't use it

random scaffold
#

if there was logic, it would have worked

grand flower
#

no

#

internal is defining assembly only

#

protected is current & deriving classes only

#

protected internal is both these

#

Not a lack of logic, you just need to learn more about C# ^^

upper vapor
#

you can still have it internal only

#

but you have to make the variable's type to a type in the same assembly where you're calling it from

random scaffold
#

then need just (Shit)SecondaryShit?

#

and its will be possible call .FuckIt()

upper vapor
random scaffold
restive turret
#

Read how C# works then

grand flower
#

This just screams misuse/bad code

#

If you're getting all types from another assembly that derive from your base class

#

Why are you using the other assembly's type instead of your base class

#

the whole point is to use the base class and just call those methods

restive turret
#

you have to create a class with
(Shit)Activator.CreateInstance(Type)

grand flower
#

yup

random scaffold
grand flower
#

... and?

random scaffold
#

it dont must be in the same assembly

grand flower
#

ok... and what in my statements say same assembly

hearty shard
#

then have a protected or public virtual OnEnable() or wtv you need

#

and call that

grand flower
#

You have your base class in assembly A

hearty shard
grand flower
#

Assembly B has multiple classes that derive from base

#

In assembly A, get all types that derive from the base class in Assembly B, and do var module = (TheBaseClass)Activator.CreateInstance(type);

#

and now you call the methods in your base class

#

you don't reference assembly B at all

#

And if your base class has stuff like OnEnable() and all

#

These have to be protected

#

not internal

unique crane
#

@grand flower I almost have it but like there is some volume effect that just makes your screen black even after you reset role

#

Idk what it is or where it is

#

Disabling all volumes doesnt make it disappear

grand flower
#

We don't have it here thonkong

#

Did you do like

#

moving the PlayerChangedRole to Update()

#

because that works perfectly fine

unique crane
#

Well.. if you want it to call once

grand flower
#

No breakage whatsoever in our codebase and we use that event a lot

unique crane
#

When you change role multiple times a frame

random scaffold
grand flower
unique crane
#

No clue

grand flower
#

and I kinda feel like

#

it wouldn't matter

unique crane
#

I might just resort to that

grand flower
#

I don't think anybody does that

#

and even if you do, even if you "technically" changed role, it's not like it matters in the end, since you immediately overwrite it with another

#

(and if devs want to overwrite the role you're changing into, there's PlayerChangingRole for that)

grand flower
#

like actual code not obfuscated pseudocode

random scaffold
grand flower
#

Hey if you don't want help, suit yourself

random scaffold
#

but now im try do other so later

royal mica
#

Your pseudo code doesn't hide the constructor

random scaffold
royal mica
#

Also not sure what you want to do there

random scaffold
#

...

#

I'm already confused about the code

#

lol

royal mica
#

Also wait, your code is wrong

#

you created a circular dependency that cannot even build

grand flower
#

yeah we told them multiple times

random scaffold
grand flower
unique crane
#

Yep

random scaffold
#

I've already forgotten how I wanted to do it

#

...

unique crane
#

You die and sometimes it just makes your screen black

grand flower
#

I think it's when you're killed by anything but a player

royal mica
grand flower
#

It fades to black

unique crane
#

And doesnt reset unless you switch spectsator

grand flower
#

When you get killed by a player, a few seconds later you're forced to spectate the killer

unique crane
#

I disabled it

grand flower
#

but if there's no killer to spectate, the fade to black effect happens

#

oh

#

ok

unique crane
#

and it still appeared

#

sometimes

grand flower
#

bummer

#

it does happen if you die and revive on the same frame too

#

like if you die on the frame of a spawnwave and get respawned

#

you get faded to black while alive

random scaffold
#

which assembly have .ChangeAppearance(this Player pl)?

grand flower
#

exiled

random scaffold
#

so it in labapi im guess

grand flower
#

wtf

grand flower
unique crane
#

No it is not part of labapi

random scaffold
#

but how it works without exiled then

grand flower
#

You can copy the code over

#

it's just an extension method that sends a fake role sync message

#

Just make sure it's updated for 14.1.1

#

oh david

#

Are you gonna like, make the role sync message have the scale

random scaffold
#

exiled extensioins without using Exiled

#

nice

grand flower
#

it's just a utility exiled has

#

it's not exiled code

#

it just manually writes a message that fits SL's role sync message

grand flower
random scaffold
# grand flower show code

how i can call internal constructor by type from other assembly with : class from the same assembly?

grand flower
#

Activator.CreateInstance()

random scaffold
upper vapor
#

get the constructorinfo with reflection

random scaffold
#

with internal

random scaffold
grand flower
#
var ctor = typeof(MyType).GetConstructors(BindingFlags.Instance | BindingFlags.NonPublic).FirstOrDefault(c => !c.GetParameters().Any());

var instance = (MyType)ctor.Invoke(new object[0]);
#

google

grand flower
#

googling took 5 seconds

upper vapor
random scaffold
#

stay null

#

written only d

#

why

random scaffold
#

someone big brain is offline

#

(

grand flower
#

Loop through all the constructors and print parameters

unique crane
#

^

random scaffold
#

its found

#

but dont works

#

;\

#

why it dont wanna find with this flag

#

if it internal

#

internal != public

restive turret
#

print the BindingFlags for the ctors?

#

like duh

grand flower
#
var ctor = moduleType.GetConstructor(BindingFlags.NonPublic | BindingFlags.Instance, null, CallingConventions.HasThis, [typeof(IHandlersRegister)], null);
if (ctor != null)
{
  var instance = (IModule)ctor.Invoke(args);
}
random scaffold
#

how i can use invisible symbol in the hint?

#

exists vertical offset without offset on center?

hearty shard
restive turret
#

Dead

hearty shard
#

Soon

restive turret
#

Glad

random scaffold
hearty shard
#

try testing first

random scaffold
#

its already with spaces

random scaffold
restive turret
#

Butt

#

Chicken but

hearty shard
random scaffold
restive turret
#

Not my issue

hearty shard
#

Slejm

restive turret
#

And also cant help since not using anything fancy with the hint system

hearty shard
#

Why are you

restive turret
#

Good question

hearty shard
#

Why are you

#

Anything

#

I hate you...

restive turret
#

I'm not anything

#

I'm me

hearty shard
#

Ur nothing

restive turret
#

:sob

hearty shard
#

#sobbing

restive turret
#

How could u do this to me

hearty shard
#

Id do it again for a chicken nugget

restive turret
#

Reporting you to HR!

hearty shard
#

not if i report HR to HR

restive turret
#

Anyway hope you have a pillow, cus u about to cry on it when I gonna go and say good night

hearty shard
#

L

restive turret
#

good night

random scaffold
#

why indent rotating text

#

...

wheat flower
#

that means it doesnt like you

#

try a different indent

random scaffold
#

it just rotating the fucking symbols

#

when its not for rotate

wheat flower
#

yeah thats happened to me too

#

idk why it happens

#

just try changing something

#

¯_(ツ)_/¯

plain gazelle
#

Im using Player.Scale to set someones scale, but as of currently unknown reasons, some players dont see scaled players as their server side scale.
I can only assume it is players that join after the scale command is ran, but dont have any details for it :c

Does anyone have any leads on what might be wrong?
In this screenshot i used a command to scale myself to 0.0001 on all axis, which correctly scaled me for all players present with me at the time, and myself.
Then after some time, a player took this picture:

random scaffold
#

!nwmoment

regal lakeBOT
plain gazelle
#

oh :x
i was hoping this was somehow my fault and quickly fixable

grand flower
#

But yeah if it's reproduceable report it directly to the github IMO

#

Since that's mostly LabApi

#

Although it is supposed to send to players that join later

#

Do you do any kind of fake role sync?

#

Although could be that the scale message is sent before the player's role

#

@unique crane maybe another reason to send the scale in the role sync message?

#

That way you can just get rid of sending it in the ScaleController when a player joins

plain gazelle
grand flower
#

If the scale isn't default

#

But in what you describe, it shouldn't be an issue no

covert flame
#

Does anyone have any ideas to this, because it still just does not want to work :/

static meteor
#

Download it from the steam app

mild ice
covert flame
#

Yes

mild ice
# covert flame Yes

Try ".\steamcmd.exe" +login anonymous +force_install_dir ".\Local Admin Server" +app_update 996560 -beta public +quit

#

Usually changing the branch around forces an update

covert flame
#

Alright, thank you :]

slate flume
#

Is skeleton's interaction blocker Client-Side or Server-Side?
I want to know if it's possible to allow him to use certain items

wheat flower
#

client

#

(pretty sure)

slate flume
#

Dang

#

I appreciate it

grand flower
#

@unique crane another oddity caused by PlayerChangedRole being called later is ServerWaveRespawned being called before it now

#

can break some plugins that expect otherwise, but an "easy fix" for them anyway. Took me 2 mins

slate flume
#

Question:
What's the best way to figure out if a player is in the line of sight of another player?

grand flower
#

Pretty sure you can use the visibility controller

#

Check how 173 does it

slate flume
#

OO smart guy

#

I uh

#

Don't fully understand this

grand flower
#

lemme finish fixing something here and i'll check

slate flume
#

My hero 🙏🏼

grand flower
#

what file is that

slate flume
#

Took me like 10 minutes sorry about that 😅

grand flower
#

Checks if the player is looking in the direction of 173 with a dot product

#

then checks that it's unobstructed via raycast

#

and then on top of that, if it returns true, 173's observer tracker does multiple raycasts at different points of the model

#

to help make it more accurate

#

if any of those casts are unobstructed, you're looking at it

slate flume
#

Interesting

slate flume
#

I wonder how I'm gonna make this work for my purposes lol

grand flower
#

Whatcha trying to do

unique crane
grand flower
#

yeah

#

not an issue though

upper vapor
#

@random scaffold if you haven't figured the constructor thing out, try AccessTools.DeclaredConstructor

slate flume
grand flower
#

tbh a simple raycast would work

#

check via the visibility controller that they're visible, raycast to check LOS, maybe add a distance check and you're good to go

slate flume
#

How should I go about preventing my raycast from hitting the dummy I'm raycasting from? I was thinking to just start at an offset down the direction but idk

upper vapor
#

add an offset to the dummy's camera

#

using transformpoint (forward)

slate flume
#

Wha

#

Sorry I'm being slow

grand flower
#

Dummy.Camera.transform.position + Dummy.Camera.transform.forward * 0.1f

slate flume
#

Yeah I'm uh

grand flower
#

try 0.1 - 0.2

slate flume
upper vapor
#

that's what transformpoint does

slate flume
#

Like

#

How

#

I don't know transformpoint

upper vapor
#

transform.TransformPoint

#

give it a forward vector

#

it translates local space into world space

slate flume
#

Oh so it'll just offset it

upper vapor
#

yes

slate flume
#

And it accounts for rotation?

upper vapor
#

saves you a bit of code

#

ye

slate flume
#

Sick

#

Yay!

upper vapor
slate flume
#

Hurray!

upper vapor
#

yeah that works

slate flume
#

Yippee

#

Thank you @upper vapor @grand flower!

upper vapor
#

np

unique crane
slate flume
#

If so I'll gladly use it

upper vapor
#

i don't think visioninformation works in this case cuz we need direct line of sight

#

or maybe it could be used actually

restive turret
#

It has a check if i recall correctly

limber silo
#

yep

restive turret
#

Its a bool in the stuff

#

And u have to get the result with VI.Result[0] or smth

limber silo
#

there are different methods to do it inside visioninformation

#

get the simplest one that contains the data you need

restive turret
#

Or just copy paste into your code

slate flume
#

So like

#

What do I do

restive turret
#

You can just don't do anything which also an option, or use VI as david said

slate flume
#

Raycast is easy because it's literally just a ray

limber silo
#

keep it simple

#

go for raycasts if it is easier for you

restive turret
#

Yup

unique crane
grand flower
#

uh

#

found a problem with PlayerEvents.LeavingPocketDimension

#

IsSuccessful does nothing

#

the two methods that call the event don't use it

#

So you have pretty much no way to change the outcome of leaving the pocket dimension

slate flume
#

If so I wanna learn it

#

I just have never known about it

unique crane
#

Well can you tell me more about what your doing

#

?

slate flume
#

I want dummies to look at and shoot players in sight

unique crane
#

Oh

#

So you might care if they do/dont see you in the dark

#

/through fog

restive turret
#

Just enable aimbot

#

Not like it matter for dummies

slate flume
restive turret
#

VI has it

slate flume
#

How do I use it 😭

restive turret
#

As a parameter for

#

Idk , check how its being used

#

Check how its done for 096 i think

slate flume
#

Is confusing

unique crane
#

@slate flume It is very simple:

VisionInformation.GetVisionInformation(
            ReferenceHub source,
            Transform sourceCam,
            Vector3 target,
            float targetRadius = 0,
            float visionTriggerDistance = 0,
            bool checkFog = true,
            bool checkLineOfSight = true,
            int maskLayer = 0,
            bool checkInDarkness = true)
        {
#

eh copy paste shit

#

But basically you have this static builder method

grand flower
unique crane
#

And then you have these properties you can use

#

So you might want to check for the LookingAmount is greater than something

#

And if they are in darkness

slate flume
#

Yo baller

unique crane
#

Game uses it for all visual features

#

like 096 face

unique crane
#

traumatized effect

restive turret
#

I suggest you applying to QA

unique crane
#

Alone soundtrack

grand flower
#

Already got a job

restive turret
#

A server host

grand flower
#

I develop for Bright's but it's not my job

slate flume
#

So @unique crane it's just and then work from there?

#

I'm learning so much 🙏🏼

unique crane
#

I do reccomend putting the targetRadius to like 1.1f

#

So you account for the player width

slate flume
#

Gotcha gotcha

#

But you did mention using the LookingAmount, should I instead go for that?

unique crane
#

IsLooking

#

Will be true if you can see the player on any part of the screen

#

LookingAmount if how much is the player close to the center

slate flume
#

Interesting

unique crane
#

I might add wrapping methods for this to the player class

slate flume
#

Oh

#

LookingAmount ignores obstacles

unique crane
#

IsLooking check first then

#

And then the LookingAmount

slate flume
#

Is IsLooking will register if any amount of the player shows on the screen and in any other cause will return false, correct?

unique crane
#

Yep

#

obstacles included

slate flume
#

Sick

#

I love you

restive turret
#

Thanks

slate flume
grand flower
#
// TODO: Remove when NW fixes this
[HarmonyPatch(nameof(PocketDimensionTeleport.OnTriggerEnter))]
[HarmonyPrefix]
public static bool OnTriggerEnter_Prefix(PocketDimensionTeleport __instance, Collider other)
{
    if (!NetworkServer.active)
    {
        return false;
    }
    
    var component = other.GetComponent<NetworkIdentity>();
    if (!component || !ReferenceHub.TryGetHubNetID(component.netId, out var hub) || hub.roleManager.CurrentRole.ActiveTime < 1.0)
    {
        return false;
    }
    
    // Call PlayerEvents.OnLeavingPocketDimension() here.
    var isSuccess = __instance._type == PocketDimensionTeleport.PDTeleportType.Exit && !AlphaWarheadController.Detonated;
    var args = new PlayerLeavingPocketDimensionEventArgs(hub, __instance, isSuccess);
    PlayerEvents.OnLeavingPocketDimension(args);
    if (!args.IsAllowed)
    {
        return false;
    }

    if (args.IsSuccessful && !AlphaWarheadController.Detonated)
    {
        PocketDimensionTeleport.Exit(__instance, hub);
    }
    else
    {
        PocketDimensionTeleport.Kill(__instance, hub);
    }

    return false;
}
#

for those looking to fix the OnLeavingPocketDimension event

#

you also need two patches to get rid of the OnLeavingPocketDimension calls in PocketDimensionTeleport.Exit/Kill

restive turret
#

Wait, why kill & exit try run OnLeaving instead of OnLeaved?

grand flower
#

they do

#

the issue with the event is that IsSuccessful does nothing atm

#

you can't change whether or not the player dies/leaves

#

the patch fixes that

royal mica
grand flower
#

yes

royal mica
#

Ah okay

grand flower
#

wanted to increase the chances of escape

royal mica
#

just seems weird that these are included in the outcome branches and not the determine one

grand flower
#

but i realised it did nothing

#

wdym

royal mica
grand flower
#

yep

royal mica
#

So technically Leaving should be put here

grand flower
#

in the base game yes

royal mica
#

and not in those functions, that is why I was wondering if those are bugs or not

grand flower
#

my patch does that

grand flower
#

it does leaving in the exit/kill code

#

instead of before where IsSuccessful can change the outcome

#

so right now, it's useless

royal mica
#

Oh so it changed in past

grand flower
#

can confirm my patches work

#

sec

#
    // Removes the OnLeavingPocketDimension call.
    [HarmonyPatch(nameof(PocketDimensionTeleport.Exit))]
    [HarmonyTranspiler]
    public static IEnumerable<CodeInstruction> Exit_Transpiler(IEnumerable<CodeInstruction> instructions, MethodBase method, ILGenerator generator)
    {
        var matcher = new CodeMatcher(instructions, generator)
            .MatchStartForward(
                new(OpCodes.Ldarg_1),
                new(OpCodes.Ldarg_0),
                new(OpCodes.Ldc_I4_1),
                new(OpCodes.Newobj),
                new(OpCodes.Dup),
                new(OpCodes.Call),
                new(OpCodes.Callvirt),
                new(OpCodes.Brtrue_S),
                new(OpCodes.Ret)
            )
            .ThrowIfNotMatch("Could not find call to PlayerEvents.OnLeavingPocketDimension(), did NW fix it?")
            .RemoveInstructions(9);
        
        // Grab the label on the current instruction.
        // We'll go back to the start and apply it to the first brtrue.s
        var label = matcher.Instruction.labels[0];

        matcher.Start()
            .MatchEndForward(
                new(OpCodes.Ldarg_1),
                new(OpCodes.Ldfld),
                new(OpCodes.Callvirt),
                new(OpCodes.Isinst),
                new(OpCodes.Stloc_0),
                new(OpCodes.Ldloc_0),
                new(OpCodes.Brtrue_S)
            )
            .ThrowIfNotMatch("Failed to find instructions, did NW change it?")
            .SetOperandAndAdvance(label);
        
        return matcher.InstructionEnumeration();
    }
    
    // Removes the OnLeavingPocketDimension call.
    [HarmonyPatch(nameof(PocketDimensionTeleport.Kill))]
    [HarmonyTranspiler]
    public static IEnumerable<CodeInstruction> Kill_Transpiler(IEnumerable<CodeInstruction> instructions, MethodBase method, ILGenerator generator)
    {
        return new CodeMatcher(instructions, generator)
            .MatchStartForward(
                new(OpCodes.Ldarg_1),
                new(OpCodes.Ldarg_0),
                new(OpCodes.Ldc_I4_0),
                new(OpCodes.Newobj),
                new(OpCodes.Dup),
                new(OpCodes.Call),
                new(OpCodes.Callvirt),
                new(OpCodes.Brtrue_S),
                new(OpCodes.Ret)
            )
            .ThrowIfNotMatch("Could not find call to PlayerEvents.OnLeavingPocketDimension(), did NW fix it?")
            .RemoveInstructions(9)
            .InstructionEnumeration();
    }
royal mica
#

uhh why patch it there

grand flower
#

unless you wanna call OnLeavingPocketDimension twice

#

you have to remove it from those methods

#

after moving it to OnTriggerEnter

royal mica
#

aye

grand flower
#

tested in game, it works

#

a kill exit let me out the next attempt

#
// Give players an 80% chance of success.
args.IsSuccessful = UnityEngine.Random.value <= 0.8f;
royal mica
#

Hmm, one interesting thing about this, is that now you cannot force it to become impossible to escape

#

Or you cannot invoke the event without interfering with the outcome

#

Your fix does the correct way

#

but hmm, does this contextual boolean parameter used in other events?

grand flower
#

like

#

IsAllowed & another bool on top?

#

i don't get it

royal mica
#

not IsAllowed, but other booleans, where it prevents execution or changes the outcome

grand flower
#

hmmmm

#

well

#

PlayerChangingRole does

#

IsAllowed can prevent it

#

but it also has NewRole that you can change to override

#

you can change the role & spawnflags

royal mica
grand flower
#

don't remember any other

#

actually

#

UpdatingEffect too

#

you can prevent it, but also change the Intensity/Duration that's gonna be set

#

I kinda like that they've done it this way

royal mica
#

And the parameter is the current value

hearty shard
#

IsAllowed, CanOpen

royal mica
#
      bool canOpen1 = this.RequiredPermissions.CheckPermissions(ply, (IDoorPermissionRequester) this, out callback);
...
  
          PlayerInteractingDoorEventArgs ev = new PlayerInteractingDoorEventArgs(ply, this, canOpen1);

yup

restive turret
grand flower
#

right yeah

#

it's 3 am i should sleep heh

restive turret
#

Yes

#

Goobnoght

unique crane
#

What values yall set to make the primitives glow

worthy rune
#

make alittle transparent, and 50x the other color channels

#

also requires some light source to be on it, it wont glow in the dark

unique crane
#

ah

restive turret
random scaffold
#

used xbox record

restive turret
#

You should add a [ColorHdr] or something to the color

#

In the primitive toy

hearty shard
#

what

random scaffold
#

wrong using

#
internal static IEnumerator<float> FuckingCoroutine()
{
    while (true)
    {
      yield return Timing.WaitForSeconds(1);
    }
}

Timing.KillCoroutines - will it be able to forcibly stop the cycle?

upper vapor
#

Yes

pallid mason
#

Any ways to get user input like with GetAction? Or only SSS?

hearty shard
#

or use noclip event

pallid mason
#

sadly

hearty shard
#

or weapon fire / flashlight / inspect

pallid mason
#

another question

#

can i create custom FiringModeControllerModule (microhid mode)?

sinful bronze
random scaffold
upper vapor
#

Now make it face the observer :3

random scaffold
#

how can I hide information when pointing at a player?

upper vapor
#

Player info area

random scaffold
upper vapor
#

0

random scaffold
#

it doesnt exists

#

h

#

oh

#

lol

#

it really works that

#

ev.Player.InfoArea = 0;

upper vapor
#

Yes

#

You can cast other integers to enums directly

restive turret
#

Skull

upper vapor
teal junco
upper vapor
#

ye

#

actually

#

you don't even need math

teal junco
#

i tried reverse engineering Transform.LookAt() but i couldnt figure it out. im sure theres an algorithm for it but idk

teal junco
upper vapor
#

player.Rotation

teal junco
#

Oh shit

#

youre right

upper vapor
#

* Quaternion.Euler(0, 180, 0)

#

so okay yeah a little bit of math

teal junco
#

I wonder how bad that would be on TPS

#

probably not at all

#

Servers confuse me, I run one for fun but sometimes it has problems that i cant explain

#

once it crashed because of UCR despite nothing being super wrong

#

and the other day it had a few major network freezes for half a minute but it only happened towards the end

worn gull
#

Why is that the players can't reload their guns when they're Scale is 0.8, the animation plays but the ammo doesn't reload and if they press it again the animation forcefully starts again. No error

upper vapor
#

you sent the spawn message to the dedicated server

#

use Player.ReadyList

#

wherever possible

spice hatch
#

what is the best tracker for player dictionaries

#

like network id, player id, etc

hearty shard
#

what r u storing though

spice hatch
#

just stats

#

kills, deaths, etc

hearty shard
#

permanent ?

#

or per round

#

cuz you can just do Player to int dictionary

#

if its 1 round

#

and you dont care of losing if they leave

spice hatch
#

per round

languid temple
worn gull
grand flower
#

you'll be happier

worn gull
upper vapor
#

with harmony toomuchtrolling

worn gull
#

Bruh

#

I know

#

But

#

Where

grand flower
#

sec

#

there's a bunch of places

#
public static class NWDedicatedServerDisconnectPatch
{
    [HarmonyTargetMethods]
    public static IEnumerable<MethodBase> TargetMethods()
    {
        yield return AccessTools.Method(typeof(NetworkConnectionToClient), nameof(NetworkConnectionToClient.Disconnect));
        yield return AccessTools.Method(typeof(NetworkConnectionToServer), nameof(NetworkConnectionToServer.Disconnect));
        yield return AccessTools.Method(typeof(LocalConnectionToClient), nameof(LocalConnectionToClient.Disconnect));
        yield return AccessTools.Method(typeof(LocalConnectionToServer), nameof(LocalConnectionToServer.Disconnect));
    }

    public static bool Prefix(NetworkConnection __instance)
    {
        // Block the dedicated server player from ever disconnecting.
        if (__instance.connectionId == 0)
        {
            Logger.Error("Critical: attempted to disconnect the dedicated server player. This has been blocked.");
            return false;
        }

        return true;
    }
}
worn gull
#

Thanks

grand flower
#
[HarmonyPatch(typeof(NetworkServer), nameof(NetworkServer.UnpackAndInvoke))]
public static class HostDisconnectPatch
{
    public static void Postfix(ref bool __result, NetworkConnectionToClient connection, NetworkReader reader, int channelId)
    {
        // If the connection is 0 (the dedicated server), force the result to be true.
        // We do not want to disconnect the dedicated server, it causes MASSIVE issues.
        // If you see a " NetworkServer: failed to unpack and invoke message. Disconnecting 0." you probably sent a message to the host.
        // Do not do that. Use Player.ReadyList or check Player.IsHost before sending a network message.
        if (connection.connectionId == 0)
        {
            __result = true;
        }
    }
}
upper vapor
#

imma rewrite SL in godot without a host
-# is what i would say if i had the dedication and godot knowledge

#

it's so stupid that mirror lets you do that

grand flower
#

I've had a few close calls where I was gonna say fuck it and just start my own in Unreal

#

but I like SL enough to stay on it, for now

inner citrus
upper vapor
#

sl-like

#

imagine actual SL in Godot

#

with a mirror wrapper that offers compat with existing serversClassD_Hollow

inner citrus
random scaffold
#

bybygaga

grand flower
upper vapor
#

that's a cool project

upper vapor
#

😭

grand flower
#

ignoring the fact they're two different engines

#

and SL's already a pain in the ass to work with sometimes

plain gazelle
violet token
#

Guys, i made a custom keycard generator but the support told me to ask if anyone of you guys wanna help me?

hearty shard
#

what r we helping you with

violet token
#

they told me to come in here

#

😭

hearty shard
#

and whyd you go to support

grand flower
#

@unique crane apologies if you already replied to me about this yesterday and I didn't see it, but any chance of the scale being part of the role sync message?

#

would solve this dev's problem

hearty shard
#

for the fact you made a generator

violet token
hearty shard
#

yes....

violet token
#

idk

#

maybe im dum

hearty shard
#

and hows a card generator related to technical issue like a crash

violet token
#

no

hearty shard
#

sob

unique crane
hearty shard
#

hi david

grand flower
upper vapor
unique crane
grand flower
#

But with this you're guaranteed to have the correct scale for newly connected players since they'll get it with the role sync info

hearty shard
worn gull
grand flower
#

These ones I send because i've talked about them a lot and fixed them myself

#

The codebase isn't mine so I can't sent the others we have

worn gull
#

Ah okay

grand flower
#

But yeah, there's a lot

#

These two are nasty though so i'd use them

unique crane
#

@grand flower Found that sneaky black screen bastard

#

Now the question is

#

why

#

Oh its because the full hit is nan

grand flower
#

lmaoooo

#

rip

hearty shard
#

Whatd bro do

unique crane
#

Im looking at that right now

hearty shard
#

Alos what r these values for xd

unique crane
#

Its these blood effects

restive turret
#

But why is hitfull nan

unique crane
#

Well thats what im figuring out

#

If you evalulate on curve

restive turret
#

Also nice typo

unique crane
#

and you put it value out of the curve green

#

what does it return?

restive turret
#

tVo:lume

restive turret
#

Probably nan

#

Or 0

#

-Infinity ClassDTroll1

random scaffold
#

and 0.00 - 1

grand flower
#

If Unity's not stupid it should just return the closest value

#

so like if you evaluate at a time greater than the last keyframe you just get the value of the last keyframe

#

although if you evaluate at NaN I have no idea

unique crane
#

The only setter for this value

#

is here

sinful bronze
#

Won't nan return the curve until the curve gets nan??

restive turret
#

Are you sure

sinful bronze
unique crane
#

I like how there is a method that returns "how much dead you are"

restive turret
#

Lool

unique crane
#

Hey maybe if I fix this