#plugins-dev-chat

1 messages · Page 53 of 1

upper vapor
#

Csproj

restive turret
#

Ah ye

upper vapor
#

Tf is this window

restive turret
#

Because rider

#

Edit the csproj by hand

upper vapor
restive turret
#

Idk

upper vapor
#

Xd

restive turret
#

I only edited with csproj directly

upper vapor
#

It can't even change the c# version

#

Cuz microsot

restive turret
#

I can in the xsproj file

#

Not in any window

upper vapor
#

But not in the ide's gui

#

Yeah

grand flower
restive turret
#

I think your csrpoj is old

upper vapor
#

Probably

#

Show csproj

#

Must be SDK-style

covert flame
#

See that's what I did right, and guess what, they are still assigned to the group when joining back

grand flower
#

yeah .net standard 2.1 doesn't have it either

restive turret
#

F

#

Ah ye as aywabo said its statted from net7

#

So yeah

grand flower
#

eh i'll whip up something clean without static methods in interfaces

#

just a little annoying

unique crane
grand flower
#

unity moment

restive turret
#

Old c# moment

#

Cant wait unity to be in net8

#

Or well

#

Net10

grand flower
#

mildly annoyed at having to get a hacky workaround

restive turret
#

Since it will took them years

grand flower
#

maybe more

restive turret
#

Well

#

Unity does it every week

#

I'm so glad I don't use unity for gamedev

grand flower
#

C++17 minimum, C++20 supported (mostly)

restive turret
#

That's sucks too for be

grand flower
#

be?

restive turret
#

*mw

#

Me

grand flower
#

how so

restive turret
#

Installing 100gb

#

Or idk

#

Last time it required like 80?

grand flower
#

depends on the optional stuff you add but yeah, it is a bit big

restive turret
#

And also hate writing C++ so that is definitely NOT for me

grand flower
#

actually

#

my install is 80gb but 50gb is from debug symbols

unique crane
#

What the fuuuu

upper vapor
grand flower
#

so if you get rid of that it's more like ~25/26

unique crane
#

50GB of debug symbols

grand flower
#

Yeah, we get full engine sources

#

😎

upper vapor
restive turret
grand flower
#

jokes aside I couldn't imagine like

#

working with a closed source engine

restive turret
grand flower
#

the amount of times I dive into the engine's source per day, couldn't imagine not being able to

restive turret
#

Unity

grand flower
#

im good mmLul

#

i generally compile the engine from source anyway

#

it's needed for advanced stuff

restive turret
#

Ye i aksed ChatGPT for game engines and result was strideFear

grand flower
#

lol

restive turret
#

I mean i was specific what I want

#

Like must be 3rd and C# support

#

Throw godot too but hell nah

unique crane
#

Me when SL itself is 4.5x larger in size than Unity engine itself

restive turret
#

While it calls the engine itself for many shit I ain't wanna touch it

restive turret
#

Many asset

unique crane
#

ik

#

Most of it is just textures and audio

restive turret
#

Me who doesn't even use any texture other then low/very low

#

Btw while you there

#

Check how many space without more than medium texture

unique crane
#

How tf do I do that

restive turret
#

Idk

upper vapor
#

isn't texture downscaling handled by unity?

restive turret
#

Removed texture

#

Idk

#

I never used unity

grand flower
restive turret
#

3d*

grand flower
#

Unreal supports C# if you use UnrealSharp DogKek

restive turret
#

Uh

#

I don't know if want that

grand flower
#

(probs not)

#

not production ready

restive turret
#

Guessed by the KEK

grand flower
#

I mean

#

I'm looking forward to it being stable

#

If anything it'll be nice to add a C# modding layer to games

restive turret
#

Yup

#

Is it os?

grand flower
unique crane
#

Crazy

grand flower
#

tbh I was thinking about Lua for my project's modding layer

#

but if UnrealSharp gets stable & adds Linux support I'll go with it

#

much better

unique crane
#

I like lua

grand flower
#

I love Lua but it can't compete with C# imo

#

for modding

unique crane
#

It has its advantages

#

but also disadvantages

#

but if you look at modding for unreal/other engines

#

its Lua most of the time

#

Its also safe for client mods

grand flower
#

It's probably the easiest to implement

unique crane
#

Because you can disable some packages

grand flower
#

You can do the same with C# provided clients compile it themselves, just a lot more of a hassle

unique crane
#

Yeah but like

#

tell average player to compile c#

#

xd

grand flower
#

Can do it automatically for them

unique crane
#

Eeeeeeehhhh

grand flower
#

Just have to redistribute the compiler with the game

#

s&box does it

#

works fine for them DogKek

unique crane
#

Lua better

slate flume
#

I <3 coroutines

unique crane
#

Its just less work

grand flower
#

I'll think about it

#

I'm fine with putting the work in if it provides a good modding API in the end

unique crane
#

Ill show you what you need to do in c# to run Lua engine

grand flower
#

oh I know, I've implemented lua stuff in games before

#

it's easy

grand flower
#

Unreal also has LuaMachine as a plugin that does it all so

#

pretty simple

slate flume
#

