#plugins-dev-chat

1 messages ยท Page 81 of 1

celest thorn
#

i still have alot to learn

slate flume
#

We all do

#

:)

#

You make a plugin for a ton of people on a server and they love it and at the end of the day that's what counts

true cedar
#

zero

slate flume
#

zero

true sierra
#

ive came up with a solution (to CustomRole.TryGet doing mean bad thingy), i overcomplicated it even more
who would like to see the monstrous code that should work

celest thorn
hearty shard
upper vapor
#

@slate flume talk about SRP when your custom items inherit from CustomEventsHandler? d_rock

upper vapor
#

I love seeing horrible voice and crashing out

celest thorn
#

and its almost done

celest thorn
#

im sure you record them

upper vapor
#

Unfortunately I don't

#

Record

celest thorn
#

you are a babuska

upper vapor
#

No, I'm a toaster

celest thorn
#

from a furry to a toaster

upper vapor
#

426 reference toomuchtrolling

slate flume
#

It's the cleanest way to attach to multiple events

#

And you have to sometimes

celest thorn
#

always been

hearty shard
upper vapor
slate flume
unique crane
hearty shard
#

davy

slate flume
#

Attaching to multiple events doesn't mean something doesn't have a single purpose

true sierra
# upper vapor Yay

i've McFucking had it with exileds picky shit

public static bool TryGetCustomRoleFromPlayer(Player player, out CustomRole foundRole)
{
    foundRole = null;

    if (string.IsNullOrWhiteSpace(player.CustomInfo))
        return false;

    string[] lines = player.CustomInfo.Split('\n');
    if (lines.Length < 2)
        return false;

    string roleIdentifier = lines[1];

    foreach (var role in CustomRole.Registered)
    {
        if (role.CustomInfo == roleIdentifier)
        {
            foundRole = role;
            return true;
        }
    }

    return false;
}
true cedar
upper vapor
# slate flume How so?

Because you have the Item information and event handling in one class, probably not fully related

celest thorn
#

but i could help

true cedar
#

fuck

slate flume
true sierra
upper vapor
#

For your use case (no 079 damage) create a subclass, seal the hurting event and create another method that'll handle the event if it's not a recontainnent damage handler

slate flume
#

Wha

true cedar
upper vapor
# slate flume Wha

sealed override OnPlayerHurting(...)
{
if (ev.dh is not recontianment)
ProcessHurting(ev);
}

slate flume
#

Holy shit new keyword unlocked

upper vapor
#

So you don't accidentally override the original handler

hearty shard
slate flume
#

Fuck but that would still mean I would need to take all the onplayerhurting events and throw the keyword on

#

Cause it's not just custom items

upper vapor
#

Rider: extract superclass

#

And then replace the inherited class where applicable

#

And the event name too

slate flume
#

WAIT YOU RIGHT

#

Replace the

#

CustomEventsHandler

#

Is replacing all my customeventshandler inheritances with my own class going to far to deal with this issue?

#

Cause I could patch it and get the same effect

#

Idk which would be considered better

#

I'm okay with putting in the work for it

#

Just is it excessive

upper vapor
true sierra
#

As in learning curve

slate flume
#

My plugin is very large

true cedar
#

it should be a lot easier than ruei v2

slate flume
#

Haha

true sierra
upper vapor
slate flume
#

I love it when rider yells at me

#

It loves yelling at me

#

I've learned a lot from it lmao

upper vapor
#

There isn't a refactoring to change the base type for multiple classes iirc

upper vapor
true sierra
slate flume
#

Fuck

#

Okay

upper vapor
slate flume
#

I'll just make it so if damage handler is recontainment handler is doesn't call the onplayerhurting events

upper vapor
#

Bruh okay

slate flume
#

Or maybe just

upper vapor
#

UnAPI-ing the Lab

slate flume
#

Make it ignore ev.IsAllowed

#

Either or

upper vapor
#

I gotta do that sometime

slate flume
#

Literally

#

I'm already in the weeds

upper vapor
slate flume
#

Dope

upper vapor
#

Just prefix

#

Hi riptide :3

#

Do you like my unapi idea

worthy rune
#

huh

upper vapor
#

A plugin that un-API-s the Lab

slate flume
#

Me when

upper vapor
#

Removes LabApi

#

PlayerEvents.OnHurting

#

Oh gosh what have I awoken

worthy rune
#

code patterns shouldn't be the rule, just guidelines

upper vapor
#

That's fine but then is it a single responsibility to handle everything there?
I'd make some extension methods to make the in-class code shorter at least

#

Like

#

Not the whole handler

#

But so it's less logic

worthy rune
#

the thing with SRP is that theres no end to how small you can split things up

slate flume
worthy rune
#

which is the point im making, why have one external event handler class when you can have one for each event?

slate flume
#

I just find it easy to go
Abstract Base Class : Handles universal logic for all derived classes
Derived Class : Handles specific logic for that class

hearty shard
#

im so glad to finally be reworking my custom roles

slate flume
#

Rather than
Abstract Base Class : Handles universal logic for all derived classes + niche side cases and bonuses for different derived classes
Derived Class : Handles specific logic + uses base class logic to handle side cases

