#plugins-dev-chat
1 messages ยท Page 78 of 1
.
this should be the fix
with the original code and added
so i think pretty much they are the same with caching
and this should be the heaviest method of them all
if the receiver is a dummy could you not hide it all the time
return;
idk if it does that
Yep
Also
You should do
if (!TryGet())
pos = Dictionary[key] = new()
Honestly I just attach to the LateUpdate call
Bruh
And that works for me
don't scream at me ;(
You're cracking me up bro
wait
wtf is this
You don't have to set the value if it's already set
No
oh yea
Think, people, think
I hate seeing people do
if (dictionary.ContainsKey(key))
{
dictionary.Remove(key);
}
Zero...
ig this should be fine
๐ฅ
????
You're still doing an extra lookup
My compiler autocorrected me and I learned the beauty of it
You mean your IDE?
I'd be surprised if the compiler did that
I'm high leave me alone
Though it might be smarter than smart
No, it's hi how are you
๐ฟ <- you
:3333
.Remove(key, out var value) my beloved
Axwabo is saying when you get var position with the TryGet, you can avoid the GetPrevSyncData and return early
you are doing 2x look ups
This is me
Because the new sync data is default(syncdata)
At least
If I'm understanding
if (!TryGetValue())
.Add or wtv
at the start
[x] = y
Add both to dic if key not exist
Not in all cases
939 players would be cooked
Cuz it's different per receiver
You can just set it after the if and not introduce a variable though...
But
Let me
Illustrate what I mean
Because I entirely realized I stumbled into the wrong thing
But I wanna play it out
If not tryget(out value)
value = dictionary[key] = create();
Vine boom
i guess like this
There we go
fucking hell
Though you could've saved that add line
Kek
That's rookie numbers 
take your 1 saved line
You could get out early too but it doesn't really matter much
Bad code
But you get my line of thinking
I could also be wrong lmao
๐คท๐ผ
I'm here for the ride man
Yeah it is
Player A might not see Player B while Player C still sees Player B
This way you're using the first cached data anyway
Wdym
All you avoid
If the player is invisible you send the previous data
Which might have been a visible data
Is the GetPrevSyncData
Nuh uh
Patching the sync data with an early exit isinvisible isn't wrong
It only avoids GetPrevSyncData
What am I looking at
if it works im making it a separate plugin
to give to the people in #1336031121699377213
its so stupid that this is not in base game
You have GetNewSyncData, yes?
Almost there
If isInvisible = true all you do is this:
Which doesn't use prevSyncData
Also at this point move the uh
Kek
Position stuff after the if
nah you became gray
red forever
I only had that cause I Copy-Pasted the patch code from earlier to demonstrate my observation
Gay
๐
lvl 48 so close to 50
NOT EVEN INGAME
I'll be any color when I get to 50
SL moment
Doesn't auto-update on phone
It updated for the message k sent after
Gray message people
wait is lvl 50 max
Yes
There is level redacted
which i thought was 100
100??
Can be 0

Wait
Anyone know how terminated SCPs is calculated
26 npcs is 45 tps
I can check later when I'm sober but Im curious why this happens
spawned scps WITHOUT zombies
RoundSummary::_ProcessServersideCode
and then its death of ANY scp
1000000x better
so zombies count for kills, but doesnt count for spawned scps
I mean it's like over 900 less relative position calculations every tick with 32 players
true... i liked the uh
whatever color i had kek
dark rose maybe

