#plugins-dev-chat
1 messages ยท Page 39 of 1
I'm reasonably confident it's NetworkServer.tickRate but idk if I should use that or NetworkServer.actualTickRate or something else
i think theres a Server.Tps prop
@upper vapor Thank you for the resources and help, btw
I found a perfect way to play sounds at slower or faster speeds
np
what method did you end up with?
procrastination
btw theres a Predicate<T> type perfect for these scenarios
although i think an ienumerable<player> would be better ngl
isnt the predicate type somewhat deprecated, as in microsoft dont want you to use it
mirror docs:
Obviously, the host can cheat. If you cheat on LAN then you need professional help.
peak
?
no?
guidelines say to use func but
thats for linq only
yeah, all i can find is that it existed before action/func. not really anything that says you shouldn't use it tho
i do prefer func as its a more commonly used type
I basically copied the resampling method since it was ultimately all I needed
I didn't want to add another library for what is really a relatively simple function
Perhaps we can add another task to already giant list of todos
Networked audio modifiers xd
(pitch,speed)
๐ญ
how about we just network entire audio files
hopefully nobody sends 1gb audio files over the server
death
streaming != sending the whole shebang at once
is there a Event that check if player changed attachment of the gun or can u just prevent player from changing attachment of the gun?
Sorry but not as of right now
You can patch the AttachmentSync
To add temporary for yourself
damn
i just had interesting idea
why not pool eventargs classes
because every event being invoked allocates an eventarg object even if theres no handlers for it
Also other question when u use PlayerUsedItemEventArgs is there a way to cancel the effects of the used item like SCP207 giving u the effect of SCP207 or painkillers to heal u
PlayerUsingItem
ev.IsAllowed = false
pretty sure that works
or you can make a patch
its such a minor allocation that its not really worth it
i believe the problem with pooling them is that some people will hold on to references to event args and process them at a later time
(i do this)
yes, copying references to everything into your own variables
but is it worth the hassle that pooling eventargs actually matter
there was some places where it did matter tho, which is why its still something to look into. most notably the FPC distributer and ValidatedVisiblityEventArgs
and this
Validated visibility
its just an idea bro
Yep
if you genuinely think its not worth
then fine
but i just thought it could be done / interesting
tbh, for validated visability and voicechatting if that may make a difference we could do a "static" eventarg for that that just gets changed or pooled (although thered only be 1 in circulation per call anyway, as its 1 thread)
i highly doubt someone keeps these eventargs for long as you cant really do much with keeping them
there is a problem i cant do PlayerUsingItem ev.IsAllowed = false bcs i need to do Player__Used__Item
i mean if i do ev.IsAllowed = false the PlayerUsedItem will never happen
then you need a patch
Wakey wakey
https://github.com/northwood-studios/LabAPI/issues/126 i think this is what you are asking for
yep exactly
Im working with old plugins and i found out one of them is using RuntimeAnimatorController, how can i reimport the original content into a .anim to use? because i need to save the animation any way i tried to do it automatically to recompile it, it wouldn't work
So you can use adrenaline without it triggering OnPlayerUsedItemEvent by switching to another item at the end of the animation or by trying to drop it from inventory
oh this is in exiled too lol
foreach (var src in controller.animationClips)
{
var dest = new AnimationClip
{
frameRate = src.frameRate,
legacy = src.legacy,
name = src.name
};
foreach (var binding in AnimationUtility.GetCurveBindings(src))
{
var curve = AnimationUtility.GetEditorCurve(src, binding);
AnimationUtility.SetEditorCurve(dest, binding, curve);
}
foreach (var binding in AnimationUtility.GetObjectReferenceCurveBindings(src))
{
var keyframes = AnimationUtility.GetObjectReferenceCurve(src, binding);
AnimationUtility.SetObjectReferenceCurve(dest, binding, keyframes);
}
var events = AnimationUtility.GetAnimationEvents(src);
AnimationUtility.SetAnimationEvents(dest, events);
string safeName = src.name.Replace("/", "_");
string assetPath = $"{controllerFolder}/{safeName}.anim";
AssetDatabase.CreateAsset(dest, assetPath);
Debug.Log($"[Importer] Cloned '{src.name}' โ '{assetPath}'");
}
Someone knows what's wrong with this? because animation cloned is 0/0 keyframes
What im trying to do is converting RuntimeAnimatorController to AnimationController
what if you cloned the curves
how?
new AnimationCurve(curve.keys)