Even Cheat Engine has lua

unique crane
#

Or you can do Python but

#

ew Python

slate flume
#

I mean listen

#

I'll defend python

#

It's great for some things

#

Just not

#

Game development

unique crane
#

Yeah for some fast script and AI

#

sure

slate flume
#

Computational computing with python can be so much better sometimes

#

Partially because there's already so many libraries

unique crane
#

Yeah because you call C functions

slate flume
#

Yeah but I couldn't do it without python

#

I mean I could

#

But it would be

#

Painful

unique crane
#

I mean you can call external libs in C#

slate flume
#

There aren't as many for C#

#

Also like automation and shit

#

I could do this in C# but it would be more complicated

#

The benefit of python is it's high-level nature

unique crane
#

Yes

#

I said that

#

for some fast scripts

#

its good

icy knoll
slate flume
#

Even made a lil math document to go with it

unique crane
#

Me when I actually have general idea of what does it all mean

restive turret
#

Math? Im more of a math person

slate flume
#

I love math

unique crane
#

so true

slate flume
#

I never took comp sci or really any of those kinds of STEM topics outside of like a 10th grade level but I've done enough studying myself to learn a lot of this shit

restive turret
#

Fuck misstyped

slate flume
#

Lmao

#

Slejm you're iconic

hearty shard
#

oh

#

nvm you cant make it forced abstract

#

i dont think

#

why do u even need that

grand flower
#

stuff

hearty shard
grand flower
#

would be cleaner in the interface but it's fine

hearty shard
#

static AND abstract?

grand flower
#

yes

#

i'll just have a registry of handlers to do the same

#

no biggie

upper vapor
upper vapor
upper vapor
upper vapor
restive turret
upper vapor
#

@grand flower ez_2 layout has only 5 end rooms, you could filter out seeds that choose this layout

#

for the red room ensuring thing

grand flower
#

If i can get the data without generating the actual map

#

Otherwise I'll have to restart round with every possible seed hah

upper vapor
#

check the atlas generators

covert flame
# upper vapor can you show your code?

I'm literally just doing ServerStatic.PermissionsHandler.Members[playerUserId] = "usergroup"; if the userId equals something and that code is in the OnPreAuthenticated event

upper vapor
#

yeah

#

but when you want to remove them

unique crane
#

with the Rnd being new Random(Seed)

covert flame
#

Oh, well in the same event, if the userid does not equal that something and they are in that usergroup then I do ServerStatic.PermissionsHandler.Members.Remove(playerUserId);

unique crane
#

and atlas being TExture2D from AtlasZoneGenerator.Atlases

icy knoll
#

does labapi replace " with ' in yaml configs or YamlDotNet?

unique crane
#

YamlDotNet does that

icy knoll
#

damn it

#

i have this config value @"[^a-zA-Z0-9\s,.!?']"

#

but yamldotnet keeps on fucking up people's configs when it generates

#

so much fun

upper vapor
#

you could match non-word characters too

#

or

#

word chars

icy knoll
upper vapor
#

wait

#

what'§s tthe exact purpose of this regex

unique crane
#

And do you really need to put it in config

icy knoll
icy knoll
upper vapor
#

then

#

\w does that

unique crane
#

Yea

icy knoll
unique crane
#

Regex

#

\w

upper vapor
#

\w matches any word character

#

\W matches any non-word character

royal mica
#

Doesn't \W match ?!:; as well?

upper vapor
#

yes

icy knoll
#

to allow it

royal mica
upper vapor
#

yamldotnet should escape it for you

unique crane
#

Why do you put regex in there actually

#

Like... almost every country will have to put their alphabet in there

icy knoll
unique crane
#

\w wouldnt work for Czech for example

icy knoll
unique crane
#

as we have to add our

icy knoll
#

you can remove it

unique crane
#

I though its allowed messages regex

icy knoll
unique crane
#

Okay fine then

icy knoll
#

if it doesn’t pass then msg goes through fine

unique crane
#

Alright

upper vapor
#

good luck with homoglyphs toomuchtrolling

icy knoll
#

well the regex doesn’t allow anything that isn’t a-Z 0-9 lol

covert flame
upper vapor
#

check the members dictionary in the joined event

covert flame
upper vapor
slate flume
#

Why does doing this cause my grenades to do crazy damage?

#

It's enough for the grenades to one-shot someone at 1000 hp

#

And it's not that the fuse end code is running multiple times, I tried adding a clause to fix that and it didn't work

upper vapor
#

you need to get the root transform and trygetcomponent that

icy knoll
#

collider.transform.root

spare zodiac
#

how cool would it be if we could force player to move their cursor and not their camera? Like imagine getting them to click on hints and that could cause event if certain tag would be used for text.

icy knoll
icy knoll
#

not really

worthy rune
icy knoll
#

they are asking for a way to move a cursor

#

atleast that's what it seems like

worthy rune
#

yeah, the upside would be pretty huge if done correctly

#

and they are asking for something like using TMPs Link(similar to how its done in the RA)

icy knoll
#

i dont think a plugin having mouse access is at all good for security

#

link will be messy tho

#