comment out the patch
am i going insane
then forget that you commented it out and debug it for 3h
That's fucked up
i might be wrong but thats how i believe it works
that heavy anymore
lets see any changes
๐ฅ
Lmao
What
ublic void OnServerRoleSet(ReferenceHub userHub, RoleTypeId newRole, RoleChangeReason reason)
{
switch (reason)
{
case RoleChangeReason.RoundStart:
case RoleChangeReason.LateJoin:
this.ModifySpawnedTeam(userHub.GetTeam(), -1);
this.ModifySpawnedTeam(newRole.GetTeam(), 1);
break;
case RoleChangeReason.Escaped:
if (userHub.inventory.IsDisarmed())
break;
switch (newRole.GetTeam())
{
case Team.FoundationForces:
++RoundSummary.EscapedScientists;
return;
case Team.ChaosInsurgency:
++RoundSummary.EscapedClassD;
return;
default:
return;
}
case RoleChangeReason.Revived:
if (newRole == RoleTypeId.Flamingo)
break;
++RoundSummary.ChangedIntoZombies;
++this.classlistStart.zombies;
break;
}
}
ublic
sh
bash
i dont see why zombies dying would count
.\
its actually the same
What
it was differnet method
imagine if the footprint stored the team
RoundStart or LateJoin change to SCP = +1 spawned
Died = +1 died
46 player im doing 27 now
EVE WHAT'S HAPPENING ๐ญ
And rename into feetpawn
like its 2 tps more
Same
Okay so you were always right and never should have doubted yourself?
Sounds about right
yes
Zombie revive count
i didnt see the death method
๐
@upper vapor are you sure this should change something?
im starting to feel like it doesn't change
but did you remove the labapi event call
no
bru
the base-game map
i already removed it
ah
hints are optimized too
and they don't call for npcs 100%
i do not understand what it is
cosmetics aren't
are they client-side
Can you make the cause of death multiple lines?
obv
I tried \n but it didn't work
not sure, try <br> iguess
disable every in-game feature
What is <br>?
line break
I know it's a tag
Which are?
break
whatever subscribes to StaticUnityMethods
do i patch it away?
the only thing i do
with that is checking if anything is updated
on Meow
lol
(schematics)
so other than base game stuff nothing else
the only check i do and i don't think its that important or laggy is this
if ((Tower == null || Tower.Players.Count == 0) && (Hubs == null || Hubs.Players.Count == 0))
for some components
how can Hubs be null
this is done in the component
to check if it can do the action and if it makes sense
to like spin
or do other actions
because if none is in that tower / hub why doing it?
this is done in Update and FixedUpdate in one
in which component
@upper vapor ty you're my hero
components like spinners etc...
np
oh like
the uh server component may be in the hub or a tower but not both
it wasn't clear what you meant by component ๐ญ
yeah
like i don't think its nothing else
idk
i just think in general
npcs are
laggy
And how tf do i sync player?
no need to see other players
deathium
just run 40 clients on your machine
no need for fps
60/60
now that i found out about data storage i think alot of old code with Dictionary will do BOOM
I <3 distributor patch
@celest thorn take some inspiration 
??
Bro
i did it
BUt
but
with npcs
huhhh
ohhh

it makes sense
sl being sl
steal that guy's players
bruh
i doubt they exist probably in his mind
the voices!
we all have voices

how i imagine jake lockley is with his voices
i dunno who that is
me when 3x scp kills (but im scp)

i threw a ball, got converted to zombie
and then doctor + 2 other zombies died
lmfao
you don't know moon knight?
nope
why get contains destroyed room???
eh
server doesnt do anything with rooms
this fucking shit dont must contains a destroyed room
very hard for fix from nw in GET
they should've used TryGet in Generator
@celest thorn i wanted to figure out "client-side" NPCs at one point
as in just spawning a player with a specific role, nothing fancy
i realized i don't wanna do that xd
maybe i'll look back at it some day
@random scaffold i think fixed in next update no need to complain more
i did it
i THINK
i did spawn a npc client side
but at least its arleady known bug
what
and made it with a name
impossible
and the code will never be seen because it's private :(
because it required nasa level of experties
only god knew how it worked
at that point
but if you want we can try
lol
even doing more complex stuff
i don't have any problem
now that you put it like that, i might not wanna see it
it was in like one class
and it fucking sucked
so thats why
i assume you took the component order on the refhub and wrote all syncobjects & vars in that order
to the player prefab payload
and then sent a rolesyncinfo
i don't even remember what i did
i just know it worked
and i spawned a player with a name
and i stopped there
btw
i need to understand if you can hide people from the "N" list
i just hope they do it
because it would be cool asf
phew
instance mode
with synceduserid
make them appear as dedicated servefr
ID_Dedicated
i believe
yea try it
Oh i didn't think about sending fake syncvars
i don't think you need a syncvar
there's UserId and SyncedUserId
check the usages of the latter one
what r yall trying to do
fortnite
in sl

