#plugins-dev-chat
1 messages ยท Page 87 of 1
one time i got so angry i pulled out sl src and showed how the gun system works via math
Can you tell zero that client side only waypoint toy wont work
All I know is I did a coroutine to set player position and it wasn't smooth
I know they wont work
thats their problem to learn
but i want to see what happens
So how do I interface with a waypointtoy?
ya
I've never used waypoints before
spawn an object with the waypoint as its parent i believe
object as in primitives
@unique crane the more i bug this game the more fun it will be trust me
So make a waypoint toy
Spawn a primitive that is a child of the waypoint toy
Move the waypoint toy however I want
Profit?
i dont know 

idk more specifics
Guys
@unique crane ๐ฅบ
When update?
let me see if I can find the QA test of the riptide's waypoints
Yea because you get paid nothing and its the min to pay for alcohol
there should be QA plugin
<t:1754247600:R>
Thx
I KNOW
Feel free to view #labapi-announcements next time you're wondering when the update is
I KNOW
Already have plan b if Client Side waypoints aren't cool enough
(I know already for sure they aren't)
translatin
9 days straight on microsoft word is CRAZY
He is doing the all endings run
ask QA to create QA plugin
nah but you can give unlimited item limits
and just server validate
Hmmm
UPDATE OUT
Yeah that's what I'm doing for now, thanks for the clarification ๐
Now its speedrun time
@unique crane set it to 1,1,1 didn't work
Joeover
Idk
the problem IS UNITY PARENTING
what the
funny litte gun
funky micro why are the size of the itemviewmodels determined by the player model fade?
Lmao what xD
Cool that the IK still works
wtf XDDD
Please let us have an option that keeps the weapon in hand visible and at normal scale
erm
whys this not work
im confused
its a HE grenade and serial should work i mean it works the same as my other custom item
(it doesnt explode on impact)
what do model fade?
nw forgot add .IsDestroyed 
cool
Does it change the player's position via Offset? At the same time, the player himself can move
yes you can move in elevator freely
like base game elevators
Nice
you made button by interactable toy?
or how it without any cooldown
@celest thorn https://maro.tiananmensquare.asia/๐ธ/mwkdh8v6.mp4
is what?
What you don't see
its not visible
it doesn't render
yes
but its the base effect was
Is it better tho?
or base effect rendering outside too?
Would be good to benchmark XD
pauseulling causes a whole bunch of issues
interractable toy
yeah so this breaks our entire project
i think we are going to stick with our own version of culling
guh
probably better
nw lied
this bro smeared cassie
its just desync tho
so
ig not too horrible
but any custom maps that arent the base floor will not work with this system
I know
but if i make it bigger
it doesn't cull anymore correctly
Because i cannot know if something is ground or not
no because that would again defeat the purpouse because the map is always loaded
and we have culling for that
because its handled by the plugin
but how can i tell by code
thats ground
to walls
etc...
like see where the problem is
and changing 20 schematics its actually hard
not counting some others
waypoint toy can have infinity radius?
No
bruh
They have the same distance as other waypoints
fucking 254 limit
destroy limit
you can't remove the limit
if they would remove it it's would simply not work with the system they did made
We can finally adjust the model fade properly. If the items in your hands stop shrinking, it will be complete(he is holding micro micro)
sooo
So how will this issue be resolved? Will the items in their hands also become invisible or will the items in their hands be visible?
probably invisible
for now it's look like this
hmm maybe bc of this ?
idk
that clearly failed yes that because of that
@unique crane uhh btw
why does this not actually max it at 65 damage
it insta kills someones with 100 hp despite seemingly being 65 max
How does one send a role sync message
And I'm in bed already
FpcServerPositionDistributor.SendRole
Thank you
double explosion 
dummies cant throw grenades
that might be why
sadge
hjm
hm
so ig its already exploded?
Ig set TargetTime = 0
yeah
fuse ending doesnt set it as detonated
thats
weird
Is there a way to get a player's ping?
im trying the waypoint toy
but i cannot understand why even when i stand on top of it it doesn't rotate
like at all
im desyncing like crazy even tho everything is fine
should i set a priority?
LiteNetLib4MirrorServer.GetPing(ev.Player.Connection.connectionId);
visualize the bounds and show it
They don't move
even tho the animation is running
fine
did you spawn the object and is it non static
are you animating the waypoint
what's Waypoint
but what is it in game
an empty gameobject
?
No this is server side
why tf should i parent it to a primitive
if i move it it should move
like it doesn't make any sense
other way around
primitive with the waypoint as parent
but why
if its an admin toy
and i spin it it should be spinning on the client too
isnt the point of a waypoint so that you can parent rooms to it
what
it can also be used to sync player positions
you parent rooms to it so that players & other objects can attach to it
but the client doesn't know about the empty object
so it's not moving, it's not there at all
youre nitpicking the tiniest thing
you know exactly what i meant
i do not understand
the client has the update of the position from the transform moving
so thats enough
not all elevators are rooms
not all rooms are elevators
but you have an empty object that has no netid, therefore you can't parent the waypoint to it
okay well anyways
but that doesn't mean fucking nothing
you can parent stuff to waypoints so that players and pickups can anchor to them
right?
because the server knows its moving
NetworkPosition
Rotation updates
and the client updates it
and that's relative to the parent
what?
is someone confused about empty objects in scp sl
Not that
networkposition, networkrotation and networkscale are all local space
Why?
wtf
well not usage but implementation
are you telling me i should manage myself
zero don't tell me you didn't know this
i don't understand still
you have the local transform from unity
come in vc
and let me show you
because this is too stupid
and i don't understand who is stupid me or unity
are you spawning a client side primitive in place of the empty object?
No what im doing is
you should be able to use waypoint how ever you want, although i didnt test every case
Empty
the problem is not updating
for no reason
like it should be updating fine
the issue its thats theres an empty in the hierarchy, and that will break parenting unless you replace it with a primitive
waypoints can be used to make custom rooms out of bounds that work properly right?
yeah
But why should i parent it to a primitive
it doesn't make any sense
the cause of stuff like pickups disappearing and positions desyncing is because the doors arent there which act like waypoints?
because you need a network identity
if i want to parent it to nothing it should be updating
to parent the waypoint to
or am i not correect in that assumption
although, scpsl rooms dont typically have waypoints. they are actually on the doors
yeah i figured
do all doors have one btw
it doesnt really matter where the waypoint is, if it doesnt move throughout the game
how does the object know what waypoint to attach itself to?
does it just pick the closest one
all network spawnable doors have them, with the exception of the surface gate iirc
depends
closest, unless the object is inside an elevator
ya
and relativepositioning uses waypoints right
yes
yep
public static void ExtractWaypointData(
Vector3 worldPoint,
bool extractPoint,
Quaternion worldRot,
bool extractRot,
out byte closestId,
out Vector3 relPoint,
out Quaternion relRot)
{
float num1 = float.MaxValue;
relPoint = Vector3.zero;
relRot = Quaternion.identity;
closestId = (byte) 0;
WaypointBase waypointBase = (WaypointBase) null;
for (byte index = 1; index < byte.MaxValue; ++index)
{
if (WaypointBase.SetWaypoints[(int) index])
{
WaypointBase allWaypoint = WaypointBase.AllWaypoints[(int) index];
float num2 = allWaypoint.SqrDistanceTo(worldPoint);
if ((double) num2 <= (double) num1)
{
num1 = num2;
waypointBase = allWaypoint;
closestId = allWaypoint._id;
}
}
}
if (closestId == (byte) 0)
return;
if (extractPoint)
relPoint = waypointBase.GetRelativePosition(worldPoint);
if (!extractRot)
return;
relRot = waypointBase.GetRelativeRotation(worldRot);
}
elevators when ur in the elevator use -1 distance
to make sure u go in there with priority
Spawning in a Dummy when the round starts and trying to set its group gives me this error, but i dont understand it
You can set this to Embedded to see the line the error is coming from
@unique crane & @worthy rune pretty sure i found a bug
you cannot update a Waypoint toy with NetworkPosition
or any other
after spawn
even if its not static
pretty sure that goes for all admin toys
use the wrapper types labapi provides
I cannot
i need to use the one game provides
you have to set transform position
Wdym?
I disabled the Object
I disabled the component
so it doesn't update
every LateUpdate
but i manually do
if you disable it, mirror stops working on it
why disable it anyway
huh
i have a monkey type of level
mirror update loop checks for any syncvar dirtybits
so network vars stop working if you disable the gameobject
yeah and she sets the dirty bits by setting NetworkRotation
she only disabled the component
yeah but mirror isnt reading the set dirtybits or doing anything with them anymore
Honestly im trying with update to set the transform
and just see if it works
Nope its not working im loosing hope
i mean is it still disabled?
no
this is the spawn method
what if you set IsStatic to true to prevent server updates
https://ratcentral.is-a-good.site/๐/px7x4yz1.png
and still like this
if its is static then its 256
shyte
What's wrong here?
Alot
Oh you wanna know
funny enough
this is already done
inside UpdatePositionServer
i feel like the client is not updating it
idk why
i never had any of this problem with other primitives all of them always worked
why dont you just parent it to a prim and move that
because the primitive doesn't exist on the server
the problem is i cannot do any of that
because
Client Spawns
Server Spawns
so its still impossible for me
btw someone can explain it to me this
Should i set the primitive as parent of the Waypoint
or
Waypoint as parent of the prim
because both cases don't work
both should work
what happens when you try
1st nothing no spin the Update render doesn't even do anything
2nd the primitive disappears
btw the waypoint updates
im 100000000000000000000000% sure
just not on the client
have you tried not parenting to anything and having the waypoint be both server/client sided?
[HarmonyPrefix]
[HarmonyPatch(nameof(AdminToyBase.UpdatePositionServer))]
public static bool OnUpdatePositionServer(AdminToyBase __instance)
{
if (__instance.transform.root.name.Contains("Ignore"))
return true;
if (__instance.IsStatic)
{
return false;
}
__instance.NetworkPosition = __instance.transform.position;
__instance.NetworkRotation = __instance.transform.rotation;
__instance.NetworkScale = __instance.transform.lossyScale;
return false;
}
This patch is spamming me that the Waypoint is being updated
Obv
its rn like this
wait without parent on the server
if that doesnt work, you probably have some patch interfering with it
just dont bother with parenting until you get it working in its most basic form
i just cannot understand honestly why its so bugged
all of the updates are synced its just the client not doing anything with it
nope still nothing
what patches do you have that mess with networking/admin toys
Only this AdminToyBase.UpdatePositionServer
that should sync in any case everything
and i know it works because everything does update like textoys
(that are server sided)
Riptide
Are you sure the client does update it?
im getting the vibe it doesn't
100%
I just checked
it uses the same code as admintoy base
[2025-08-03 23:26:59.312 +00:00] [INFO] [MeowEditor-labapi] Waypoint (38.82, 100.91, 49.23), (0.00000, -0.30720, 0.00000, 0.95165) (0.02, 0.05, 0.03)
[2025-08-03 23:26:59.323 +00:00] [INFO] [MeowEditor-labapi] Waypoint (38.82, 100.91, 49.23), (0.00000, -0.29335, 0.00000, 0.95600) (0.02, 0.05, 0.03)
[2025-08-03 23:26:59.333 +00:00] [INFO] [MeowEditor-labapi] Waypoint (38.82, 100.91, 49.23), (0.00000, -0.27975, 0.00000, 0.96007) (0.01, 0.05, 0.03)
[2025-08-03 23:26:59.363 +00:00] [INFO] [MeowEditor-labapi] Waypoint (38.82, 100.91, 49.23), (0.00000, -0.26638, 0.00000, 0.96387) (0.01, 0.05, 0.03)
[2025-08-03 23:26:59.373 +00:00] [INFO] [MeowEditor-labapi] Waypoint (38.82, 100.91, 49.23), (0.00000, -0.25327, 0.00000, 0.96740) (0.01, 0.05, 0.03)
[2025-08-03 23:26:59.384 +00:00] [INFO] [MeowEditor-labapi] Waypoint (38.82, 100.91, 49.23), (0.00000, -0.24041, 0.00000, 0.97067) (0.01, 0.05, 0.03)
[2025-08-03 23:26:59.414 +00:00] [INFO] [MeowEditor-labapi] Waypoint (38.82, 100.91, 49.23), (0.00000, -0.22784, 0.00000, 0.97370) (0.01, 0.05, 0.03)
and you can see the update is happening
on the update Server but the client doesn't recieve anything?
the renderer doesn't even have any type of update
have you checked your client log
wdym by renderer?
do you see it at all
its parented to the waypoint, so it moves with the waypoint
Its not in the client
but even if i set it to the client
nothing happens
not sure what you mean
i mean parented as apart of the prefab, not admintoy parenting
admintoy parenting
and prefab
both of them
but nothing
still there
not moving
anything
nothing
thats the first thing i did
parenting for both no errors
and moving the server says its moving and updating it
but the client has no movement
im pretty sure i didn't do anything wrong
because server is Updating it
the client isn't
i think theres something missing here
movement is handled the same as any other admintoy, there isnt away to explain whats wrong
priority isnt related to movement
only thing i can think of would be that you are setting the waypoint to static somewhere
Static it isn't
else the server would've blocked the updates
only way to explain it, unless the server isnt sending out any network messages for waypoints
Rats
your thing only checks setting the network vars, not if mirror is sending out the network messages. so you could check that but i think its unlikely to be the problem
how can i check that?
you would have to patch mirror
still think theres something missing here, you say theres only one patch? what about other plugins on the server
there's not any other
can i see all the patches you have
can i see SendSpawnMessage, SpawnObservers and ToyScale
ToyScale
[HarmonyPatch(typeof(NetworkServer), nameof(NetworkServer.SendSpawnMessage))]
public static class SendSpawnMessagePatch
{
public static bool ShouldUseGlobalTransform(NetworkIdentity identity) =>
identity.TryGetComponent(out SpawnableInfo data) && data is MeowEditorDoor;
public static void SetTransformValues(ref SpawnMessage message, NetworkIdentity identity)
{
var transform = identity.transform;
if (SpawnObserversPatch.ShouldSpawnWithGlobalTransform)
{
message.position = transform.position;
message.rotation = transform.rotation;
message.scale = transform.lossyScale;
return;
}
message.position = transform.localPosition;
message.rotation = transform.localRotation;
message.scale = transform.localScale;
}
private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions)
{
var list = new List<CodeInstruction>(instructions);
var start = list.FindField(nameof(SpawnMessage.position)) - 2;
var end = list.FindField(nameof(SpawnMessage.scale));
list.RemoveRange(start, end - start + 1);
list.Insert(start, Call(SetTransformValues));
return list;
}
}
[HarmonyPatch(typeof(NetworkServer), nameof(NetworkServer.SpawnObserversForConnection))]
public static class SpawnObserversPatch
{
public static bool ShouldSpawnWithGlobalTransform = false;
private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions)
{
var list = new List<CodeInstruction>(instructions);
var loopStart = list.FindCode(OpCodes.Stloc_2) + 1;
list.InsertRange(loopStart, new[]
{
Ldloc(2).WithBlocks(new ExceptionBlock(ExceptionBlockType.BeginExceptionBlock)),
Call(SendSpawnMessagePatch.ShouldUseGlobalTransform),
Stfld(typeof(SpawnObserversPatch), nameof(SpawnObserversPatch.ShouldSpawnWithGlobalTransform))
});
var loopEnd = list.FindCall(nameof(IEnumerator<NetworkIdentity>.MoveNext)) - 1;
list.InsertRange(loopEnd, new[]
{
Int0.WithBlocks(new ExceptionBlock(ExceptionBlockType.BeginFinallyBlock)),
Stfld(typeof(SpawnObserversPatch), nameof(SpawnObserversPatch.ShouldSpawnWithGlobalTransform)),
new CodeInstruction(OpCodes.Endfinally).WithBlocks(new ExceptionBlock(ExceptionBlockType.EndExceptionBlock))
});
return list;
}
}
reminds me of sloc lol
Yea
because this was the same for doors
btw something i should mention
because i handle stuff differently
stuff is not spawned normally
but handled like this
if (!go.TryGetComponent(out NetworkIdentity identity))
return;
SpawnObserversPatch.ShouldSpawnWithGlobalTransform = true;
try
{
// future probably doors will not work.
identity.isLocalPlayer = (UnityEngine.Object) NetworkClient.localPlayer == (UnityEngine.Object) identity;
identity.isClient = NetworkClient.active;
identity.isServer = true;
identity.netId = NetworkIdentity.GetNextNetworkId();
identity.OnStartServer();
}
finally
{
SpawnObserversPatch.ShouldSpawnWithGlobalTransform = false;
}
When it is a networkidentity
so it starts normally but i need to manually send the spawnmessage
that could be the problem
can i see the code that does that
you are already seeing it
after it spawns
it does this
sorry the payload part of the spawn message
public static void SpawnNetworkIdentity(this Player player, NetworkIdentity networkIdentity) =>
MeowEditorAPI.SendSpawnMessage.Invoke(null, new object[] { networkIdentity, player.Connection });
I just send the spawnmessage
via mirror
NetworkServer.SendSpawnMessage
btw all of this worked fine with primitives
not sure the issue, without any errors on the client/server side im not sure where to look
neither do i
because no errors anywhere
and it seems to be fine on server
best you can do is create another plugin and keep adding stuff to it until waypoint toys break
ServerConsole.EnterCommand("restart"); will this restart the server or the round? i want to restart the server btw
i think you can do Round.Restart
does it restart the server or round restart
you have to specify it in the args iirc
what might that be
Spawning in the unconventional way
oh
of not telling mirror Hey it spawned
ahh
so its time to write new logic for this
makes sense
NetworkServer.spawned doesn't have it
we could probably do something to fix it
Honestly
yes
its such a pain now to handle
if i were you, i would just send EntityStateMessages instead of trying to use netVars
thats what i do when i fake sync
this is not faked
๐ข
yeah true
btw im going to write it down probably for tomorrow rn im such a pain
the only problem i have
is like now that i spawn them like this
could a player that is not like spawned
be attached to another waypoint toy that he doesn't see
and so create desync
probably
could i make a way to deattach the player and only attach it to stuff that he sees?
yeah although that might require a few patches
if you can somehow seperate them in space that would be the way to go
if you could tell me where
hmm i can do that
its not really a problem
theres movable waypoint add/remove methods
because at the end of the day i have infinite space
in there is where the "attachment" happens
here?
WaypointFollowerBase
nope, not there
thats used for ragdolls/hazards
AdminToyWaypoint::Add?
yeah
you want todo something like this
if (child is FirstPersonMovementModule fpm)
... filtering
I have something that tells me if its visible or not to the player
so it shouldn't be a problem
i need to study alot how it works
because i see alot of problems with movement
what problems are you having
if i have a long platform like not a cube
but a long the thing looses its grip pretty fast
in the edges
if i stay in the middle it works fine
wdym by loose grip
like i fall from the plaform
or it doesn't influence anymore the relative
so i don't spin anymore
can you send a clip
yea
oh your waypoint is not synchronised with your platform, i guess try parenting it
so parent the waypoint to the platform
that would fix it, although the issue of it warping around like that is likely due to how you coded it
are you changing the scale?
nothing fancy
no.
oh yea
i am
wait
the scale to not be like 256 256 256
i mean during the runtime like here
no
parenting breaks alot
i found myself in the void
spinning
im honestly in between rn
of deciding of really using them
or not
because it would be more of a pain
then gain
and possible tps drop
not sure how it ended up so glitchy for you, should look very smooth like this
idk at this point i don't even think im going to use it
its so a pain
i couldn't imagine
when i saw toy i didn't think this much of a pain
we did make them easy to use, its just that your doing alot of hacky serverside/client side stuff
i know
anyone know how the new SpawnableCullingParent works?
holy shit
what event would be the best for allowing damage between certain people or roles? I've tried both onplayerhurt and onplayerhurting, but nothing has seemed to work. I'm confused on how you're supposed to allow damage to go through when it's normally not. ev.isallowed doesn't seem to do anything in my case
Is there anyway to change the cause of death description for a body?
I've used Player.Kill(reason, cassieAnnouncement)
but to my understanding, the reason sets the body's death description, while also displaying to the player at time of death?
Change the ragdoll's damage handler
If you have a Ragdoll rd you can do something like rd.DamageHandler = new CustomReasonDamageHandler("Generic Death Reason")
thanks!!
On playerhurting
public override void OnPlayerHurting(PlayerHurtingEventArgs ev)
{
if (ev.DamageHandler is AttackerDamageHandler handler)
handler.ForceFullFriendlyFire = true;
}
every time I've tried modifying that I was given some assembly error. I haven't tried exactly that way though, so thanks
You might have to publicize the assembly
ForceFullFriendlyFire may be a private/protected field in the original code, so you have to publicize Assembly-CSharp to modify it
how can I set the fuse time of a grenade projectile/get rid of its fuse time (so it only explodes when i tell it to)?
There's a lot of ways to go about that
what's one of them?
TimedGrenadeProjectile grenade;
grenade.RemainingTime = 100;
Of course! :D
how can I check if a player is in the pocket dimension?
PocketDimension.IsPlayerInside(player)
Thanks!
Hey riptide
You did waypoint stuff right?
ye
How do I use WaypointToys? I have very little understanding of waypoints and shit but I understand I can use them to smoothly move players?
they have two uses, one is just to expand the playable area which you do by spawning them and setting them to be static. each waypoint covers a 255m cube of area. second is to use as an elevator, all you have todo is scale them to the size of the chamber(or platform) and move them around and it just works. since its just an admin toy you can just parent it to other admin toys and move them instead(although be carefull with lots of movement smoothing as that will cause desync)
what is waypoint toys?
So if I wanted to move a player, I could just create a waypoint toy at their position and move it to another position?
Sorry if I'm misunderstanding
I give up
on a custom items
wel
well*
Ima just try fixing command
if (!(sender is Player player))
{
response = "This command can only be run by a player.";
return false;
}``` bruh this didn't work
it always does it won't be ran
but a player
or smt
bro why is labapi so muchg different
that should work, unless im missing something
it didn't
ima go to examples
and paste it
its different
if (!Player.TryGet(sender, out Player? player))
{
response = "You must be a player to use this command!";
return false;
}``` saw this on offical examples
oh it might of been PlayerCommandSender not Player
yeah it shoudlnt work
this should be fine
its in a offical example sooo
can you link it
If I teleport them
Will it lerp?
^^^^ in the link
yeah thats fine
RAHHHH
Bro what
that one im saying should work
Is going on
no
well unless theres movement smoothing
yeah make sure you set movement smoothing to 0?
So if I turn on movement smoothing, it'll lerp?
yeah
Fire
I forgot
to register my item
in my entrypoint
๐ญ
bro even I Forget stuff on my own system
That's fire
im no
Do you ever do Pickup::Spawn()?
No! I forgot
one thing i should mention is that the lerp happens on the client only, so they will teleport on the server but on the client it will lerp which might cause abit of weird desync if let say a wall in inbetween the two points
this is my first item manager
Oh shit
Okay
even my old NWAPIPlugin didn't have one
You can run Pickup::Create and then .Spawn() it when you're done initializing
I changed it now ๏ฝ
but now
my system doesn't even work
I give up at ts point
it spawns coin
but
doesn't seem to do anything with it
yeah it won't do the stuff its meant to do
Show code
๐
should work now ๐
bro I haven't used labapi until today.
I was soo used to NWApi
why did they change it AGAIN
true
tbh
:0
so bad news
dropping it breaks it
but I have smth
its smth
I will fix it up later
after i make changes
but
ok right after I make this last change
IMA SLEEP
I got school tomorrow ๐ญ
Probably because you're doing weird shit with the serial
Pickup.Create() assigns a serial
You're doing too much work broski
What are you doing with the dropped item
Serials stays the same for pickup/item
So I've noticed
If I have a waypoint toy
I spawn it on someone
But then I teleport it away from them
They are not following?
maybe set visualize bounds to true to see if the players inside
I just decreased the teleport distance and it worked
I teleport it on like a line and pick interpolation points
So I just increased how often it happens
And it fixed everything
weird
how should i add a wait into the plugin without it desyncing the server?
what are you trying todo
Coroutines!
Coroutines are these wonderful little time-based things
i dont have it ):
So let me draft something real quick
k
private static IEnumerator<float> Coroutine(Player player, PrimitiveObjectToy objectToy)
{
// code code code
yield return Timing.WaitForSeconds(1f);
// more code!
}
This is the general idea behind a coroutine
You give it some arguments
You run some code
But what you can do now is yield return
And you can then pass in different intervals
And it waits for however long you specify
k
Like this is one of my routines
All it does is wait for a 3 seconds, and enables invisibility for a player
Now
In order to run a coroutine, you have to call Timing::RunCoroutine
The non-generic type 'IEnumerator' cannot be used with type arguments
The name 'Timing' does not exist in the current context
In my case I have an event where I do Timing.RunCoroutine(InvisRoutine(ev.Player));
im stupid as hell
- Make sure it's an
IEnumerator<float>
- Import
i haven't sleept all night ๐ญ
using MEC;
It's in Assembly-Csharp-firstpass.dll
So make sure you import that as a dependency
k
ty
Of course!
also just a question will this restart the server or the round - i want it to restart the server
ServerConsole.EnterCommand("restart");
I would recommend for anything you do, don't rely on enterring commands into the server console
how should i restart the server then?
Do Server.Restart();
ty
Haha ofc!
its very hard for me cause i am the only plugin developer for my server ๐ญ and im trying to train a friend
I've been writing this one plugin since I first learned LabAPI
I have made a lot of mistakes along the way but it's working
nice
my eventhandler that subscribes t othe functions for me (:
still adding stuff
from the old one
Real
if it fails to add events it will just restart the server
I like to just derive from CustomEventsHandler since my plugin quite large
like there is only one video about labapi ๐
I have so much shit I started having to use reflection for registering events
lol
It's really nice though cause now I can just make a class and it auto-registers
me trying to figure out how to make my first custom tool that i tried making but it was like when i started remaking the plugin
i just used the ProjectMER as an example
Depending on the usecase, I'd recommend simplifying things like the DTogglerDictionary to a hash set
Yeah Particle Disruptors are notoriously buggy
this is what i did to use wait ๐ it desynced the entire server when someone got a kill
private async Task HideHintAfterDelayAsync(Hint hint, PlayerDisplay playerDisplay)
{
await Task.Delay(2500);
hint.Hide = true;
playerDisplay.RemoveHint(hint);
}
I advise against Tasks
ik
You allocating 4 list which isnt really good.
You can just keep it that way (IEnumerable<T>) or something
that was the old code
Haha love it
Risk of multiple enumeration
I allocate 4 lists but it doesn't matter because it's my plugin entry
one time parsec stole the scp sl port ๐
pro server specs
hosted on my friends laptop
The list will not change when you do the foreach loop and you can also probably can do like
(static x => !x.IsAbstarct)
Yes but I use them later
And I may add more to my reflection in the future
is it possible to auto update an scp : sl server?
I avoid this kind of practice in my constantly running code
But in my plugin entry it makes it easy to understand and work with
Also half the code doesn't really make sense, you can edit the type to be your "BaseCustomEventsHandler" and others inherit from it
it seems like they modify smth about http request
Wdym?
And you only need 1 loop
Do not use async
Use coroutines
its my old code
I'm confused as to what you mean by this
new code (:
private static IEnumerator<float> HideHintAfterDelay(HintServiceMeow.Core.Models.Hints.Hint hint, PlayerDisplay playerDisplay)
{
yield return Timing.WaitForSeconds(2.5f);
hint.Hide = true;
playerDisplay.RemoveHint(hint);
}
Oh you mean the
Yeah I used to have other code that ran specific to each one
I forgot to collapse it after I ported the types
Woops
Yes since that indicates apl of them is like
class EventBadse : CustomEventsHanlder
Yeah I know I just had separate initialization that I ended up moving into the constructors
I forgot to collapse it
what do you think about the server specs
So beautiful
You know what
While I'm at it
You can put the where inside the foreach
Also you only need the last else if
Nvm
Wait nvm yes you can just use that to reg and create that and add into the thing
Also can create an if CustomSetting for it too
What
This is accurate
I'm unsure if I like that more
I thought about it but didn't
You know what I think I'll just leave some comments so I know what the hell any of this is because that's why I had it expanded out in the first place
I'm unsure what you mean by this
If I can ask, how did you get the custom audio playing?
What do you do with those base class where are they registering to customeventmanager?
There are audiotoys
oh perfect! I'll take a look into it, thanks!
Or you can use a plugin AudioPlayer or smth idk
#1336031121699377213 here probably already posted
Discord search suck ass so you have to manually scroll down
base labapi also has functionality for playing audio through a speaker as long as you have a way to load its pcm samples
I'll do a bit of digging and testing!
You can load your samples by orbis iirc
If they don't fall into any of the other categories I create an instance and register them
nvorbis works for loading the samples yeah the audios just have to be mono 48khz .ogg files to play properly through speakers i think
You didn't call NetworkServer.Spawn smh
Where? Like actually you doing twice the work
no
no it wasn't in the spawn
I'm so confused
What are you talking about rn
I'm not that smart
The if statement
Yes
The 1st and the 3rd is basically the same.
And I guess ALL of the checking stuff inherit from CEH
Speaker api
wait wtf its 9am already
the SpeakerToy, or is this a plugin?
i just woke up too tired yesterday
skill issue
You need to set ForceFullFriendlyFire on the attacker damage handler
I always too tired
Oh it's already been answered mb
With speaker toy and custom exiled speaker api
ah damn, I'll have to figure it out in LabApi
I missed my early alarm so I basically woke up 40m late
It just loads into memory sadly
The whole file iirc
but you must read the audio yourself
Yeah everything inherits from CEH
do you have any code examples or repos?
yeah but for most cases thats.... okay
yo axwabo
i have a question that is stupid i know
Me loading a 10h version of Foreground Destruction
but how tf does the game interpret the position
because if i position myself on top of the primitive nothing happens
but if i position myself inside of it it does
Decompile and read it yourself 
Timing.CallDelayed
Oh yeah this exact reason is why i made my own plugin to stream audio files
to just play an audio using a speaker in labapi with no other api it should be as simple as like
SpeakerToy speaker;
// set controller id, whatever else you need
speaker.Play(SomeClass.GetAudioSamples("path");
you'd have to make SomeClass.GetAudioSamples yourself to get the pcm samples from a file
Do you do this every time you have a simple delay ๐ญ
the most complex part is getting the audio samples
yeah
currently i just use nvorbis to load it into memory bc i dont have any long audio files and im lazy
but i might do streaming sometime whenever i need it maybe
You dont do corountines for a one second delay? 
sometime i can publish my ogg streamer
๐
its kind of specialized but the code isnt hard to copy
i think i have code somewhere that does it but i dont need it enough to put in the effort to add it yet
2 more years and axwabo will make his public ๐
i can send it to you if you remind me to
Let me change this
fuck ill have to set an alarm
Can we ban putting the one line code in the same line as the if statement
I'm crying bro
keep in mind what im sending you wont work out of the box for everything youd wanna do and youll have to sort through some spagbetti code to get to the good stuff