imagine someone puts a link over the whole screen or smth

#

oops

#

clicked

worthy rune
#

think of the interactable toy but for the UI, they wouldnt have access to where the click was made(unless they used 100s of them)

#

you need both the free cursor msg and TMP link to make it work

spare zodiac
spare zodiac
spare zodiac
#

I am thinking of this for medical system I am currently making or generally NPC interaction some dialogue type thing or shop interaction

when I look at this I don't feel like this would be great making it where they would press key it would bring the cursor instead and if they would press esc similar to pressing p telling them press "key" to untoggle cursor

true cedar
#

at some point just make a new game

hearty shard
#

atp KILL PAI

true cedar
#

yeah okay

#

mods

spare zodiac
spare zodiac
# true cedar mods

modification of the game would not be very great, because not everyone knows how to do stuff with computer and NW developers expressed already that automatically downloading stuff would not be good idea at all.

spare zodiac
true cedar
#

yea

pastel bramble
#

silly idea but does anyone know how to add music into an elevater in scp sl

pastel bramble
#

mhm.....

spare zodiac
#

you can get the gameobject of elevators and make coroutines of teleporting the speaker to elevator and play music inside

upper vapor
#

just parent the speaker to the elevator chamber

spare zodiac
#

btw any ideas what RP mechanic could I make?

pastel bramble
pastel bramble
spare zodiac
pastel bramble
#

or what ideas you got

spare zodiac
pastel bramble
#

hmm......

spare zodiac
#

everything can be then used by developer, fully modular plugin

pastel bramble
#

ok what about if you had something along the lines of a minimap for ntf

#

heard the idea from a friend

spare zodiac
pastel bramble
#

i added mc donalds into scp sl using mer

spare zodiac
#

implementing it as custom item similar from contaiment breach

spare zodiac
pastel bramble
#

yeah

pastel bramble
spare zodiac
#

now SCP:SL players can get a job

pastel bramble
#

mhm

spare zodiac
pastel bramble
#

i need to thank @rose bridge for the actual like design he made it i put it ingame and did more stuff to make it more fun

#

he is truly a legend

spare zodiac
#

this is my chemical system alone

pastel bramble
spare zodiac
#

there could be way more implemented into it, but yeah I will have whole summer to work on this bad boy

pastel bramble
#

you could try adding something along the lines of a sheild

pastel bramble
#

no prob u deserve it

spare zodiac
pastel bramble
#

what about just diffrent clasases

spare zodiac
#

what pmo me is the corpses where they are not synchronized with the client side and I can't get the client to return gameObject they personally see

pastel bramble
#

like a tank or a medic?

spare zodiac
#

custom roles could be made, but that's already been done by frameworks and developers/players can make it with other plugins

pastel bramble
#

mhm......

spare zodiac
#

I love C#

pastel bramble
#

i dont know tbh you could try adding something along the lines of like sneaking below something

#

to hide

#

i dont know

#

dead by daylight ah lockers

spare zodiac
#

I can make players be able to sit into chairs Trolley

pastel bramble
#

yassssssssss

spare zodiac
#

I would love to use navmesh and make more NPC's, but I've heard that HCZ is absulutely fucked and Navmesh path can't be calculated correctly

restive turret
#

We cooking at this facility

#

🔥

spare zodiac
#

I provided classes that can be just inherited and then use method RegisterAll to automatically register the thing you added

restive turret
#

Do we have a table or what

spare zodiac
#

table?

restive turret
#

Or whatever the thing that mix

spare zodiac
#

the thing in SL I have no clue how it's called rn

#

centrifuge yeah

restive turret
#

Ye

#

Wait

#

Centrifuge is not that

#

Thanks to gregtech(!) its not a mixer

spare zodiac
restive turret
#

Can be simply named "Mixing Bowl" or smth

spare zodiac
restive turret
#

I didn't see any basegame model for centrifuge

spare zodiac
#

it is in 939 and micro HID lab

restive turret
spare zodiac
#

centrifuge

restive turret
#

Ohhh

#

Yes that's a centrifuge

#

As i see used for blood

#

Cant wait to make a custom map for it that goes same as "No Mercy"

unique crane
#

Oh woah woah

#

I wanna do payday gamemode

spare zodiac
#

david waduup

spare zodiac
#

I made drug system in SL

restive turret
#

The goat

#

David

#

Can we have navmesh in rooms

spare zodiac
#

navmesh is not hard to make, though NW premade thingy that would actually work would be useful

restive turret
#

Wish me luck, gonna learn how statemachine works

spare zodiac
#

what are you talking about

plain gazelle
restive turret
spare zodiac
#

there is MIT premade pathfinding

restive turret
#

What does that mean

spare zodiac
#

lemme give you the github link

restive turret
#

Oh I wanna make my own ai

#

Which is need high amount of work

#

And understand many stuff

#

I got the basic like.
"Go there, get this".
But dont really have a goal system or anything

spare zodiac
sinful bronze
#

switfkraft 🙏

restive turret
#

Damn

upper vapor
#

but unity's animator doesn't have an "any state" per sub-state machine

severe cave
restive turret
#

By power of magic