nah im joking
im just trying to figure it out how to hide player in the "N" list without breaking CSG
u cant
well
kind of
you need the player to never ever
become verified
or dummy
InstanceMode need to never ever change away from Host / DedicatedServer or idk what the last was
she wants to hide a real player
yea i made the suggestion
at some point
and so has 200 other ppl
huh
THANK GOD
hiding players
no way
PlayerListFlags
idk what nw devs will do
i'm scared
be scared
im scared of nw and eve
Boo
Still waiting for you to fix Eve
also can u take a look at RoundSummary and possibly fix the thing where zombies count for scp deaths but doesnt count for scps spawned
boooommmmmm
Where in that message is your name zero
zero cant read its okay
no context is me 
yes
yes... i know
im going insane for this game
its a full year, no loa, no nothing coding all days and studying
hmmm
I can still do coding but he knows SL
anyway david FIX!
this!!!
Thats like
Priority 9999999 bug
and leaks it
i would tho
you are an asshole
so give me ur pc instead
Great that Im not going to your house
so r u
im not either 
Eve's yapping session is here
- i don't want a lawsuit by Mr Motzcha
just ignore her
- what the fuck am i going to do with it? Fix the game?
.
idek what ur replying to there
to you
why not
@sinful bronze hacker
๐ค
What's number 1?
Urgent
deleting sl
Wdym 1st
You are hacker programmer
crazy
Pls return my Roblox account
what is roblox
what is account
Or I call @ornate pier and he put anti hack protect by shen
He will hack you dirty hacker๐
hack me clean hecker
me who's afraid of girls

guh?

Hm?
PlayerRoleManager.OnRoleChanged
its called before labapi : PlayerChangedRoleEventArgs
you didn't know?
well i assumed so
thats used for changing the SubRoutine
cute cat
basegame event -> spawn protection -> labapi event
but also
private void OnResettingMaxHealth(PlayerResettingMaxHealthEventArgs ev)
{
if (!Check(ev.Player))
return;
ev.IsAllowed = false;
}
๐
i gotta use ChangingRole to remove custom role
even if the event can be denied
so sad
i miss exiled having ChangedRole -> Spawned
actualy
it didnt
i lied
YOu miss exiled
Mrs exiled
cuz it can happen slightly after smth else anyway
Why
Because of delegates?
so i just gotta disable on ChangingRole and hope i dont deny it 
no but i dont get a guarantee that it will work
before everything else
Bruh
Yes
You're cooked
Just patch it 
Also isn't the spawning event called before case game rule change event
just use john exiled
doesnt have what i want anyway 
john exiled has everything
Guys
idea
Big idea brain moment
Cheating on Server side

Spawn(ing/ed) is on SetPosition
gun with aimbot
Yes
When is that
wait
it is before
RoleSpawnpointManager.SetPosition(this.Hub, this.CurrentRole);
roleBase.SetupPoolObject();
if (this.CurrentRole is ISpawnDataReader currentRole && data != null && targetId != RoleTypeId.Spectator && !this.isLocalPlayer)
currentRole.ReadSpawnData(data);
if (flag)
{
PlayerRoleManager.RoleChanged onRoleChanged = PlayerRoleManager.OnRoleChanged;
if (onRoleChanged != null)
onRoleChanged(this.Hub, prevRole, this.CurrentRole);
}
wtf ๐ญ
isnt called for 079, spec or if spawn handler is null
ok so its ChangingRole -> Spawned -> Basegame event -> Spawned
im stupid
CustomDataStore are added to the Dedicated Server player ?
i think if you try to get it on host hub it will add it
which it shouldnt but ig it prevents null ref
or maybe it should cuz it could be used
who knows
Thats not cheating then xd
But I wonder if you could gaslight global mod with it
YES!
100%
if you don't say to them it is a custom item
yes
exiled has a a thing in custom items that tells if its something that could lead to global ban
and they set like Name (CustomItemName)