upper vapor
true cedar
true sierra
#

chat i feel at peace now...
my custom teams are working

upper vapor
#

I mean your point is correct

slate flume
#

๐Ÿ”ฅ I'm usually dumb and stupid

upper vapor
#

It's not a point, it's a fact

#

๐Ÿ—ฃ๏ธ

true sierra
hearty shard
worthy rune
slate flume
#

The worst practice I have is my Resources class

#

It has like

#

15 extension methods

#

Of assorted variety

hearty shard
slate flume
#

It's like a donut shop

#

You can get one with sprinkles

hearty shard
slate flume
#

You can get an eclair

hearty shard
#

i also have

#

do you like my docs

slate flume
slate flume
#

I just try to make my classes as intuitive as possible to compensate

#

Lmao

upper vapor
upper vapor
#

Realize that it's stupid

hearty shard
#

im honestly probably also gonna make HasFlagFast for every enum flag i use kek

upper vapor
#

Go back to writing docs yourself

#

With a bit of autocomplete

slate flume
#

"I don't need docs I'll just remember think"

upper vapor
hearty shard
#

actually

#

it might

upper vapor
hearty shard
#

i should @ hubert to add to EnumUtils

slate flume
#

3 times

#

And it's for the boring manual labor-type shit

#

Like that lmao

unique crane
#

๐Ÿ’€

#

Just get the EN translations file

celest thorn
#

@upper vapor PIRATE SOFTWARE

unique crane
#

and use that

unique crane
slate flume
#

But also

#

Idk how lmao

#

I'm stupid

#

You forget

unique crane
#

wdym

#

Just open up your SL folder

#

translations

slate flume
#

oh you mean

#

Okay yeah

#

I thought you meant some kind of interfacing

#

I'd still need to write the uh

#

Switch

#

For the room names

#

Or do interfacing with the translation file

#

Which sounds like

#

So much work

unique crane
#

Hmm does dedicated load translations too?

slate flume
#

Uhhhh

#

No clue

upper vapor
hearty shard
#

@slate flume ill give u it

#

2sec

unique crane
#

Either check if dedicated load translations too

#

or just load the file yourself

#

Instead of hardcoding it like that ๐Ÿ˜ญ

hearty shard
#
/// <summary>
        /// Tries to get a role base from a <see cref="RoleTypeId"/>.
        /// </summary>
        /// <param name="roleTypeId">The <see cref="RoleTypeId"/> to get base of.</param>
        /// <param name="role">The <see cref="PlayerRoleBase"/> found.</param>
        /// <typeparam name="T">The <see cref="PlayerRoleBase"/>.</typeparam>
        /// <returns>The role base found, else null. </returns>
        public static bool TryGetRoleBase<T>(this RoleTypeId roleTypeId, [NotNullWhen(true)] out T? role)
            => PlayerRoleLoader.TryGetRoleTemplate(roleTypeId, out role);

/// <summary>
        /// Gets the name of a <see cref="PlayerRoleBase"/> based on it's <see cref="RoleTypeId"/>.
        /// </summary>
        /// <param name="roleTypeId">The roletypeid to get name of.</param>
        /// <returns>The found name.</returns>
        public static string GetRoleName(this RoleTypeId roleTypeId)
            => roleTypeId.TryGetRoleBase(out PlayerRoleBase? playerRoleBase) ? playerRoleBase.RoleName : "Unknown";
upper vapor
hearty shard
#

could just use the role

upper vapor
slate flume
unique crane
#

Seems like dedi only has english version

hearty shard
#

๐Ÿ˜ญ

unique crane
#

so you can use that

#

But I guess you can just

slate flume
unique crane
#

Copy paste it from client build

slate flume
#

I use it for UI stuff

hearty shard
slate flume
#

I want it to look good

hearty shard
#

SCP-106

unique crane
#

Oh

slate flume
#

So it'll have spaces and shi

hearty shard
#

or smth

unique crane
#

I guess thats used

hearty shard
#

uh

#

probably!!!

slate flume
#

Real shit

hearty shard
#

i use it everywhere i need to for it

#

but

#

i

slate flume
#

You know

hearty shard
#

dont remember how it works

#

๐Ÿ˜ญ

slate flume
#

I recently learned that

hearty shard
#

its up to nw what they named it

slate flume
#

RoomName enum doesn't encapsulate every room name

#

And that upsets me

hearty shard
#

ye

slate flume
#

Generators spawn in nameless rooms

#

Well until you do

#

Get the string name for the unity object rather than the enum

#

This shit rocked my world

#

I still need to update my plugin to handle it

slate flume
#

That's so tuff

celest thorn
#

skibidi

slate flume
#

Love this guy

#

She's so goated

celest thorn
unique crane
#

Face the wall.

unique crane
#

You are NOT gonna brainrot our national treasure

#

Mafia

hearty shard
celest thorn
#

BRO

unique crane
#

I MEAN THE GAME

slender lynx
unique crane
#

Not mafia itself

#

silly

celest thorn
#