severe cave
#

I asked the creator and helped me a lot with this but at the end I couldnt spawn a dummy

spare zodiac
spare zodiac
hearty shard
#
public static ReferenceHub Spawn(string nickname, RoleTypeId role, Vector3? position = null)
        {
            GameObject gameObject = Object.Instantiate(NetworkManager.singleton.playerPrefab);
            if (!gameObject.TryGetComponent(out ReferenceHub refHub))
                throw new InvalidOperationException("[Npc.Spawn] Could not find ReferenceHub");

            try
            {
                refHub.authManager.UserId = PlayerAuthenticationManager.DedicatedId;
                refHub.authManager.SyncedUserId = PlayerAuthenticationManager.DedicatedId;
                refHub.authManager.InstanceMode = ClientInstanceMode.DedicatedServer;
            }
            catch
            {
                // ignore
            }

            NetworkServer.AddPlayerForConnection(new NpcNetworkConnection(), gameObject);
            refHub.nicknameSync.MyNick = nickname;

            Timing.CallDelayed(0.1f, () =>
            {
                refHub.roleManager.ServerSetRole(role, RoleChangeReason.RemoteAdmin);
                if (position.HasValue)
                    refHub.TryOverridePosition(position.Value);
            });

            return refHub;
        }
#
public class NpcNetworkConnection : NetworkConnectionToClient
    {
        private const string DummyAddress = "127.0.0.1";

        private static int _idGenerator = ushort.MaxValue;

        /// <summary>
        /// Initializes a new instance of the <see cref="NpcNetworkConnection"/> class.
        /// </summary>
        public NpcNetworkConnection()
            : base(_idGenerator--)
        {
        }

        /// <inheritdoc />
        public override string address { get; } = DummyAddress;

        /// <inheritdoc />
        public override void Send(ArraySegment<byte> segment, int channelId = Channels.Reliable)
        {
        }

        /// <inheritdoc />
        public override void SendToTransport(ArraySegment<byte> segment, int channelId = Channels.Reliable)
        {
        }
    }
spare zodiac
#

I am happy for Exiled 🙏

hearty shard
#

anyone know anything about coroutines and idle mode ?

#

coroutines to my knowledge should work normally but dont appear to for me

spare zodiac
hearty shard
#

update status just has a logger.debug really

spare zodiac
# hearty shard

I don't see any way a null value could come into contact causing it to stop, are you sure that you've implemented timing.startcoroutine?

celest thorn
#

so you cannot do much

#

to 10

#

you need to disable it

hearty shard
#

Timing.RunCoroutine(UpdateStatusTimed(), Segment.RealtimeUpdate, Server.Host?.GameObject);

hearty shard
#

about to find out if that works

upper vapor
celest thorn
#

The time scale does change

#

best is doing a fix update

hearty shard
#

RealTime shouldnt

#

be affected by that

upper vapor
#

try it ig

hearty shard
#

thats the plan

celest thorn
#

thats sure to work

upper vapor
#

i wanna know if realtime update is realtime or not

celest thorn
#

the name implies that

hearty shard
#

YIPPIE

celest thorn
hearty shard
#

and now i dont update if status is the same

celest thorn
#

CRAZY

#

nameless is about to rewrite math

hearty shard
#

what

celest thorn
#

namless

hearty shard
#

its a player count.

#

...

celest thorn
#

can you make math 2.0

celest thorn
#