nope
private static string ExportControllerClips(RuntimeAnimatorController controller, string schematicName)
{
const string animationsRoot = "Assets/Animations";
if (!AssetDatabase.IsValidFolder(animationsRoot))
AssetDatabase.CreateFolder("Assets", "Animations");
string schematicFolder = $"{animationsRoot}/{schematicName}";
if (!AssetDatabase.IsValidFolder(schematicFolder))
AssetDatabase.CreateFolder(animationsRoot, schematicName);
string controllerFolder = $"{schematicFolder}/{controller.name}";
if (!AssetDatabase.IsValidFolder(controllerFolder))
AssetDatabase.CreateFolder(schematicFolder, controller.name);
foreach (var src in controller.animationClips)
{
var dest = new AnimationClip
{
frameRate = src.frameRate,
legacy = src.legacy,
name = src.name
};
foreach (var binding in AnimationUtility.GetCurveBindings(src))
{
var oldCurve = AnimationUtility.GetEditorCurve(src, binding);
var newCurve = new AnimationCurve(oldCurve.keys)
{
preWrapMode = oldCurve.preWrapMode,
postWrapMode = oldCurve.postWrapMode
};
AnimationUtility.SetEditorCurve(dest, binding, newCurve);
}
foreach (var binding in AnimationUtility.GetObjectReferenceCurveBindings(src))
{
var oldKeyframes = AnimationUtility.GetObjectReferenceCurve(src, binding);
AnimationUtility.SetObjectReferenceCurve(dest, binding, oldKeyframes);
}
var events = AnimationUtility.GetAnimationEvents(src);
AnimationUtility.SetAnimationEvents(dest, events);
string safeName = src.name.Replace("/", "_");
string assetPath = $"{controllerFolder}/{safeName}.anim";
AssetDatabase.CreateAsset(dest, assetPath);
Debug.Log($"[Importer] Cloned '{src.name}' โ '{assetPath}'");
}
AssetDatabase.SaveAssets();
AssetDatabase.Refresh();
return controllerFolder;
}
try using SetCurve on the clip instead of seteditorcurve
also debug.log if there are any keys in the old curve at all
btw
couldn't you just
Object.Instantiate the clip
Everything is empty
BUT
if i port the same system to work it on what im using it does
but i cannot export it
because i need the .anim
this maybe?
you mean RuntimeAnimatorController?
the animation clips
else i don't have any idea
and honestly its too important too
nope it doesn't
nothing
this is the unity docs for it btw
im using cedmod and it says my server is whitelisted how should i even fix it
nvm i fixed it
are you
running the player and
then trying to export
no?
like what im trying to do is simple
just get the clips out of the uh
Map Editor uses this
and still tho they are empty
even on MER
but they work fine
like let me show you
if you can
dead
EditorUtility.CopySerialized(originalClip, newClip);
it works in any point
then how need?
you copy the align and pos tags for every line
..
no?
iirc
u can use line indent
huh
how fix vertical?
oh i didnt see the
best option is to not use voffset
its extremely hard to work with
line height tag
But thats how voffset works
Rich text documentation for TextMesh Pro.
Is there a specific reason why hints aren't full screen?
how i can check player is disguised or not?
Like as the 3114?
Ye obv
fake deez
shh
hi eve
Well you have to kinda store the data yourself
resolution
why labapi doesnt have method for change appearance
Where should I post my fork of AdvanceMERTools that uses the new PMER/LabAPI?
there
Github / #1336031121699377213
labapi doesnt mess with fake syncing
thats for exiled to do
*labapi doesnt mess with mirror things
And who are you
u 2
eve moment
and who are you
thx homie
ur best friend!!
Aw
how i can disallow break the door?
doesnt exists ready event or something
Can I fuck with player rotation yet or nah
you can set player rotation with Player.Rotation
And it's synced with client?
Cause when it was NWApi I found out I wasn't able to do that
try it and see
LookRotation will work for pitch
No it won't
I directly use TryOverridePosition, which is exactly what it calls anyways
So you can set vertical rotation AND horizontal rotation @grand flower ?
Because if you're telling me LookRotation works for pitch, you're telling me you can set pitch AND yaw
Because I can set yaw
i remember some guy figured out how to set rotation
don't remember how
check exiled discord ig
I'm gonna crash out
you can set pitch/yaw its through override messages now
are you sure the rotation you are setting is actually changing the pitch?
This is my entire code
I mean I'm pretty sure I'm setting the proper rotation
Considering I grab it before the server actually does anything
Yes
Broke the server with this one 
Oh
I know
Okay what
These are the exact same methods implemented by the Player wrapper
So why does it not work for pitch
It's the same issue as before
Should I attempt this instead?
could be that its being overriden after you set it, its hard to tell when your code runs exactly
Interesting
also isnt that what you are already doing?
I thought you meant sending network connection packets or some shit
well thats what the TryOverrideRotation method does iirc
To make sure it's not being overriden, I'll try a timing.calldelayed on my postfix
Well that's
Something
CallDelayed worked
Why is rotation being set after the ServerSetRole call?
I really should've learned more C# and programming before I attempted doing all this shit lmao
not sure how thats related
does your code have to be in a prefix/postfix, why not try using an event like PlayerSpawned for example
My goal is just to make it so that anytime a player switches between two living roles, their rotation isn't reset
So I looked at the SetRole command and saw ServerSetRole
you should use events if you can get away with it, you should only patch if you really need to
I'll try a thing with ChangingRole and Changedrole
Same thing
That's so odd
Works
Doesn't
Lemme try to find the right amount of time to wait
you could probably just do 0 seconds
0 didn't work
Timing.WaitForOneFrame didn't work
The secret is waiting two frames
Then it works
This isn't even the most lost I've been today
Still no clue why that's happening
The spawnpoint handler sets the rotation but only horizontal
So on role change (after ServerSetRole) the spawn rotation is set and sent to the client next frame with as spawn data
even without RoleSpawnFlags.UseSpawnpoint?
Good question
ONLY throw exception if something has gone wrong
it is not performant to use exceptions
Its not that they arent performant
its that they are gonna break the server
and disconnect client if it happens in some methods
Why are your letters so condensed ๐ญ
Prolly the trash nerd font he's using
Monaspace Radon Medium is much better fr fr
JetBrains Mono does NOT look like this by default ๐ญ
probably because image is squeezed
Why is that the case bruhh
I only did it for testing purposes ๐
Apparently it does
I use default rider settings
what is that warning sign
Clicking it redirects me to
๐คท๐ผ
I thought it was weird too but I got used to it
Might I say though, off-topic, y'all are for real my saviors bro I don't know a lot about game mechanics for this game so it's actually so cool that you guys have been helping me out
?
No news about that my dude
The reason why their font looks wrong
oh ok
Just don't use jetbeans
Too bad the alternatives are horrible
๐๐ผ
Word 2009. You can even have custom syntax highight
Lmao
Oh I see
I like to have a lot of code on screen at once so I Ctrl - MouseWheel all the way out
But it decreases font size to 8
Wow that uh
Was no difference
Let me try that again
I just like being zoomed out
Rider is yelling at you to use guard clauses :3
why are they yelling :(

Where?
there
Not anymore

cuz Player isnt nullable
the player shouldn't be null
Exactly
but you're doing a null check
ur a eve moment
why
this is evephobia
Yep
because the game is dumb sometimes and still invokes the event with a null player?
OH I see
You were telling me to unnest my code
Yeah no I had other stuff to add
yeeeesss
but the id can't be two at the same time
so if you else if the second branch
you could invert the if
What
Yeah which is why the if statements exist
there isn't a scenario where both ifs will execute
Yeah
so if you change the second one to else if
Rider could suggest that you invert the if
if (fall)
{
cancel();
return;
}
if (tesla || crushed)
{
// invert this
}
put the simple conditions first
it's generally easier to read if you filter out the short conditions
hence the name guard clause
?
precisely
Thanks king ๐๐ผ

I'm not good at unnesting code when it comes to things like this lol
I did watch a dope video about it though
W
(another) great code aesthetic video
He gave me major inspiration
I reformatted my coin gambling code to separate the events
So I can handle them in different functions
And it's so much easier to read
the rule of thumb is to put short conditions at the beginning
if only we could switch on translations ids...


I unnest a lot
Is not one-liner
fun fact
uh
Fun fact?
if (!PlayersIgnoring.Remove())
PlayersIgnoring.Add()
i would too

๐ฎ
yep
HOLY SHIT
nanoseconds faster
and if its a hashset the reverse also works (if no add then remove)
also you have a semicolon there not anymore
if i was the goat i wouldnt be so poor ๐
im not old enough 
yeah go back to school
I have secret api!
i hate school
How use
school
i need to know
cuz sunday
Me?
yes
I'm doing remote keycard
what r u using it for

Lmao peak
DoorPermissionCheck.Bypass | DoorPermissionCheck.Role | DoorPermissionCheck.FullInventory
give it that too
after door base
bypass, scps and keycard items are now considered !!!
yes
Very nice
I would lose my shit if I had to make my own SSSS wrapper

do i PR to dev
-# yes
same method name,
oh
whats error
you need the chamber there
yeah
Y'all make my life like 10x better
i didnt know what to call the method ngl
i went off of the IDoorPermissionRequester interface lol
I mean technically speaking it always is a door
So you're good
What generator event do I latch onto lmao I don't wanna trial and error
idk
isnt nullable latest version
go ahead
stylecop :3
i dont think you need full namespace
but then i need to add a using
guh
a single using....
Why do generator events not have ev.CanOpen?
use isalllowed
Doesn't work
nw moment
What if I change doorpermissionsflags on the generator to fake it
you can cancel the event and then open it yourself or play the beep
ev.IsAllowed = false; on the PlayerUnlockingGenerator event doesn't prevent them from interacting with the generator lmao
bruh
Ikr
ev.IsAllowed appears to do literally nothing in the OnPlayerUnlockingGenerator event
My guess is the only thing it works for is preventing a player from unlocking the generator with a keycard if you want to do that for some reason
check github issues
Hahahaha
Love it
I was right
Think I might just transpiler change the if(!ev4.IsAllowed) flag = false; to flag = ev4.IsAllowed
PR made :3
btw
in ur pr
can u just make All = -1
will make it give all 
even if we add
i think
i mean
i dont think sl will ever need any more permission checks
is that really required
isn't Bypass | Role | FullInventory good
o
i see your point
however
idk
fine
how does one trigger a round end with only one player?
I cant find the option in the config
end_round_on_one_player: true
thanks
why doesnt Cassie have a vanilla custom subtitle part?
like there is one already but it just straight up doesnt work
wat
guh
Wrote my first transpiler patch ๐ช๐ผ
It was easier than I thought it'd be, but also I wasn't doing anything crazy
It helps that I used to code Assembly lmao
Feeling pretty high and mighty ngl
Theres a cassie subtitle part called custom but it doesnt actually do anything when you send to a player
i assume youre supposed to use string data with it but that does nothing
uh
NW
:3
i don't think it's possible to mix translated and custom subtitles currently
Wdym
So
theres a subtitletype called "Custom"
and when I send it as part of a SubtitlePart with a string, it just doesnt do anything
david...
here is an example of the exact thing im referring to, when I use custom though it does nothing
can the wrappers for doors and stuff provide IDoorPermissionRequester
without .Base call
i wanna have a single method that can be called with all of them without requiring .Base call
is base call unperformant or just ugly?
either i tell everyone to just .Base it
or
i add a method for every wrapper
or accept my PR :3
yes
however
that does what i want to avoid
so im asking nw for it

dw ur pr will be merged

not sure if they wanna return those base-game stuff
Like deez
a wrapper interface would be okay i guess
Waiter waiter more wrapper please
the base-game interfaces look weird on the wrappers but they are als omore convenient
wrappers are such a funny concept to me and without SL i dont think I would know about it yet
its such a great concept
discord.net does it too
theres a Ffmpeg wrapper for C# too
Yeah
it's like being able to play the piano using a violin 
C# libraries like to wrap stuff
wait no
a lot of modding communities too
i'm tired
its just like, imagine having an object whose entire job it is to call methods for another object and it provides only like 1% new functionality
its not funny to you probably
but it is to me
NotSupportedException: help does not support seeking
Hi tired I'm SlejmUr
real
invalid operation
is not supported a real thing
dont think so
bru
damn
NotFiniteNumberException
How long do you think it took Microsoft to write all of these classes
๐ฅ
ExceptionAsNaNMarshaller<T>
well
decades
i don't have to think to state that 
yeah sure
prove it
-# hey gemini rewrite all c# classes
cuz now you know the requirements and what you need
I can do 0.1% of System if it pleases the court
and which .NET version 
the first one

Hi! How can I make an animation for the player or the camera? I mean I want to make a cinematic video but filmmaker is not the best because I can't save it also it would be much easier to make it in Unity. Is there any way doing it?
You can either:
- Give them noclip and keep teleporting them
- Give them 0 gravity and keep teleporting them
Cant think of anything better
Alright, thanks, it just came to my mind that with a plugin I can add a primitive to the player as a parent is it possible to add the player to a primitve and then I can animate the primitive?
No
You can parent primitive to something
not opposite
Also give them disabled effect
enslarnedxdedefe
Whoever came up with that name bruh
That's unlucky, thanks
ensnarled
Enshitted
i was thinking of making my own dictionary
since the net48 dictionary sucks
how so
no support for some basic operations
like
https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.dictionary-2.getalternatelookup?view=net-9.0#system-collections-generic-dictionary-2-getalternatelookup-1 not available in net48
there's also no "swap" method or get or add method
(e.g bool TrySwap(TKey key, out TValue value))
(https://learn.microsoft.com/en-us/dotnet/api/system.runtime.interopservices.collectionsmarshal.getvaluereforadddefault?view=net-9.0 exists but not for net48)
Setting AutomaticActionModule.Cocked = true; and then running .ServerUpdate() isn't working to cock my weapon ๐ญ
Okay pro tip for anyone in the same boat:
ServerCycleAction has everything you need in one little function it's fuckin awesome
good catch
Thank you ๐
I was rooting around the code for a while
Setting the value itself won't sync it
You need to run resync
I think..
I thought that's what .UpdateServer did lol
I did .Cocked = True then .UpdateServer
Hm?
It calls .ServerResync
Well in the else of one of the statements so I'm probably wrong
I wasn't looking at it too hard lol
Either way this is pretty sick

xert
why were u 4 months back
i didnt realize when i replied to smth there ๐ญ
i blame xert here
Is it intended that disallowing WaveRespawningEvent will not cancel the base-game WaveManager.OnWaveSpawned event?
This will cause a few interesting things:
- SCP-127 will react to a spawn wave that didn't spawn.
- The target faction will have its respawn token taken from them.
- The timer for the disallowed wave will increase as if it spawned.
- Mini wave will start counting down to its check for whether or not the faction's objective was failed.
probably not intended, you can make an issue on the labapi github if you want
5 minutes fix
why not 50
What would you expect as default behavior?
btw david someone pointed it out in exiled, but environmental hazards check distance every tick
why not use a collider?
honestly same could go for Escape
Ideally trigger the event until it's allowed (just like PlayerEscapingEventArgs) and prohibit WaveManager.OnWaveSpawned from firing
That would most likely make the most sense
Okay I was too vague with this one
since Vector3 has - operator which creates a new one every tick for both for every player
Give me a second
i don't actually think that would be THAT much faster
distance checks are insanely fast
much faster than, say, bounding box collision checks
is it?
"Ideally trigger the event until it's allowed" -> Prevent the wave from spawning, but keep trying to spawn it unless a plugin increases the time left to spawn. Prohibit WaveManager.OnWaveSpawned
I havent seen it anywhere in the profiler
idk about unity
so -loud buzzer-
a collider still needs to do collision checks
werent u saying that 
which can be expensive afaik
fair enough
I was saying it for the FpcPositionDistributor
oh
i thought u said the - in general
whoops
Well WaveTeamSelectingEvent does that too
I need the exact moment a wave tries to be spawned in though
and disallowing with a delay the length of the animation is a bit hacky
Okay then
I'm trying to change 3114's spawnpoint by latching on to the ChangedRole event and checking roles spawn flags but uh
The role spawn flag is empty
When I use Assign Inventory and Use Spawnpoint in the RA Panel
why don't you log the flags
Wdym
no need for Enum.GetName
Okay I'll do that
enum tostring can tostring to multiple ones
there might be flags set but you don't see them cuz the combined flags aren't defined
๐๐ผ
Testing now
Oh okay
You're right
How is it setting both
How do I check for that
either .HasFlag()
or in Rider you type a dot after the variable and press enter on the flag you want to check
e.g.
flags.HasFlag(RoleSpawnFlags.AssignInventory)
(flags & RoleSpawnFlags.AssignInventory) != 0
the latter runs a little bit faster
Okie I'll change it then
check if it works cuz i wrote that from memory lol
All will be all, so HasFlag will get it
Sick
Why even have all then lol
But
without having to bit wise operation it
If ev.SpawnFlags = AssignInventory and UseSpawnpoint, then ev.SpawnFlags != All
So why have all
Then why did my check not work
All is if you set to All
its value is -1
so only if you set to all in code really
My whole thing is like
[AssignInventory & UseSpawnpoint] != All
That's dumb
Because that IS all the spawn flags
-1 is all bitwise
will always return true on HasFlag
its used for code
so instead of RoleSpawnFlags.AssignInventory | RoleSpawnFlags.UseSpawnpoint
you just .All it
I just wanted to be able to check ev.SpawnFlags == RoleSpawnFlags.All
But that doesn't ever return true
Unless I manually set it to all beforehand
Which defeats the purpose
it does if you code it to all
^
๐คท๐ผ
I get your point
My point is why can't it be simpler
Like I get how it works, and why it works
It just could be better
the reason behind using All = -1
is that
it means if you update it
ever
it will always work
True but has this ever changed
At the cost of making it slightly more complicated to check spawn flags
wait
what r u checking All for
if ur changing spawnpoint wouldnt you just use the spawnpoint flag
I didn't know RoleSpawnFlags was something that was bitwise so I was just checking if it was UseSpawnpoint or All
ev.SpawnFlags.HasFlag(RoleSpawnFlags.UseSpawnpoint)
This also works
ah
yeah uhhh
it will always be like that
it has to be bitwise
Yeah I was just confused as to why ev.SpawnFlags == RoleSpawnFlags.All wasn't working
And then I realized RoleSpawnFlags.AssignInventory & RoleSpawnFlags.UseSpawnpoint != RoleSpawnFlags.All
Which upsets me
im stupid
Correct
im gonna kill you
You wouldnt do that
i blame you david
no uh
what did you do
it was related to smth else

if i apply the layermask to the primitive does it work ghostly fine?
or cause desync?
IUsageProvider
why doesnt it show ingame
it wouldnt happen to be
fully client sided would it
show whole class
uh
eg
should work
well it doesnt
damn
you can't do that afaik
Yeah I got request to allow suggestions with spaces
As its not possible now
what
ah
huh
can you set ghostly to work on primitives?
You can only disable collisions
what do you mean?
Well so you can walk through them?
yea obv?
we need collision to be enabled until a player has a certain effect
No thats from the start
of when it got introduced
that everyone couldn't do it
it syncs back
you've never been able to
i thought it did it in Start only
not a constant resync
good to know
Let me see
I can look
if i could TOUCH that source code
i could do great things
but idk why client would beg for a resync constantly
Honestly
im not surprised
if thats the case
or if they check if they are the same on the server
fake sync flags
because thats probably whats happening
should be possible
you are the smart guy
what
it might
.
why would it...
but i dont think so
I think the game check if they match
on server and client
for desync