MAFIA IS PEAK

upper vapor
upper vapor
celest thorn
hearty shard
#

@upper vapor why not EnumUtils<RoomType>.Values

upper vapor
#

Because it's old code

hearty shard
#

if i rewrite it will you fix it

upper vapor
#

Also because of obsolete members

#

Though they have the same value

#

Nevermind

upper vapor
hearty shard
hearty shard
#

also

#

i will NOT be giving you working code

#

probably

#

oh

#

actually you cant get attribute from an enum value

#

yea nvm im not fixing it, its good enough

upper vapor
#

Kek

true cedar
#

EVE

hearty shard
true sierra
hearty shard
true cedar
unique crane
#

FINALLY

celest thorn
#

who is you

celest thorn
#

idk you

#

you scary

unique crane
celest thorn
#

no

unique crane
#

Do you know who else

celest thorn
#

none else

#

who is nameless?

#

yo @regal lake my boy do you remember?

south socket
#

im so bored i dont even know.. can someone end me already? We love Lua ๐Ÿ”ฅ get the gmod guys

unique crane
#

That reminds me to update my LuaLab

#

eventually

south socket
celest thorn
unique crane
#

zero

#

go sleep

celest thorn
#

no ;(

#

i don't wanna

south socket
#

(and we need more script kids in sl!!!!)

celest thorn
#

crazy we already have alot

south socket
#

in lua!!!

celest thorn
#

i mean check how many people on exiled create chatgpt plugin

hearty shard
#

why can player be null in PlayerChangingRoleEventArgs

celest thorn
#

and complain that they don't work

celest thorn
south socket
#

(what am i talking about, they will break it too)

celest thorn
#

especially something called SCP:SL

south socket
#

i think i will just finish my lua API Wrapping and then publish it and then never maintain it again

celest thorn
#

So sad

#

@unique crane steal it and mantain it

south socket
celest thorn
#

i love breaking nw code

#

:3

unique crane
#

Imma just find some node based programming framework

#

and make that for Lua

#

and for SL

south socket
#

can we add brainfuck for sl?

unique crane
#

Then do it

celest thorn
#

can we add SL in SL

celest thorn
#

Doom on SL

unique crane
#

I used the uhhhhhh

#

Moonsharp

#

for it

south socket
celest thorn
#

doom

south socket
unique crane
#

no

unique crane
#

Now do it

celest thorn
#

give me src

#

and i will gladly do it

unique crane
#

No

celest thorn
#

i love doom

#

i love doom

#

doom should be everywhere

obtuse spruce
#

Am i tripping or on this method the List is never returned to the pool ?

unique crane
#

Make it from texttoy

celest thorn
#

for intercom & texttoys

unique crane
#

an empty list?

#

You can return it to the pool if you want (but not a big deal if you wont)

#

we plan on looking into this aswell

#

so its maybe gonna end up as IEnumerable

obtuse spruce
# unique crane What would you get in return then

Why taking a List from the pool if its not for return it. Its not big deal bc i dont think there is a lot of peoples called that methods a lot of times but you rent it and never return it for the next time you need a Pickup List from the pool

worthy rune
#

idk about ienumberable for this one

true cedar
#

ienumerable prob wouldn't work yea

worthy rune
#

since its lazy it wont work unless you enumerate over it

true cedar
#

since dropitem presumably removes it from the kist

#

list*

#

ienumerator might tho

obtuse spruce
#

i didnt have the comment :/

unique crane
#

Nuget is available

obtuse spruce
#

yea that what im gonna say. Probably cuz im a retard who use Managed Folder

celest thorn
unique crane
#

idk

hearty shard
#

@unique crane when doing cola + anti cola
is it guaranteed that cola gets disabled

unique crane
#

Its guaranteed that you will in fact

#

explode

hearty shard
#

yea but does anti or normal get disabled

#

anti ?

unique crane
#

I dont think either does

hearty shard
#

it does

unique crane
#

you just explode and die

hearty shard
#

cola will disable the other cola

unique crane
#

Seems like yea

hearty shard
#

wait actually

#

oh itll do the one that was on first

#

so if you drink cola first itll remove the cola

#

okay

#

doesnt that mean that if you do cola then anti you can survive

#

no. it was a no

restive turret
#

this.GoingToExplode

#

๐Ÿ’”๐Ÿ’”

hearty shard
#

but yeah uh turns out
if anti cola isnt disabled by CokeBase, it jsut disables itself anyway

hearty shard
#

also turns out dummy 939s cant lunge properly

tulip kiln
#

Anyone knows why would this trigger an exception??

hearty shard
tulip kiln
hearty shard
tulip kiln
#

Sure

#

What gives?

hearty shard
#

generator.Room?.Base.name.Replace("(CLONE)", string.Empty) ?? "N/A"

#

why does this nto

#

replace

restive turret
#

Bc ??

hearty shard
#

wait

#

Is it Clone

#

not CLONE

tulip kiln
#

It's Clone

hearty shard
restive turret
#

Lmao

tulip kiln
#

Clone

restive turret
#

Skull issue

hearty shard
#

IM GONNA KILL YOU

restive turret
#

Do name.ToLower()

hearty shard
#

good idea

tulip kiln
#

I do that with names that the user can interact with

#

cause they can't use proper capitalization for shit

pallid galleon
#

anyone know how to hide the Dummy tag from a dummy when I spawn it?

#

I figured out how to disable it for all dummies but surely there's an easier way than just changing it to this and back when spawning it

celest thorn
#

:3

pallid galleon
#

But doesn't that do it for all dummies, not just certain ones?

pallid galleon
#

I'm trying to do it for certain dummies ๐Ÿ˜›

celest thorn
#

ig patch this code

#

ServerRoles::Start()

#

and make it just return when setting up the is dummy

#

and then make your own method wrapped around to SpawnDummy

pallid galleon
#

I think I'll just uhh.. disable it for all dummies

pallid galleon
#

I'm not that smart lol

celest thorn
#

directly

#

just let me open rider

hearty shard
pallid galleon
#

I've never done any patch stuff so idk how to do that

celest thorn
#

don't worry

pallid galleon
#

I just need the tag to not be there so people don't know it's a dummy

pallid galleon
#

sure, I just need it to sit there and pretend to be a real boy

celest thorn
#

Patch

pallid galleon
#

tyty, I'll see what I can do ๐Ÿ˜›

celest thorn
# pallid galleon tyty, I'll see what I can do ๐Ÿ˜›
    public static ReferenceHub SpawnDummy(string nickname = "Dummy", UserGroup? group = null)
    {
        ReferenceHub hub = DummyUtils.SpawnDummy(nickname);
        hub.serverRoles.SetGroup(group);
        return hub;
    }

Here a code to actually spawn them with your own group or stuff you want note that if null the game will actually not display anything

#

Hope i helped

slate flume
#
[HarmonyPatch(typeof(PlayerEvents), nameof(PlayerEvents.OnHurting))]
public class Scp079InvulnerabilityFix
{
    public static bool Prefix(PlayerHurtingEventArgs ev)
    {
        return ev.DamageHandler is not RecontainmentDamageHandler;
    }
}```
Nice
#

That was an easier fix than I was expecting

pallid galleon
slate flume
#

Afaik

#

I'm on mobile I can read half the lines

barren pasture
true cedar
#

would greatly appreciate it since theres a lot to test and im really busy :^3

celest thorn
#

Helo

true cedar
celest thorn
slate flume
#

FUCKKKKKKKKKK

#

SL is .net4.8 right?

celest thorn
slate flume
#

I'll crash out

#

I want my INumber :(

upper vapor
#

best you can do is .NET Standard

#

unfortunately

#

if only unity kept up with .NET releases (never happening)

slate flume
celest thorn
#

someone knows the difference between Dedicated and SourceTV?

#

like what even is?

#

Oh

#

its a spectator game

#

crazy

true cedar
celest thorn
#

what should i try??

true cedar
#

v3

#

it should work now :3

celest thorn
#

๐Ÿ˜ญ

#

new rewrite ;(

upper vapor
#

git revert

celest thorn
#

i already pushed like 3 other stuff

#

in case i can create a plugin and play around with it

#

but updating unless its like important

#

i will not

#

because as of rn i have another massive stuff to push

true cedar
celest thorn
#

i couldn't wait

#

i have alot strict time to follow

#

;(

true cedar
#

!!!

celest thorn
#

i'll wait for the Translation system to be pushed

#

then i will actually code a new update

#

with ruei v3

celest thorn
true cedar
#

o

celest thorn
#

and waiting people to do the translation

#

so sad the finnish is just missing ;(

upper vapor
celest thorn
#

maro will push it

#

directly lol

upper vapor
celest thorn
#

yes...

#

i know

upper vapor
#

"please review"
"lgtm"

celest thorn
#

im just the only dev Trolley

#

btw Exiled has a cool stuff

#

that decompiled git repo

#

im copying their idea

#

Because i need to be gone for some hours and that pc sucks ass

#

so git online is really useful

#

decompiler moment

upper vapor
pine parcel
#

quick couple of questions if anyone knows the answer off the tops of their heads:

  1. Is it possible to prevent scientists from escaping? (Like removing the event trigger off of them) or is it easier to make a new class rather than reuse scientist

  2. Can I change the text that appears on spawn in (Ex. "You are a Scientist")

  3. Can I change the colour and name of a role that someone has, or am I needed to implement a new class.

Thanks to anyone who takes the time to look at or answer my questions!!

celest thorn
#

and then pushed

#

with the console command

upper vapor
restive turret
#

Use ILSpy

#

ILSpy produce better code

celest thorn
restive turret
#

Skill issue

upper vapor
#

me when dotpeek has an export project feature

#

yeah it's definitely dnspy

restive turret
celest thorn
upper vapor
#

or whatever it's dependent on

celest thorn
#

you see it?

#

because i don't

upper vapor
upper vapor
#

the decompiler itself is definitely better

celest thorn
#

bruh

#

it was an installer

upper vapor
pine parcel
#

so that's nothing I can do from serverside then. Is implementing a new class also something needed server and client side modding?

pine parcel
restive turret
#

@celest thorn
dotnet tool install --global ilspycmd

static meteor
restive turret
#

Fuckin skill issue

celest thorn
#

btw i found out

restive turret
celest thorn
#

that IlSpy.Exe

#

works too

#

but i will stick with this

restive turret
#

Stick with

restive turret
celest thorn
#

it works just answers in the UI

celest thorn
#

IT DID IT INSIDE ONE FILE

celest thorn
#

ok fixed it

celest thorn
#

lol

#

yea more readable

unique crane
#

VS decompiles it like that too

#

Dotpeak as switch

upper vapor
upper vapor
unique crane
#

I wanted to tell you size of the next update

#

But fuck you

celest thorn
upper vapor
#

sizeof(NextUpdate)

unique crane
#

Yes

celest thorn
#

(How to get sued speedrun)

celest thorn
#

its a miracle its readable

#

but its really useful to have on git

upper vapor
#

just remember every member Smart

#

re-member

#

haha

#

xd

celest thorn
#

i got sent this gif and i love it

celest thorn
#

meow is too strong Trolley

upper vapor
#

they've found you already

celest thorn
#

im waiting for them

#

1v1 on fortnite no build

upper vapor
#

๐Ÿ˜ญ

restive turret
#

Ban

celest thorn
#

Why banning me im so cute :3

restive turret
celest thorn
restive turret
#

:catFlower:

slate flume
#

Is there a way to remove the severed hands models shit?

static meteor
#

The hands on the ground?

slate flume
#

Ye

static meteor
# slate flume Ye

You might be able to patch SeveredHands.ChangeHandsState() idk if its synced with the client though

#

or if its the correct method ยฏ_(ใƒ„)_/ยฏ

random scaffold
restive turret
#

nextUpdate is not a type

celest thorn
#

10kb

celest thorn
#

Is chat alive?

restive turret
#

No

celest thorn
#

so sad

tepid sluice
#

can i modify 049's ability time of respawn a zombie?

celest thorn
#

i think tho you can do reset it

tepid sluice
#

did u remember where it is?

celest thorn
tepid sluice
#

thx

hearty shard
#

this is kinda fire

upper vapor
#

yayayayaya

unique crane
hearty shard
#

i didnt realize this was a thing ๐Ÿ˜ญ

#

๐Ÿ’”

#

a lot easier to see where smth starts and ends by its color than counting brackets

royal mica
#

Rainbow brackets, great plugin

hearty shard
#

oh i chose the one just called Color Brackets

upper vapor
#

gay brackets

hearty shard
#

@unique crane oi

#

why does this break shotgun

#

like shotgun ammo is 0, and you can get the reload animation.. it just doesnt add ammo

#

and its only seemingly when triggered through this method

worthy rune
#

do you have the processor code that spawns the shotgun

hearty shard
#

wdym

worthy rune
#

hmmm

worthy rune
hearty shard
#

custom

worthy rune
#

oh

#

i thought it was apart of the labapi

hearty shard
#

but shouldnt processor upgrading item handle it all?

#

nono its mine

worthy rune
#

yeah the item processor should handle it itself, no need for a static method(im not even sure if that would work in all cases)

#

base game might be doing stuff to the item before and after the upgrade

hearty shard
#
public virtual Scp914Result UpgradeInventoryItem(Scp914KnobSetting setting, ItemBase sourceItem)
    {
      ItemPickupBase sourcePickup = sourceItem.ServerDropItem(false);
      Scp914Result scp914Result = this.UpgradePickup(setting, sourcePickup);
      if (scp914Result.ResultingPickups == null || scp914Result.ResultingPickups.Length == 0)
        return scp914Result;
      InventoryInfo userInventory = sourceItem.OwnerInventory.UserInventory;
      this.ClearCombiner();
      foreach (ItemPickupBase resultingPickup in scp914Result.ResultingPickups)
      {
        if (!((UnityEngine.Object) resultingPickup == (UnityEngine.Object) null))
        {
          ISearchCompletor searchCompletor = resultingPickup.GetSearchCompletor(sourceItem.Owner.searchCoordinator, float.MaxValue);
          if (searchCompletor.ValidateStart())
          {
            searchCompletor.Complete();
            ItemBase resultingItem;
            if (userInventory.Items.TryGetValue(resultingPickup.Info.Serial, out resultingItem))
              this.AddResultToCombiner(resultingItem);
          }
          else
          {
            this.AddResultToCombiner(resultingPickup);
            resultingPickup.Position = sourceItem.Owner.transform.position;
            NetworkServer.Spawn(resultingPickup.gameObject);
          }
        }
      }
      return this.GenerateResultFromCombiner(sourceItem);
    }
#

looks like this is what labapi does

#

this is labapi, which since im getting item handling for basegame without customs itd be BaseGameItemProcessor
so itd be what i showed above

unique crane
#

This itself doesnt break it

#

its that when shotgun is created

#

It has MagazineModule which gets set to inserted when given by RA or spawn

#

but it didnt account for 914 creation

slate flume
#

You guys know how sometimes loot clips through elevators?

#

Is it possible to fix that?

slate flume
restive turret
unique crane
#

The next update

restive turret
#

:((((

#

Please review ax's PR

tepid sluice
hearty shard
#

@unique crane btw when is scale controller like actually reset in the role creation like time

unique crane
#

I reviewed

#

and told Jesus about it

hearty shard
#

cuz if you prevent scale change when is called and then disable scale prevention from there

unique crane
hearty shard
#

it still prevents it

hearty shard
unique crane
#

No thats called last

hearty shard
#

its before InitializeNewRole

#

this SUCKS

unique crane
#

Oh you said changing

#

I though you said changed

hearty shard
#

yea

unique crane
#

well then yea thats before that

#

makes sense

#

You cant initialize role and then event says "nuh uh"

hearty shard
#

OnRoleRemoved is called in Changing
but OnChangingScale seems to still prevent it

unique crane
#

Tf is playerchangingscale

#

I didnt do that

hearty shard
#

custom

unique crane
#

Literally

hearty shard
unique crane
#

PlayerChangingScale event

#

just call it here

hearty shard
#

i do

unique crane
#

Well then whats the problem

hearty shard
#

it still seems to prevent it

unique crane
#

Prevent what

hearty shard
#

Scale resetting

#

even tho on Changing i remove the event

#

so by the time role is being initialized it shouldnt be called

unique crane
hearty shard
#

i do this

#

right

unique crane
#

hm

hearty shard
#

but when role is removed (OnChangingRole) it seems to still be in affect

#

eg changing to 173 twice works
but the first time doesnt

#

the health works fine and doesnt seem to break

#

its just scale specifically

unique crane
#

I still dont understand what your trying to do

#

You want to set scale

#

when player changes role

hearty shard
#

prevent scale change while having the custom role

#

role is not removed on escape

#

Oh

#

why is Scale setter called every frame

#

i might be going insane

unique crane
#

It is not?

#

Its you calling it every frame

hearty shard
#

i have to be

#

but i dont see me doing it anywhere

unique crane
#

Well

#

Search for all setters

hearty shard
#

because i dont rly use FpcScaleController for anything except for yk
this patch rly

#

this is all uses of the setter

unique crane
#

how about player.Scale?

hearty shard
#

there is no uses for player.Scale either

unique crane
#

dont know then

hearty shard
#

ss didnt show but no results

#

wait

#

i might know

#

new SyncedScaleMessages.ScaleMessage(this._scale, this.Hub).SendToAuthenticated<SyncedScaleMessages.ScaleMessage>();

#

that sends to dedicated server

#

which sets .Scale

#

and i have a delay to fix issues

#

so

#

uh

#

new SyncedScaleMessages.ScaleMessage(__instance._scale, __instance.Hub).SendToHubsConditionally(hub => hub.Mode is not (ClientInstanceMode.Unverified or ClientInstanceMode.DedicatedServer));

#

problemo solved

unique crane
#

mhm

hearty shard
#

yall didnt merge that

unique crane
#

Oh

hearty shard
#

not into 14.1.1 at least

unique crane
#

We did

#

but not in 14.1

#

Welp

#

next update

hearty shard
#

yea....

#

yep that fixed

upper vapor
#

ke

#

k

restive turret
restive turret
#

I joked about being in 14.1.2 or 14.2

#

But i don't think they released that

keen berry
#

can't wait for 14.1.1.1

hearty shard
#

we need for 14.2 or 14.1.2

#

or

#

22.0

upper vapor
#

there won't be 14.2

#

(most likely)

mild ice
#

It's the TLS Beta

upper vapor
#

pycck

#

idk how to write that

#

ั€ัƒััะบะธะน

hearty shard
celest thorn
#

wtf is this??

#

has someone ever seen it?

south socket
royal mica
celest thorn
#

but i've never seen it

#

(Server Side)

south socket
south socket
spare zodiac
#

guys!

#

what happens when you change the speaker in voice message to someone else? Can you speak through someone?

keen berry
spare zodiac
#

it does

#

even with the context

keen berry
#

truly

spare zodiac
keen berry
#

LOL

spare zodiac
slate flume
#

Okay wait before I test, does changing the voice channel of a message sync with the client and actually work or no?

#

Eg. Override and redirect SCP messages to use proximity channels

#

I'm a little busy so I figured I'd ask in case anyone knows

hearty shard
#

msg.Channel = VoiceChatChannel.Proximity;

slate flume
#

Fire

hearty shard
#

it will NOT send though by default

#

you have to make it send

slate flume
#

Iirc I'd need to resend the message cause the message we get in the event is a copy

#

Right?

hearty shard
#

what

#

when PlayerSendingVoiceMessageEventArgs is called

#

you need to deny event

#

and then send it

#

just foreach every player, validate with their IVoiceRole::VoiceModule.ValidateReceive
and then set the msg channel and send it listener.Connection.Send(msg);

slate flume
#

Okay cool yeah that's what I thought

#

What I mean is that

#

The event doesn't give the actual original message, so making modifications to that message won't sync iirc

hearty shard
#

or maybe PlayerReceivingVoiceMessageEventArgs can be used instead without actually sending

slate flume
#

I remember seeing a whole debate in here about it

hearty shard
#

thats my code

#

ev.Message.SendProximityMessage(MaxProximityDistance);
this is how its called (from the event)

slate flume
#

Yeah I already do a prox chat thing I just wanted to know if changing message synced and that the ref thing was right

hearty shard
#

even if its not a ref

#

if you deny the event

#

and modify the new voice message

#

it will do the same

#

because ur still sending the correct data and client can handle it

slate flume
#

I just wanted to make sure I was right that it wasn't a ref

#

Haha that was the extent of my inquiry into that

hearty shard
#

oh you just wanted to know if its a ref

slate flume
#

This is what I was thinking of

hearty shard
#

idk

#

bug mayb

upper vapor
slate flume
#

I don't fully understand but very cool

hearty shard
slate flume
#

So

#

What

#

I'm confused

#

Does this mean I didn't need to set up my system around essentially doing the event myself and I could've just modified the message?

upper vapor
#

yea

tepid sluice
upper vapor
#

skull emoji

grand flower
#

Bruh

true cedar
celest thorn
#

Someone knows how to modify a out in a prefix?

upper vapor
#

ref Type param

restive turret
celest thorn
slate flume
tepid sluice
#

bruh

slate flume
celest thorn
#

lets change topic lol

upper vapor
celest thorn
#

I have a stupid question is it too heavy to have a new Harmony for each module that i have

upper vapor
#

Why would you do that ๐Ÿ˜ญ

celest thorn
#

whenever i want

upper vapor
#

You can use SecretAPI's PatchCategory

celest thorn
upper vapor
#

Call unpatchcategory

celest thorn
#

i don't see in SecretAPI

upper vapor
#

Um

#

Skull issue

#

Check v2

hearty shard
#

i think i have it

#

just not pushed

celest thorn
hearty shard
celest thorn
upper vapor
#

Merry Christmas

celest thorn
#

so sad

celest thorn
#

๐Ÿ”ซ

#

like the only problem i got

#

is finding the MethodBase

#

for that type

#
harmony.Unpatch(harmony.GetPatchedMethods().First(x => x.DeclaringType == type), HarmonyPatchType.All, harmony.Id)
#

I mean this could work?

hearty shard
#
public void UnpatchAll(string harmonyID = null)
    {
      foreach (MethodBase methodBase in Harmony.GetAllPatchedMethods().ToList<MethodBase>())
      {
        MethodBase original = methodBase;
        int num = original.HasMethodBody() ? 1 : 0;
        Patches patchInfo1 = Harmony.GetPatchInfo(original);
        if (num != 0)
        {
          patchInfo1.Postfixes.DoIf<HarmonyLib.Patch>(new Func<HarmonyLib.Patch, bool>(IDCheck), (Action<HarmonyLib.Patch>) (patchInfo => this.Unpatch(original, patchInfo.PatchMethod)));
          patchInfo1.Prefixes.DoIf<HarmonyLib.Patch>(new Func<HarmonyLib.Patch, bool>(IDCheck), (Action<HarmonyLib.Patch>) (patchInfo => this.Unpatch(original, patchInfo.PatchMethod)));
        }
        patchInfo1.Transpilers.DoIf<HarmonyLib.Patch>(new Func<HarmonyLib.Patch, bool>(IDCheck), (Action<HarmonyLib.Patch>) (patchInfo => this.Unpatch(original, patchInfo.PatchMethod)));
        if (num != 0)
          patchInfo1.Finalizers.DoIf<HarmonyLib.Patch>(new Func<HarmonyLib.Patch, bool>(IDCheck), (Action<HarmonyLib.Patch>) (patchInfo => this.Unpatch(original, patchInfo.PatchMethod)));
      }

      bool IDCheck(HarmonyLib.Patch patchInfo) => harmonyID == null || patchInfo.owner == harmonyID;
    }
#

this is what harmony does

hearty shard
#

i had smth i was doing but ig i gave up

upper vapor
#

@celest thorn as long as the modules are in separate assemblies, you can easily call PaychAll/UnpatchAll

plain gazelle
#

Hm, something in my code is causing the server to freeze and die to lack of heartbeat.
I cant find anything in ServerLogs or LocalAdminLogs about it.

Do i have to comment out parts of my code bit by bit until i find it or is there a better way? :c

grand flower
plain gazelle
#

yes

#

doing custom SyncedScaleMessages.ScaleMessage

grand flower
#

Show code

#

Or well

#

try commenting it out and see if the crashes still occur

plain gazelle
#

Current theory that it is ScaleMessage(stuff).SendToAuthenticated();
since that was my most recent addition

hearty shard
plain gazelle
#

okay .w.

hearty shard
#

this is the fixed nw version

#

the change is the bottom line, with SendToHubsConditionally

grand flower
#

yeah

#

Wish I could understand why the fuck the server has a player

plain gazelle
#

oh

#

lol

#

yeah that fixed it

#

Thanks x.x

#

Is there any other use case of SendToAuthenticated that does not result in a server crash? xd

#

-# wondering why it exists

hearty shard
#

that ones not a crash its just infinite loop

#

performance !!

plain gazelle
#

I made fake scales that work, but how can i send a scale message to all (real) players to "fix"/resync the server scale?

#

My first smooth brain idea was player.Scale = player.Scale but that doesnt work xD

unique crane
#

Just as its done here

#

new ScaleMessage(...).SendToHubsContionally(...)

hearty shard
#

Conti

plain gazelle
#

I am spawning an explosion by doing
ExplosiveGrenadeProjectile.SpawnActive(spawnPosition, ItemType.GrenadeHE, null, 0);
but it isnt dealing any damage to anyone :c

plain gazelle
#

even with a player it doesnt do anything ,_,

hearty shard
#

TimedGrenadeProjectile.SpawnActive(player.Position, ItemType.GrenadeHE, player, 0.1f);

#

works for me

plain gazelle
#

Explosion blows off all doors but leaves any player uninjured ?w?

unique crane
#

Do you have FF off or on

plain gazelle
#

istg

#

on

unique crane
#

Do you move between spawning the grenade and it exploding?

#

It might be that kind of bug

plain gazelle
#

I have a command that spawns an explosion at another player which works fine

#

Could it be that im destroying the script the grenade is made from at the same time?

grand flower
#

shouldn't be

unique crane
#

that could code the not taking damage

unique crane
#

Or you use ExplosionUtils?

plain gazelle
#

What is that :o

unique crane
#

Is it any different from the

#

this

unique crane
#

Spawning

plain gazelle
#

ExplosionUtils.ServerSpawnEffect or
ExplosionUtils.ServerExplode?
:o

hearty shard
plain gazelle
#

,_,

hearty shard
plain gazelle
#

Explode player:
ExplosiveGrenadeProjectile.SpawnActive(target.Position, ItemType.GrenadeHE, requester, 0);
Explode RPG:
ExplosiveGrenadeProjectile.SpawnActive(transform.position, ItemType.GrenadeHE, Owner, 0);

#

The script for it is on an rpg schematic that gets moved to "fly"

unique crane
#

And is the Owner really not null?

plain gazelle
#

yes

unique crane
#

Can you check

#

Because I would trust the requested player to not be null

#

but here your doing some

#

things

#

and I have honestly no idea what else it might be

plain gazelle
#

maybe the "Owner" variable on the script is the issue since the script gets deleted right after?

unique crane
#

Well your first passing it and then deleting it so no issue there

unique crane
plain gazelle
#

will put a logger and see

#

Result:

#

I also commented out the Destroy(gameObject) and yeah that wasnt it

unique crane
#

Uhhhhh

plain gazelle
#

I increased the timer to 3s to test it again and now it deals damage waaaa

unique crane
#

Weird

#

How about just 0.1f

plain gazelle
#

Doesnt work again

restive turret
#

0.2

plain gazelle
#

Sometimes it worked with 0,
sometimes it worked with 4

Most often it doesnt work with 0,
Most often it doesnt work with 4

Seems like server restarts just choose something at random ๐Ÿ˜ญ

plain gazelle
#

apparently null works now?? D: im confused

unique crane
#

Okay that is weird

celest thorn
#

How do i make a gun shoot at someone even if they are in great distance?

#
        NetworkWriterPooled writer = NetworkWriterPool.Get();
        int headerPos = writer.Position;
        writer.WriteByte(0);
        int payloadStart = writer.Position;
        
        writer.WriteRelativePosition(new RelativePosition(player.Position));
        writer.WriteQuaternion(player.Rotation);
        writer.WriteReferenceHub(Player.DummyList.First().ReferenceHub);
        writer.WriteRelativePosition(new RelativePosition(Player.DummyList.First().Position));
        
        int payloadEnd = writer.Position;
        writer.Position = headerPos;
        writer.WriteByte((byte) ((payloadEnd - payloadStart) & 0xFF));
        writer.Position = payloadEnd;

        NetworkReader reader = new(writer.ToArraySegment());
        
        new ShotBacktrackData(reader).ProcessShot(item.Base, null);
#

I tried this

#

but nothing

#

oh wait

#

why am i writing this info lol

#

it works im stupid

restive turret
#

Lel

#

Would say something mean but

#

It's at 1 am so.

Good job now GO to SLEEP

celest thorn
#

Im still working

#

But im about

#

Its all day

barren pasture
#

Working with RueI 2 to figure out how the fuck it works, and an example uses this code: AutoElement.Create(Roles.Scps, MyElement).UpdateEvery(TimeSpan.FromSeconds(0.7));, yet I can't find AutoElement.Create. The hell am I doing wrong?

true cedar
#

but also

#

ruei v2 is being replaced with ruei v3 which is literally better in every way

#

so i wouldnt recommend trying to learn 2

barren pasture
#

I already looked at three, I thought they were gonna be somewhat similar at least, but no. Completely different.

true cedar
#

well yea

#

its a near complete rewrite

#

its a lot easier to use tho so

barren pasture