Honestly i don't want a gban so you can test 
dev cheating on the game that he is developing
that a great idea
David strange question how can i bug the model of the player so much to be strange like tpose etc...
Still no idea what that means
And how can even do such a thing
I did use it for a gun that shot through the walls
because a gmod came in my server and got warnings about it
when he saw the custom item tag he disappeared
Skull
I deal with this by destryoing a customrole on ChangingRole, and then allowing it to execute if the player hasn't rolled a custom role OR the custom role hasn't been fully "initialized", which is after the player is given a role.
Basically if a player should receive a role, it would look like this:
ChangingRole -> Destroy CustomRole if initialized, otherwise stop execution -> roll for CustomRole -> If the player rolled a CustomRole, deny the event and invoke GrantCustomRole, otherwise stop execution -> CustomRole instance triggers another ChangingRole, which is returned due to not being initialized yet -> Set CustomRole as initialized.
This approach lets me use standard LabAPI events regarding role changes without issue
i just did ChangingRole and add on ChangedRole
why
where can i find libs like PlayerRoles, MEC(idk what is this) and others?
your server files
Assembly-CSharp
<Reference Include="Assembly-CSharp" HintPath="$(SL_REFERENCES)\Assembly-CSharp.dll" Publicize="true" />
<Reference Include="LabAPI" HintPath="$(SL_REFERENCES)\LabAPI.dll" />
<Reference Include="Assembly-CSharp-firstpass" HintPath="$(SL_REFERENCES)\Assembly-CSharp-firstpass.dll" />
<Reference Include="CommandSystem.Core" HintPath="$(SL_REFERENCES)\CommandSystem.Core.dll" />
<Reference Include="Mirror" HintPath="$(SL_REFERENCES)\Mirror.dll" Publicize="true"/>
<Reference Include="NorthwoodLib" HintPath="$(SL_REFERENCES)\NorthwoodLib.dll" />
<Reference Include="Pooling" HintPath="$(SL_REFERENCES)\Pooling.dll" />
<Reference Include="UnityEngine.CoreModule" HintPath="$(SL_REFERENCES)\UnityEngine.CoreModule.dll" />
<Reference Include="UnityEngine.PhysicsModule" HintPath="$(SL_REFERENCES)\UnityEngine.PhysicsModule.dll" />
<Reference Include="UnityEngine.AudioModule" HintPath="$(SL_REFERENCES)\UnityEngine.AudioModule.dll" />
<Reference Include="mscorlib" HintPath="$(SL_REFERENCES)\mscorlib.dll" />
<Reference Include="System" HintPath="$(SL_REFERENCES)\System.dll" />
<Reference Include="System.Core" HintPath="$(SL_REFERENCES)\System.Core.dll" />
these are the references usually used
Why include drawing
Bleh
Use unity colors
ookayy.....
What why?
DAVID
they want to have the seed the same
always
which unity random kind of prevents afaik 
Because seed
as in if seed is smth it should be consistent
yeah
System.Random is deterministic by seed
Seed deez
Unity Random needs to run Random.InitState(seed);
me mention
Think
at which points its the same every single round
shhh
I'm just new to programming. I know a couple of words in C# and I might not understand everything
so you could theoretically predict something,
Predicting 14.1.2 rls date
so, i just need to add link in my project to use PlayerRoles?
You need to add the references
this is in rider tho
well, that's what I meant. I might have said it wrong because my VS is in a different language
but u need to add a reference with the path being to the server files
aka this one on steam
Itll be in (GAMEFOLDER)/SCPSL_Data/Managed or smth
How do I telepor the player?
player.Position = new Vector3(0, 0, 0)
;
me too
ExplosionSpawningEventArgs gives the player that caused the explosion, how can I get the serial of the item that caused the explosion?
Is it even possible?
ev.Settings.Info.Serial i think
Doesn't exist
this is not labapi update
this is sl
Oh
what is missing
Serial
misspelling?
oh
๐ญ
oh i just realized this is new
@unique crane heyy bestie
public ExplosionDamageHandler(
Footprint attacker,
Vector3 force,
float damage,
int armorPenetration,
ExplosionType explosionType)
{
if (armorPenetration == 0)
return;
this.Attacker = attacker;
this.ExplosionType = explosionType;
this._force = force;
this._serverLogsText = DeathTranslations.Explosion.LogLabel + " caused by " + attacker.Nickname;
BodyArmor bodyArmor;
this.Damage = BodyArmorUtils.ProcessDamage(!(attacker.Hub != (ReferenceHub) null) || !attacker.Hub.inventory.TryGetBodyArmor(out bodyArmor) ? 0 : bodyArmor.VestEfficacy, damage, armorPenetration);
}
whys the return; there
wouldnt it be before the Damage setter
where can i find list of all types of items? like candies & other
ItemType
am im dumb or pink candy is not here
CandyKindID
Candy uses Scp330
but the bag itself contains CandyKindID
i must use this func?
player.ReferenceHub..GrantCandy(CandyKindID.Pink, ItemAddReason.AdminCommand)
How do I make a grenade explode on impact?
thanks! and sorry for making you write the code for me
no worries im bored rn
smth like that
component:
OnCollisionEnter
check if it is EffectGrenade
set its time rly low
destroy component
ok if u boren rn then u can help me more? 
cz im so dumb i dont know how 2 catch class D spawn event
PlayerEvents.ChangedRole
@true cedar idk if ur awake but
would u happen to know about unions in C#
cuz i cant figure out how to implement properly
wth
show ur player spawned code
they're kinda fucked to implement
use fieldoffset
Will I have to check if it's the right grenade?
the what now
no you just need to init it with the right grenade and use that for explosion only
it lets you put two fields at the same memory position
one sec, i have an 4+ error in my spaghetti code
Do I init from when it's thrown?
Thanks
YES I FIXED THAT
why did you define it as dynamic ev ?
PlayerChangedRoleEventArgs ev
tried that already
changed to PlayerEvents.ChangedRole, nothin happen
add using LabApi.Events.Arguments.PlayerEvents; and boom
GrantCandy is an extension, hover over it
It should tell you what reference to import
Whats erorr
idk how to translate it to u
check ur dm
Oh its Mirror.dll
Same place as assembly csharpn and labapi
I meant in the server
Then here
Alr
check dm again (idk why im send screenshots to ur dm)
looks fine but u should prob send stuff here and not my dms xd
yay
finally
thank you
I made a thing
how u playin it with 10 fps โ ๏ธ
Terrible computer
My average is like 15
have u tried to set low graphics?
?
I'll be fine with my 15 fps
It's normal for me
god will bless u
Sometimes a pc is just bad
And tbf if ur not using it to play but rather to code i think its fine
i have played atomic heart in 2k on gt 630 ๐
and got more than 15 fps
I do play, I just usually don't have vs22 and obs open while I play
oh
fair
jus for example
on nvidia gpu u can use nvidia inspector
to modify game
and get potato graphics
ok
i dont get pink candy
maybe i should first give a bag
shouldnt be needed at all
should work
Did you compile and put on server
Did it load
[LabApi] [LOADER] Successfully enabled 'PinkFun', Version: 1.0.0
Dunno
i must try it
i have no choise
nuh uh
didint work
tf is that
and it dont give me the bag
idk how to fix that
Are you changing the role with the RA console or spawning when the round starts?
spawning when the round starts
Try PlayerSpawnedEventArgs irrc
Its called before Changed
Oh
ya
but
i dont mess with roles im the customitem guy ยฏ_(ใ)_/ยฏ
im forcing it
to start round with RA
just not change the class
just start round
Dunno
No i dont!!
Idk how nw keeps getting away with smelly code!!
You smell, not our code 
No its absolutely the code
is there any way to manually trigger respawn waves? I remember with the old moderator menu there was a way
wave spawn ntf
in ra text based
ty!!
thats all
why its doesnt work
i just have to wait for the coding guru
ok, I saw a 0.1 sec delay in someone else's code. could it be done so that the inventory has time to be initialized?
Shouldnt be required when using ChangedRole
hm
Add Logger.Debug statements to figure out if ur code is running
Huh
Sometimes they just stay
they give you time to enjoy yourself
ok
ok
i have
a pink candy
if i manually change role
but
if i start the round
there is nothin
maybe it conflicts with some plugins
like inventory control
idk tf that does so
smth like that
ill test it
without inventory control
and yep
it worked
maybe i should put some more delay
after inventory clean
Avoid delays when possible
so youd probably wanna fix inventory controls or make ur own thing
is there a list somewhere of spawn locations? Like when an MTF spawn wave happens?
Wdym
You want the spawn points of ntf ?
public static bool GetRandomSpawnPosition(this RoleTypeId role, out Vector3 position, out float horizontalRot)
{
if (TryGetRoleBase(role, out IFpcRole? fpc))
return fpc.SpawnpointHandler.TryGetSpawnpoint(out position, out horizontalRot);
position = Vector3.zero;
horizontalRot = 0f;
return false;
}
damn, how did you find that so fast
i had it open 