;(

hearty shard
#

i understand you

#

but anyway

celest thorn
#

yea i guess it is realtime

upper vapor
viral rivet
#

Is there a way to remove the * symbol from nicknames?

upper vapor
#

no

#

for player area you can hide the nickname and use custom player info

random scaffold
#

how i can get slot where item and replace him?

upper vapor
#

no

#

item order is entirely clientside

#

youc an try to clear the inventory and give it in the order you want but isometimes it gets reversed

random scaffold
#

bruh

plain gazelle
#

So LockerChamber.GetAllItems() doesnt seem to.. "work"? quite right for any locker except the 3x3 weapon lockers?

If i print out all items inside a locker like this:

for (int i = 0; i < locker.Chambers.Count; i++)
{
    response += $"- Chamber {i}";

    HashSet<Pickup> set = new(locker.Chambers[i].GetAllItems());
    response += $" (contains {set.Count} items)\n";
    foreach (var item in set)
    {
        response += $"   - {item.Type}: {item.Serial}\n";
    }
}
return true;

For lockers like the first aid boxes, weapon lockers or vertical lockers, it ""misses"" a few items...?

Here is a recording of me executing that code (it grabs the nearest locker and loops through it)

#

Does anyone have any information on this? Why does this happen :(

random scaffold
#

nw moment

grand flower
#

!vsr

regal lakeBOT
royal mica
#

I wonder if 4 thousand primitve cubes can be optimized somehow

#

with RigidBodies as well

random scaffold
#

texttoy will be spawn for new clients?

royal mica
#

spawn one, reconnect and check

#

but it should spawn cause Sync no?

hearty shard
#

its a network object

#

so yeah will syng

#

Sync

true cedar
#

it will sing

spare zodiac
hearty shard
royal mica
#

Though that could work

#

but then I cannot clean it up for clients

spare zodiac
#

design builds on server side and then when everything is by your liking have it only for client side

royal mica
#

what

#

I'M not talking about MER or other pre defined builds

#

This are pure dynamic simple cubes icant

grand flower
royal mica
#

These CANNOT be pre-defined

spare zodiac
#

could you elaborate what do you mean then?

hearty shard
#

Idk

#

It might be wonky

royal mica
#

The problem I think is all the syncing is taking up all the resources

#

since all of them are synced individually

hearty shard
#

Make them static

#

Only need to sync once

royal mica
#

I was thinking maybe introducing a clustering mechanism where a few of them are groupped and them synced as one instead of individually

royal mica
hearty shard
#

hm

royal mica
#

I think is beyond the possible of implementation

glacial onyx
#

sorry if this is a dumb question, i have never coded a .net mod like this but how can i fix this?

royal mica
#

"fully dynamic, on demand generated, physics enable multiple objects"

glacial onyx
royal mica
hearty shard
#

^

glacial onyx
#

idk what that is 😭

hearty shard
#

where is Plugin from

royal mica
#

What language do you know?

#

so I can translate so you understand

hearty shard
glacial onyx
#

i got it from the wiki under labapi on github

hearty shard
#

hover over the Plugin part

#

Does it say its from labapi

glacial onyx
#

no

#

wait a moment

hearty shard
#

where is it from agony

royal mica
#

wtf

glacial onyx
#

am i supposed to install labapi onto my project

royal mica
#

inb4 Exlied

hearty shard
#

yes

royal mica
#

Yes

glacial onyx
#

okay

#

i thought so

hearty shard
glacial onyx
#

how do i do this

royal mica
#

you cannot develop a LabAPI plugin without LabAPi

glacial onyx
hearty shard
#

yes but whats Plugin in

glacial onyx
hearty shard
#

i swear thats not a system thing

glacial onyx
#
{
    public class Plugin
    {
    }
    public class hello : Plugin
    {
        public override string Name { get; } = "My First Plugin";

        public override string Description { get; } = "This plugin does magic!";

        public override string Author { get; } = "Me!"

    public override Version Version { get; } = new Version(1, 0, 0, 0);

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

    
}```
hearty shard
#

Oh

#

Yeah...

glacial onyx
#

this is my entire file

hearty shard
#

You cant create your own Plugin

royal mica
#

Yeah that explains lol

glacial onyx
#

i see

hearty shard
#

i dont remembered how to explain nuget

#

Uhh

#

R u using VS?

glacial onyx
#

yeah

#

i js did whatever the wiki said

royal mica
hearty shard
#

you can google "how to use nuget package in Visual Studio"

#

you need Northwood.LabAPI

glacial onyx
#

from nuget?

hearty shard
royal mica
#

(don't follow this)

hearty shard
#

Youll also need access to basegame dependencies

glacial onyx
#

wait

#

okay yeah i see labapi in nuget

hearty shard
glacial onyx
#

how do i do that too

#

sorry for the questions the wiki doesn't really explain this 😢

royal mica
#

Well, the wiki mostly assume you have C# knowledge, that is why it is not detailed to that level

glacial onyx
#

i see

royal mica
#

(nothing wrong with it, just explaining why)

glacial onyx
#

yes of course

#

i am not that crazy of a programmer if you couldn't tell

royal mica
#

Nah, everyone starts somewhere

#

enjoy the journey, aim for greatness and just press on

glacial onyx
#

great words

royal mica
#

it is very fun if you get the hang of it

glacial onyx
#

i am trying

true cedar
#

um

#

thats an insane name and pfp

glacial onyx
#

it is...

hearty shard
true cedar
#

stfu

hearty shard
#

ok well

#

ur not..

#

like that

true cedar
#

theres a BIg difference

hearty shard
#

but ur pfp still insane

glacial onyx
royal mica
#

you need to download the SCP Server

glacial onyx
#

i have one of these

royal mica
glacial onyx
#

i am assuming in the LabAPI folder?

#

yes

royal mica
#

no

glacial onyx
#

oh

royal mica
#

You need the DLL files from the Managed folder

glacial onyx
#

OHHHHH

hearty shard
glacial onyx
#

bro thank you that makes so much more sense now

royal mica
grand flower
royal mica
#

damn

glacial onyx
#

@royal mica @hearty shard i have now gotten it to work, i sincerely thank you both

royal mica
#

Nice!

#

What are the plans to create?

random scaffold
royal mica
#

wait

hearty shard
#

or so i heard

glacial onyx
hearty shard
indigo mossBOT
#
sqbika
Which age range are you in

1⃣ <18
2⃣ 18-24
3⃣ 25-34
4⃣ 35-44
5⃣ 44+

royal mica
hearty shard
#

nice poll

glacial onyx
#

at random points in time, you will get a slight blinding effect and your movement will be slowed unless u itch urself by pressing a key

#

😄

hearty shard
#

😭

royal mica
#

discord literally has a poll thing, and this thing still uses that shit

lethal cradle
#

im deffinitly 5

slate flume
#

Okay

#

Still doing a lot of damage?

slate flume
#

Ignore the other shit that doesn't matter

#

For some reason fuse-ending a grenade on collision causes it to do a ton of damage

#

I don't know why

teal junco
#

@jonny

#

kyle rittenhouse spoted making plugins in labapi

slate flume
#

Hey look I fixed it

#

Just don't use FuseEnd ig

plain gazelle
#

Using
IFpcRole.FpcModule.CharacterModelInstance.transform
Would it be possible to parent a gameobject to a bone of the player?
Im trying to do that currently but the object just kinda.. disappears, even though the coordinates and all stay the same

grand flower
#

Make sure you reset the location after parenting

#

or call Transform.SetParent(parent, false)

#

by default it seems like it modifies the relative position/rotation to keep the same world position/rotation

plain gazelle
#

Will try, thanks

plain gazelle
#

Cant get it to work
Printing the world and local position of my object before and after parenting and its all exactly as it is supposed to be, but my object just poofs

#

will give up on it for today FoxxoExhausted

grand flower
#

Parent it, set local position/rotation to vector3.zero, quaternion.identity

plain gazelle
#

didnt work

grand flower
#

oh wait

#

can you print out the position of CharacterModelInstance.transform

#

and compare to the position of the player

#

i'm guessing there's some tomfoolery

plain gazelle
#

Printed the entire hierarchy out once and it was like two hundred things

grand flower
#

just print out the transform position of CharacterModelInstance to check if it matches the player's

plain gazelle
#

i will note this task down and come back to it, 3am here x.x

teal junco
#

parenting to non networked objects doesnt work the same anymore

#

it wont show up

#

youll have to run a coroutine constantly setting pos and rot

upper vapor
upper vapor
#

you could make a coroutine/component that updates the networkposition of the primitive to the toy's world position
disable the toy component on the server and boom
and please cache the transform of the primitive
this way you can set the parent to a non-networked object

#

there will be some delay though

icy knoll
#

just found out that typescript has static abstract methods... beat that c#

royal mica
#

why do you even need static abstract

upper vapor
#

generics

royal mica
#

it is kinda counter productive putting a static in abstract class no?

icy knoll
upper vapor
#

span parsables

icy knoll
#

here is my typescript code, in C# I think you can just new straight off of a type generic. for typescript that doesn't work as typescript isn't technically a language, all types and generics are stripped once you build...

upper vapor
#

generic new only works with a parameterless constructor

teal junco
#

Whats the difference between the C# version and the DotNet version

upper vapor
grand flower
#

wish I had static abstract for what i'm doing

upper vapor
# royal mica it is kinda counter productive putting a static in abstract class no?
public interface ISport
{
    static abstract bool IsTeamSport { get; }
}


public class Bowling : ISport
{
    public static bool IsTeamSport => false;
}

public class Swimming : ISport
{
    public static bool IsTeamSport => false;
}

public class Football : ISport
{
    public static bool IsTeamSport => true;
}

public class Cricket : ISport
{
    public static bool IsTeamSport => true;
}

and then you could do

public static void DoSomething<T>(T sport)
{
    Console.WriteLine($"{sport.GetType().Name} is {(T.IsTeamSport ? "" : "not ") a team sport.");
}
#

not the best example but it works

grand flower
#

mfw could just be ITeamSport : ISport

upper vapor
#

yeah

grand flower
#

/s

upper vapor
#

the first example i could find was this 😭

grand flower
#

in my scenario I needed to have a static interface method that returns a newly constructed object of the class that implements it

upper vapor
#

you can overload operators with static abstract
UnitsNet for example, does this

grand flower
#

but it's fine, went around it

upper vapor
#

cuz no new(param) exists with generics

upper vapor
restive turret
#

No

upper vapor
#

me when you can't use T : new() with required members

restive turret
#

Java behavior

grand flower
#

tbf it wouldn't have worked anyway in the end

#

for my stuff

#

realised it a few minutes ago heh

upper vapor
#

ILoggerFactory

grand flower
#

since i'm reading binary data

#

can't read generics

upper vapor
#

you can

restive turret
#

IDyingFactory

upper vapor
grand flower
#

can't cleanly read generics

#

just went with an enum id and a dictionary id => handler

#

easy peasy

upper vapor
#

fair

upper vapor
# icy knoll here is my typescript code, in C# I think you can just `new` straight off of a t...

Check out my courses: https://dometrain.com
Become a Patreon and get source code access: https://www.patreon.com/nickchapsas

Hello everybody I'm Nick and in this video I will introduce you to what is in my opinion the weirdest but also the best C# 11 feature and that is static abstract members in interfaces. The concept of having implementation...

▶ Play video
grand flower
#

also got versioning and all

#

so can't use types directly

#

that'd be hell to version

royal mica
#

You know why I do not really get static abstract? How do you define the body?

upper vapor
#

like with other methods

royal mica
#

static functions are inherited?!

#

as in like they can be redefined in child class

#

whut

upper vapor
royal mica
#

so you technically just shadow the original static function

upper vapor
#

ye

restive turret
#

You can see how its done in newest .net

#

Basically whats the IMinMax or something was ir

#

Y'know
int.MinValue
ulong.MinValue
That is from static abstract & interface

royal mica
#

oh the new keyword literally does nothing

restive turret
#

You cant use static abstract before net7

royal mica
#

In the case of static abstract you don't even need new

upper vapor
#

yeah

restive turret
#

Ye

#

But for example You can do is

#
interface IDefault<T>
{
static abstract T Default { get; }
}

class IdStuff : IDefault<IdStuff>
{
int id = 0;
public IdStuff(int id) { this.id = id;}
static IdStuff Default => new(0);
}

#

Or smth

upper vapor
#

yea

restive turret
#

I would use it but sadly

#

I have to support net standard

upper vapor
#

it's not in .NET Standard

restive turret
#

Ye

#

Read again

upper vapor
#

oh

#

english moment

#

makes sense

hexed girder
#

is there a method to create custom keycards?

restive turret
#

Yes

#

2 actually

#

Run a command

#

Or use LabApi's wrapper of KeyCard

slate flume
#

I made one recently

#

It could be better optimized

#

But I was lazy

upper vapor
#

me when

#

tuple

#

use valuetuples
(string, T)

slate flume
#

What's the difference?

upper vapor
#

Tuple<T...> is a class, so it allocates memory on the heap

#

ValueTuple<T...> is a struct (and has parenthesis syntax)

slate flume
#

Oh cool

#

So just replace Tuple with ValueTuple for free optimization

upper vapor
#

bascially, yeah

#

don't write ValueTuple out

#

the parenthesis syntax kinda actually makes sense

slate flume
#

How do I

#

Access items in the ValueTuple

upper vapor
#

you can name them

hexed girder
upper vapor
#

or .Item1

#

.Item2

#

liike you can do

#

static (string Name, T Metric) BestPlayer<T>(...)

slate flume
#

OH

#

I see

#

Okay

#

Gotcha

#

Gotcha

#

That actually

upper vapor
#

btw you can deconstruct them

slate flume
#

Makes my implementation cleaner

upper vapor
#

var (name, metric) = BestPlayer<T>(...)

#

if you prefer explicit types (string name, T metric) = BestPlayer<T>(...)

slate flume
#

Thank you @upper vapor very cool

#

I learned something new today :)

upper vapor
#

np

#

i used to use keyvaluepairs for this stuff back in the day 😭

slate flume
#

The ?

#

Just so I know when something is intended to be null vs not

upper vapor
#

oh wait

#

you can't deconstruct a nullable tuple

#

like this thing (string, T)?

slate flume
#

.Value

#

👍🏼

upper vapor
#

after the null check you can

slate flume
upper vapor
#

i mean what if you return a non-nullable tuple

slate flume
#

Wdym

upper vapor
#

like it can't be null

#

only default

#

and then you'd check if the nick is null

slate flume
#

I only return null when like

#

The dictionary is empty

#

Just cases where I can't ascertain the best one

#

Otherwise I return the tuple

#

That's the only reason I do it like that

upper vapor
#

so you can directly deconstruct it

slate flume
#

Oh shit

#

So I can just

#

Return the defaunt ValueTuple

upper vapor
#

ye

slate flume
#

And then check for that

#

That's baller

#

One sec

upper vapor
#

like
return default
and var (bestSomethingNick, somethingCount) = BestPlayer<>()
then if (bestSomethingNick != null)

restive turret
#

you can even just use _ to not do anything with it

#

Like

slate flume
#

Very cool

restive turret
#

var (onlyNickProcess, _) =...

slate flume
#

No longer need to make the types nullable

#

I just

#

Check default!

upper vapor
restive turret
#

Ye

upper vapor
#

not sure which would be less characters lmao

slate flume
#

Lmao yeah

#

I'm fine with this

#

It's pretty readable I'd say

#

Moreso than before definitely

#

I used to do shit like this:

#

Now I can do it better SunglassesThumbsUp

#

I don't need the comment to explain it anymore!

upper vapor
#

discards

upper vapor
slate flume
#

Peak

#

Grossssss I can fix it now!

restive turret
#

Why not just make a class

#

Or struct

#

That contains these

upper vapor
#

you can also do using Whatever = (RoleTypeId, float, float, float);

#

tuple aliases since C# 10

#

if you need a separate type, create a (readonly) record struct

restive turret
#

Is record even available

#

In net48

slate flume
#

Beautiful

restive turret
slate flume
#

I just changed every tuple in my plugin to ValueTuple

slate flume
upper vapor
#

just add sealed class IsExternalInit; in the namespace System.Runtime.CompilerServices

slate flume
#

My code reads so much better now

#

No more x.Item1 and y.Item2

restive turret
#

R u sur

slate flume
#

I mean

#

It's not like I can even read half the shit I write anyways

restive turret
#

Real

slate flume
#

I should add comments

#

I mean

#

I understand it

#

But it

#

Kind of sucks

#

I wrote most of my bodyguard code high lmao

restive turret
#

Hmm what are you doing

slate flume
#

I'll show you the full thing

slate flume
#

But it works

#

And that's what counts?

#

I think?

upper vapor
#

.ToList().OrderBy

#

don't allocate a list for that

restive turret
#

Should do break if not alive

slate flume
upper vapor
#

or which one

restive turret
slate flume
#

But I

#

May spawn the dummy back in

restive turret
#

Oh u

slate flume
#

So I want the routine to continue

restive turret
#

Ah k

upper vapor
#

also your loop condition will never be false

slate flume
#

Sometimes is

upper vapor
#

no

#

it won't change

slate flume
#

.

upper vapor
#

yeah but

#

whatever

slate flume
#

I sometimes

#

Destroy the dummy and forget to delete the coroutine

#

And then it's null

upper vapor
#

if you destroy the dummy while the coroutine is running, the player will not be null

slate flume
#

But when I added logging before and after doing the referenceequals my code fixed it

upper vapor
#

you should check if the player's referencehub is not null

#

you're storing a reference to the dummy wrapper
that reference cannot change, only the objects in it
if you destroy the dummy, that destroys the gameobject, but the player wrapper doesn't suddenly disappear from memory, because you still reference it

slate flume
#

See the weird thing is that my code worked

#

The only reason I ever do ReferenceEquals bullshit is because it fixed something

#

I avoid it otherwise

#

So at some point the player does evaluate to null according to that

#

Idk how or why

#

I just know it does

#

And I fixed my headache by doing that

upper vapor
#

you can't tell me that the loop quits if the dummy gets destroyed

slate flume
#

Iirc it does haha

upper vapor
#

oh right

#

cuz isalive throws if the dummy is destroyed

slate flume
#

Lmao so my code is working because of an error

#

That's funny

#

I feel like we've talked about this before

#

I literally cannot tell you why checking the player for null works

upper vapor
#

yeah that's for events when the player can be null at a specific point in time

slate flume
#

But it does

upper vapor
#

but not across longer periods

#

you still have a reference to the wrapper so ReferenceEquals will never be false if the loop started

#

the only reason why the coroutine stops is

#

an exception

slate flume
#

I will

#

Have to check that with LocalAdminLogs

#

Let me test

#

Interesting

#

So

#

It appears

#

The coroutine keeps going

#

So I was wrong GoodOne

#

It happens a lot

#

Lmao

#

No exception though

#

Which is weird

#

Their referencehub

#

Is not set to null?

upper vapor
#

it should become null

slate flume
#

For some reason

#

It doesn't

#

So I commented out the bit that kills the coroutine

#

I forgot I added that

#

So this is purely an experiment

#

The dummies are gone but my console is still getting spammed

#

This is peculiar

hearty shard
#

btw

#

if (dummy.ReferenceHub)

#

works

#

its a unity life check

#

or smth

slate flume
#

Oh interesting

#

It's weird that

#

But not

upper vapor
#

nullable references moment

#

cuz the IDE doesn't see the null check

slate flume
#

Oh

#

You right

#

Wait

#

But usually it tells me to switch to unity lifetime checks

hearty shard
#

This warning is shown if a type deriving from UnityEngine.Object uses either the null coalescing (??) or null propagation or conditional (?.) operators. These operators do not use the custom equality operators declared on UnityEngine.Object, and so bypass a check to see if the underlying native Unity engine object has been destroyed. An explicit null or boolean comparison, or a call to System.Object.ReferenceEquals() is preferred in order to clarify intent.

slate flume
hearty shard
restive turret
upper vapor
#

why are you using lastordefault ClassD_Hollow

upper vapor
#

if you were using nullable

slate flume
#

And sometimes it doesn't have the room when the server is starting

upper vapor
#

wtf

restive turret
#

I using nullables and doesn't scream for that

hearty shard
upper vapor
#

yes

hearty shard
#

or smth

slate flume
#

LastOrDefault

upper vapor
#

or how about you wait until waitingforplayers

slate flume
#

I do

#

Lmao

restive turret
#

Then wait after a few sec

slate flume
#

Well

upper vapor
slate flume
#

I wait for round start

#

Which happens after waiting for players

upper vapor
#

do they not remove the room when it's destroyed??????

slate flume
#

Apparently not lol

slate flume
upper vapor
#

😭😭

restive turret
#

Skull

slate flume
#

I thought the room would always be loaded by the time the roundstarted event is called

#

But apparently not lmao

#

So I wait

#

One frame at a time

#

Most of my code is jank because something on Northwood's end is weird

hearty shard
slate flume
#

I wish I could say that Room.List doesn't include stale references but in my experience it sometimes does

#

When the round starts, sometimes trying to find the room doesn't work, or it grabs a bad reference

#

So the .Base is null

#

So I wait until I find one that isn't bad

#

🤷🏼

restive turret
#

I aquire you to make a payday gamemode in sl

upper vapor
restive turret
#

Wair that requires AI too

#

😭

slate flume
#

I could try making some bots

#

Lmao

restive turret
#

I trying that too

slate flume
#

I already did dummy bodyguards in the most jank fashion

restive turret
#

W/o navmesh

slate flume
#

Yeah w/o navmesh is tough